Loading src/com/android/launcher3/Hotseat.java +2 −1 Original line number Diff line number Diff line Loading @@ -123,9 +123,10 @@ public class Hotseat extends FrameLayout allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); allAppsButton.setOnKeyListener(new HotseatIconKeyEventListener()); if (mLauncher != null) { allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); mLauncher.setAllAppsButton(allAppsButton); allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); allAppsButton.setOnClickListener(mLauncher); allAppsButton.setOnLongClickListener(mLauncher); allAppsButton.setOnFocusChangeListener(mLauncher.mFocusHandler); } Loading src/com/android/launcher3/Launcher.java +23 −12 Original line number Diff line number Diff line Loading @@ -986,7 +986,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); } Loading Loading @@ -2531,12 +2531,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 */); } } Loading Loading @@ -3113,6 +3118,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()) { Loading Loading @@ -3305,14 +3315,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); } /** Loading @@ -3323,7 +3334,7 @@ public class Launcher extends Activity if (resetPageToZero) { mWidgetsView.scrollToTop(); } showAppsOrWidgets(animated, State.WIDGETS); showAppsOrWidgets(State.WIDGETS, animated, false); mWidgetsView.post(new Runnable() { @Override Loading @@ -3340,7 +3351,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; Loading @@ -3350,7 +3361,7 @@ public class Launcher extends Activity } if (toState == State.APPS) { mStateTransitionAnimation.startAnimationToAllApps(mState, animated); mStateTransitionAnimation.startAnimationToAllApps(animated, focusSearchBar); } else { mStateTransitionAnimation.startAnimationToWidgets(animated); } Loading Loading @@ -3420,7 +3431,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); } Loading src/com/android/launcher3/LauncherStateTransitionAnimation.java +18 −7 Original line number Diff line number Diff line Loading @@ -91,7 +91,6 @@ public class LauncherStateTransitionAnimation { */ static abstract class PrivateTransitionCallbacks { void onRevealViewVisible(View revealView, View contentView, View allAppsButtonView) {} void onAnimationComplete(View revealView, View contentView, View allAppsButtonView) {} float getMaterialRevealViewFinalAlpha(View revealView) { return 0; } Loading @@ -108,6 +107,7 @@ public class LauncherStateTransitionAnimation { View allAppsButtonView) { return null; } void onTransitionComplete() {} } public static final String TAG = "LauncherStateTransitionAnimation"; Loading @@ -128,8 +128,12 @@ public class LauncherStateTransitionAnimation { /** * Starts an animation to the apps view. * * @param startSearchAfterTransition Immediately starts app search after the transition to * All Apps is completed. */ public void startAnimationToAllApps(final Launcher.State fromState, final boolean animated) { public void startAnimationToAllApps(final boolean animated, final boolean startSearchAfterTransition) { final AllAppsContainerView toView = mLauncher.getAppsView(); PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() { private int[] mAllAppsToPanelDelta; Loading Loading @@ -171,10 +175,17 @@ public class LauncherStateTransitionAnimation { } }; } @Override void onTransitionComplete() { if (startSearchAfterTransition) { toView.startAppsSearch(); } } }; // Only animate the search bar if animating from spring loaded mode back to all apps startAnimationToOverlay(Workspace.State.NORMAL_HIDDEN, toView, toView.getContentView(), toView.getRevealView(), toView.getSearchBarView(), animated, true, cb); toView.getRevealView(), toView.getSearchBarView(), animated, true /* hideSearchBar */, cb); } /** Loading Loading @@ -348,7 +359,6 @@ public class LauncherStateTransitionAnimation { // Hide the reveal view revealView.setVisibility(View.INVISIBLE); pCb.onAnimationComplete(revealView, contentView, allAppsButtonView); // Disable all necessary layers for (View v : layerViews.keySet()) { Loading @@ -363,6 +373,7 @@ public class LauncherStateTransitionAnimation { // This can hold unnecessary references to views. mStateAnimation = null; pCb.onTransitionComplete(); } }); Loading Loading @@ -428,6 +439,7 @@ public class LauncherStateTransitionAnimation { dispatchOnLauncherTransitionPrepare(toView, animated, false); dispatchOnLauncherTransitionStart(toView, animated, false); dispatchOnLauncherTransitionEnd(toView, animated, false); pCb.onTransitionComplete(); } } Loading Loading @@ -682,9 +694,6 @@ public class LauncherStateTransitionAnimation { onCompleteRunnable.run(); } // Animation complete callback pCb.onAnimationComplete(revealView, contentView, allAppsButtonView); // Disable all necessary layers for (View v : layerViews.keySet()) { if (layerViews.get(v) == BUILD_AND_SET_LAYER) { Loading @@ -704,6 +713,7 @@ public class LauncherStateTransitionAnimation { // This can hold unnecessary references to views. mStateAnimation = null; pCb.onTransitionComplete(); } }); Loading Loading @@ -739,6 +749,7 @@ public class LauncherStateTransitionAnimation { dispatchOnLauncherTransitionPrepare(toView, animated, true); dispatchOnLauncherTransitionStart(toView, animated, true); dispatchOnLauncherTransitionEnd(toView, animated, true); pCb.onTransitionComplete(); // Run any queued runnables if (onCompleteRunnable != null) { Loading src/com/android/launcher3/allapps/AllAppsContainerView.java +9 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc return new DefaultAppSearchController(getContext(), this, mAppsRecyclerView); } /** * Focuses the search field and begins an app search. */ public void startAppsSearch() { if (mSearchBarController != null) { mSearchBarController.focusSearchField(); } } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading Loading
src/com/android/launcher3/Hotseat.java +2 −1 Original line number Diff line number Diff line Loading @@ -123,9 +123,10 @@ public class Hotseat extends FrameLayout allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label)); allAppsButton.setOnKeyListener(new HotseatIconKeyEventListener()); if (mLauncher != null) { allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); mLauncher.setAllAppsButton(allAppsButton); allAppsButton.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener()); allAppsButton.setOnClickListener(mLauncher); allAppsButton.setOnLongClickListener(mLauncher); allAppsButton.setOnFocusChangeListener(mLauncher.mFocusHandler); } Loading
src/com/android/launcher3/Launcher.java +23 −12 Original line number Diff line number Diff line Loading @@ -986,7 +986,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); } Loading Loading @@ -2531,12 +2531,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 */); } } Loading Loading @@ -3113,6 +3118,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()) { Loading Loading @@ -3305,14 +3315,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); } /** Loading @@ -3323,7 +3334,7 @@ public class Launcher extends Activity if (resetPageToZero) { mWidgetsView.scrollToTop(); } showAppsOrWidgets(animated, State.WIDGETS); showAppsOrWidgets(State.WIDGETS, animated, false); mWidgetsView.post(new Runnable() { @Override Loading @@ -3340,7 +3351,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; Loading @@ -3350,7 +3361,7 @@ public class Launcher extends Activity } if (toState == State.APPS) { mStateTransitionAnimation.startAnimationToAllApps(mState, animated); mStateTransitionAnimation.startAnimationToAllApps(animated, focusSearchBar); } else { mStateTransitionAnimation.startAnimationToWidgets(animated); } Loading Loading @@ -3420,7 +3431,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); } Loading
src/com/android/launcher3/LauncherStateTransitionAnimation.java +18 −7 Original line number Diff line number Diff line Loading @@ -91,7 +91,6 @@ public class LauncherStateTransitionAnimation { */ static abstract class PrivateTransitionCallbacks { void onRevealViewVisible(View revealView, View contentView, View allAppsButtonView) {} void onAnimationComplete(View revealView, View contentView, View allAppsButtonView) {} float getMaterialRevealViewFinalAlpha(View revealView) { return 0; } Loading @@ -108,6 +107,7 @@ public class LauncherStateTransitionAnimation { View allAppsButtonView) { return null; } void onTransitionComplete() {} } public static final String TAG = "LauncherStateTransitionAnimation"; Loading @@ -128,8 +128,12 @@ public class LauncherStateTransitionAnimation { /** * Starts an animation to the apps view. * * @param startSearchAfterTransition Immediately starts app search after the transition to * All Apps is completed. */ public void startAnimationToAllApps(final Launcher.State fromState, final boolean animated) { public void startAnimationToAllApps(final boolean animated, final boolean startSearchAfterTransition) { final AllAppsContainerView toView = mLauncher.getAppsView(); PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() { private int[] mAllAppsToPanelDelta; Loading Loading @@ -171,10 +175,17 @@ public class LauncherStateTransitionAnimation { } }; } @Override void onTransitionComplete() { if (startSearchAfterTransition) { toView.startAppsSearch(); } } }; // Only animate the search bar if animating from spring loaded mode back to all apps startAnimationToOverlay(Workspace.State.NORMAL_HIDDEN, toView, toView.getContentView(), toView.getRevealView(), toView.getSearchBarView(), animated, true, cb); toView.getRevealView(), toView.getSearchBarView(), animated, true /* hideSearchBar */, cb); } /** Loading Loading @@ -348,7 +359,6 @@ public class LauncherStateTransitionAnimation { // Hide the reveal view revealView.setVisibility(View.INVISIBLE); pCb.onAnimationComplete(revealView, contentView, allAppsButtonView); // Disable all necessary layers for (View v : layerViews.keySet()) { Loading @@ -363,6 +373,7 @@ public class LauncherStateTransitionAnimation { // This can hold unnecessary references to views. mStateAnimation = null; pCb.onTransitionComplete(); } }); Loading Loading @@ -428,6 +439,7 @@ public class LauncherStateTransitionAnimation { dispatchOnLauncherTransitionPrepare(toView, animated, false); dispatchOnLauncherTransitionStart(toView, animated, false); dispatchOnLauncherTransitionEnd(toView, animated, false); pCb.onTransitionComplete(); } } Loading Loading @@ -682,9 +694,6 @@ public class LauncherStateTransitionAnimation { onCompleteRunnable.run(); } // Animation complete callback pCb.onAnimationComplete(revealView, contentView, allAppsButtonView); // Disable all necessary layers for (View v : layerViews.keySet()) { if (layerViews.get(v) == BUILD_AND_SET_LAYER) { Loading @@ -704,6 +713,7 @@ public class LauncherStateTransitionAnimation { // This can hold unnecessary references to views. mStateAnimation = null; pCb.onTransitionComplete(); } }); Loading Loading @@ -739,6 +749,7 @@ public class LauncherStateTransitionAnimation { dispatchOnLauncherTransitionPrepare(toView, animated, true); dispatchOnLauncherTransitionStart(toView, animated, true); dispatchOnLauncherTransitionEnd(toView, animated, true); pCb.onTransitionComplete(); // Run any queued runnables if (onCompleteRunnable != null) { Loading
src/com/android/launcher3/allapps/AllAppsContainerView.java +9 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc return new DefaultAppSearchController(getContext(), this, mAppsRecyclerView); } /** * Focuses the search field and begins an app search. */ public void startAppsSearch() { if (mSearchBarController != null) { mSearchBarController.focusSearchField(); } } @Override protected void onFinishInflate() { super.onFinishInflate(); Loading