diff options
author | Adam Copp <adamcopp@google.com> | 2013-11-12 16:26:04 +0000 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 00:48:00 -0700 |
commit | 064d39d303092190c3f3b8ec87b459ca15afce2d (patch) | |
tree | 157fe79920ab67b85762f0042c009adf985ee300 /src/com/android | |
parent | 8c368502d7ef3751da8a2ea2a25e41ad13587578 (diff) | |
download | android_packages_apps_Trebuchet-064d39d303092190c3f3b8ec87b459ca15afce2d.tar.gz android_packages_apps_Trebuchet-064d39d303092190c3f3b8ec87b459ca15afce2d.tar.bz2 android_packages_apps_Trebuchet-064d39d303092190c3f3b8ec87b459ca15afce2d.zip |
Hooks for subclasses to react to home presses.
This provides the nessecary hooks for GEL so that it can prevent
scrolling to the home screen when a search is open, instead choosing to
dismiss the search.
Bug: 11128544
Change-Id: I3c1b67bc271c1342db4a0abac364f2923bdeba3a
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 50b6573d1..d674ef5eb 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1880,7 +1880,7 @@ public class Launcher extends Activity // In all these cases, only animate if we're already on home mWorkspace.exitWidgetResizeMode(); if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive() && - openFolder == null) { + openFolder == null && shouldMoveToDefaultScreenOnHomeIntent()) { mWorkspace.moveToDefaultScreen(true); } @@ -1906,6 +1906,8 @@ public class Launcher extends Activity if (mAppsCustomizeLayout != null) { mAppsCustomizeLayout.reset(); } + + onHomeIntent(); } if (DEBUG_RESUME_TIME) { @@ -1913,6 +1915,21 @@ public class Launcher extends Activity } } + /** + * Override point for subclasses to prevent movement to the default screen when the home + * button is pressed. Used (for example) in GEL, to prevent movement during a search. + */ + protected boolean shouldMoveToDefaultScreenOnHomeIntent() { + return true; + } + + /** + * Override point for subclasses to provide custom behaviour for when a home intent is fired. + */ + protected void onHomeIntent() { + // Do nothing + } + @Override public void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); |