summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-07-10 14:33:23 -0700
committerWinson Chung <winsonc@google.com>2015-07-10 16:08:56 -0700
commit76648c58d5fe8e5c0695f865243d3f421c53a84d (patch)
treefecf52a3b6890b74f0e6ffcea8473821a33bea0a /src/com/android/launcher3/Launcher.java
parent4a0df755161c65e2d24299aeaf7408b2e97036d3 (diff)
downloadandroid_packages_apps_Trebuchet-76648c58d5fe8e5c0695f865243d3f421c53a84d.tar.gz
android_packages_apps_Trebuchet-76648c58d5fe8e5c0695f865243d3f421c53a84d.tar.bz2
android_packages_apps_Trebuchet-76648c58d5fe8e5c0695f865243d3f421c53a84d.zip
Making long-press of AllApps to jump directly to search.
Bug: 22210146 Change-Id: Iacf28416d6e31233a68e3b41576a8860b4b72b88
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 55b8f0373..339d5a3f7 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -990,7 +990,7 @@ public class Launcher extends Activity
// view after launching an app, as they may be depending on the UI to be static to
// switch to another app, otherwise, if it was
showAppsView(false /* animated */, false /* resetListToTop */,
- !launchedFromApp /* updatePredictedApps */);
+ !launchedFromApp /* updatePredictedApps */, false /* focusSearchBar */);
} else if (mOnResumeState == State.WIDGETS) {
showWidgetsView(false, false);
}
@@ -2543,12 +2543,17 @@ public class Launcher extends Activity
*/
protected void onClickAllAppsButton(View v) {
if (LOGD) Log.d(TAG, "onClickAllAppsButton");
- if (isAppsViewVisible()) {
- showWorkspace(true);
- } else {
- // Try and refresh the set of predicted apps before we enter launcher
+ if (!isAppsViewVisible()) {
+ showAppsView(true /* animated */, false /* resetListToTop */,
+ true /* updatePredictedApps */, false /* focusSearchBar */);
+ }
+ }
+
+ protected void onLongClickAllAppsButton(View v) {
+ if (LOGD) Log.d(TAG, "onLongClickAllAppsButton");
+ if (!isAppsViewVisible()) {
showAppsView(true /* animated */, false /* resetListToTop */,
- true /* updatePredictedApps */);
+ true /* updatePredictedApps */, true /* focusSearchBar */);
}
}
@@ -3125,6 +3130,11 @@ public class Launcher extends Activity
if (isWorkspaceLocked()) return false;
if (mState != State.WORKSPACE) return false;
+ if (v == mAllAppsButton) {
+ onLongClickAllAppsButton(v);
+ return true;
+ }
+
if (v instanceof Workspace) {
if (!mWorkspace.isInOverviewMode()) {
if (!mWorkspace.isTouchActive()) {
@@ -3317,14 +3327,15 @@ public class Launcher extends Activity
/**
* Shows the apps view.
*/
- void showAppsView(boolean animated, boolean resetListToTop, boolean updatePredictedApps) {
+ void showAppsView(boolean animated, boolean resetListToTop, boolean updatePredictedApps,
+ boolean focusSearchBar) {
if (resetListToTop) {
mAppsView.scrollToTop();
}
if (updatePredictedApps) {
tryAndUpdatePredictedApps();
}
- showAppsOrWidgets(animated, State.APPS);
+ showAppsOrWidgets(State.APPS, animated, focusSearchBar);
}
/**
@@ -3335,7 +3346,7 @@ public class Launcher extends Activity
if (resetPageToZero) {
mWidgetsView.scrollToTop();
}
- showAppsOrWidgets(animated, State.WIDGETS);
+ showAppsOrWidgets(State.WIDGETS, animated, false);
mWidgetsView.post(new Runnable() {
@Override
@@ -3352,7 +3363,7 @@ public class Launcher extends Activity
*/
// TODO: calling method should use the return value so that when {@code false} is returned
// the workspace transition doesn't fall into invalid state.
- private boolean showAppsOrWidgets(boolean animated, State toState) {
+ private boolean showAppsOrWidgets(State toState, boolean animated, boolean focusSearchBar) {
if (mState != State.WORKSPACE && mState != State.APPS_SPRING_LOADED &&
mState != State.WIDGETS_SPRING_LOADED) {
return false;
@@ -3362,7 +3373,7 @@ public class Launcher extends Activity
}
if (toState == State.APPS) {
- mStateTransitionAnimation.startAnimationToAllApps(mState, animated);
+ mStateTransitionAnimation.startAnimationToAllApps(animated, focusSearchBar);
} else {
mStateTransitionAnimation.startAnimationToWidgets(animated);
}
@@ -3432,7 +3443,7 @@ public class Launcher extends Activity
void exitSpringLoadedDragMode() {
if (mState == State.APPS_SPRING_LOADED) {
showAppsView(true /* animated */, false /* resetListToTop */,
- false /* updatePredictedApps */);
+ false /* updatePredictedApps */, false /* focusSearchBar */);
} else if (mState == State.WIDGETS_SPRING_LOADED) {
showWidgetsView(true, false);
}