summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSandeep Siddhartha <sansid@google.com>2013-09-17 13:18:24 -0700
committerSandeep Siddhartha <sansid@google.com>2013-09-17 14:38:06 -0700
commitab2d9d72ae0a37553a82fa845c412167c727a258 (patch)
tree156f3ef3aa6b3b567cc5ebcb6df88ff6f0eb1f72 /src
parent578e09f7a8995db84f5c2a1f39aab3825ea7fe51 (diff)
downloadandroid_packages_apps_Trebuchet-ab2d9d72ae0a37553a82fa845c412167c727a258.tar.gz
android_packages_apps_Trebuchet-ab2d9d72ae0a37553a82fa845c412167c727a258.tar.bz2
android_packages_apps_Trebuchet-ab2d9d72ae0a37553a82fa845c412167c727a258.zip
Add settled/unsettled state information to launcher
Bug: 10789736 Bug: 10785435 Change-Id: I876707103d495f4a8e55909af63c75da210fefde
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Launcher.java19
-rw-r--r--src/com/android/launcher3/Workspace.java5
2 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index f8692c0ad..ca1074b5f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2305,6 +2305,23 @@ public class Launcher extends Activity
}
}
+ /**
+ * Called when the user stops interacting with the launcher.
+ * This implies that the user is now on the homescreen and is not doing housekeeping.
+ */
+ protected void onInteractionEnd() {}
+
+ /**
+ * Called when the user starts interacting with the launcher.
+ * The possible interactions are:
+ * - open all apps
+ * - reorder an app shortcut, or a widget
+ * - open the overview mode.
+ * This is a good time to stop doing things that only make sense
+ * when the user is on the homescreen and not doing housekeeping.
+ */
+ protected void onInteractionBegin() {}
+
void startApplicationDetailsActivity(ComponentName componentName) {
String packageName = componentName.getPackageName();
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
@@ -3071,6 +3088,7 @@ public class Launcher extends Activity
.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
onWorkspaceShown(animated);
+ onInteractionEnd();
}
public void onWorkspaceShown(boolean animated) {
@@ -3085,6 +3103,7 @@ public class Launcher extends Activity
// Change the state *after* we've called all the transition code
mState = State.APPS_CUSTOMIZE;
+ onInteractionBegin();
// Pause the auto-advance of widgets until we are out of AllApps
mUserPresent = false;
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e7ea221be..2758b8743 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -361,6 +361,7 @@ public class Workspace extends SmoothPagedView
mIsDragOccuring = true;
updateChildrenLayersEnabled(false);
mLauncher.lockScreenOrientation();
+ mLauncher.onInteractionBegin();
setChildrenBackgroundAlphaMultipliers(1f);
// Prevent any Un/InstallShortcutReceivers from updating the db while we are dragging
InstallShortcutReceiver.enableInstallQueue();
@@ -386,6 +387,7 @@ public class Workspace extends SmoothPagedView
removeExtraEmptyScreen();
mDragSourceInternal = null;
+ mLauncher.onInteractionEnd();
}
/**
@@ -1737,15 +1739,18 @@ public class Workspace extends SmoothPagedView
}
public void enterOverviewMode() {
+ mLauncher.onInteractionBegin();
enableOverviewMode(true, -1, true);
}
public void exitOverviewMode(boolean animated) {
exitOverviewMode(-1, animated);
+ mLauncher.onInteractionEnd();
}
public void exitOverviewMode(int snapPage, boolean animated) {
enableOverviewMode(false, snapPage, animated);
+ mLauncher.onInteractionEnd();
}
private void enableOverviewMode(boolean enable, int snapPage, boolean animated) {