Loading src/com/android/launcher3/Launcher.java +5 −29 Original line number Diff line number Diff line Loading @@ -867,17 +867,10 @@ public class Launcher extends BaseActivity if (mOnResumeState == State.WORKSPACE) { showWorkspace(false); } else if (mOnResumeState == State.APPS) { boolean launchedFromApp = (mWaitingForResume != null); // Don't update the predicted apps if the user is returning to launcher in the apps // 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 */, !launchedFromApp /* updatePredictedApps */); showAppsView(false /* animated */); } else if (mOnResumeState == State.WIDGETS) { showWidgetsView(false, false); } if (mOnResumeState != State.APPS) { tryAndUpdatePredictedApps(); } mOnResumeState = State.NONE; mPaused = false; Loading Loading @@ -2107,7 +2100,7 @@ public class Launcher extends BaseActivity if (!isAppsViewVisible()) { getUserEventDispatcher().logActionOnControl(Action.Touch.TAP, ControlType.ALL_APPS_BUTTON); showAppsView(true /* animated */, true /* updatePredictedApps */); showAppsView(true /* animated */); } else { showWorkspace(true); } Loading Loading @@ -2672,11 +2665,8 @@ public class Launcher extends BaseActivity /** * Shows the apps view. */ public void showAppsView(boolean animated, boolean updatePredictedApps) { public void showAppsView(boolean animated) { markAppsViewShown(); if (updatePredictedApps) { tryAndUpdatePredictedApps(); } showAppsOrWidgets(State.APPS, animated); } Loading Loading @@ -2796,7 +2786,7 @@ public class Launcher extends BaseActivity public void exitSpringLoadedDragMode() { if (mState == State.APPS_SPRING_LOADED) { showAppsView(true /* animated */, false /* updatePredictedApps */); showAppsView(true /* animated */); } else if (mState == State.WIDGETS_SPRING_LOADED) { showWidgetsView(true, false); } else if (mState == State.WORKSPACE_SPRING_LOADED) { Loading @@ -2804,19 +2794,6 @@ public class Launcher extends BaseActivity } } /** * Updates the set of predicted apps if it hasn't been updated since the last time Launcher was * resumed. */ public void tryAndUpdatePredictedApps() { if (mLauncherCallbacks != null) { List<ComponentKeyMapper<AppInfo>> apps = mLauncherCallbacks.getPredictedApps(); if (apps != null) { mAppsView.setPredictedApps(apps); } } } @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { final boolean result = super.dispatchPopulateAccessibilityEvent(event); Loading Loading @@ -3531,7 +3508,6 @@ public class Launcher extends BaseActivity // Update AllApps if (mAppsView != null) { mAppsView.removeApps(appInfos); tryAndUpdatePredictedApps(); } } Loading Loading @@ -3695,7 +3671,7 @@ public class Launcher extends BaseActivity switch (keyCode) { case KeyEvent.KEYCODE_A: if (mState == State.WORKSPACE) { showAppsView(true, true); showAppsView(true); return true; } break; Loading src/com/android/launcher3/LauncherCallbacks.java +0 −5 Original line number Diff line number Diff line Loading @@ -19,14 +19,10 @@ package com.android.launcher3; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * LauncherCallbacks is an interface used to extend the Launcher activity. It includes many hooks Loading Loading @@ -87,5 +83,4 @@ public interface LauncherCallbacks { */ boolean shouldMoveToDefaultScreenOnHomeIntent(); boolean hasSettings(); List<ComponentKeyMapper<AppInfo>> getPredictedApps(); } src/com/android/launcher3/allapps/AllAppsContainerView.java +0 −7 Original line number Diff line number Diff line Loading @@ -114,13 +114,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc } } /** * Sets the current set of predicted apps. */ public void setPredictedApps(List<ComponentKeyMapper<AppInfo>> apps) { mApps.setPredictedApps(apps); } /** * Sets the current set of apps. */ Loading src/com/android/launcher3/allapps/AllAppsTransitionController.java +3 −6 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */); mLauncher.showAppsView(true /* animated */); if (hasSpringAnimationHandler()) { mSpringAnimationHandler.add(mSearchSpring, true /* setDefaultValues */); // The icons are moving upwards, so we go to 0 from 1. (y-axis 1 is below 0.) Loading @@ -239,7 +239,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } mLauncher.showAppsView(true, /* animated */ false /* updatePredictedApps */); mLauncher.showAppsView(true /* animated */); } } } Loading @@ -256,12 +256,9 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect // Initialize values that should not change until #onDragEnd mStatusBarHeight = mLauncher.getDragLayer().getInsets().top; mHotseat.setVisibility(View.VISIBLE); if (!mLauncher.isAllAppsVisible()) { mLauncher.tryAndUpdatePredictedApps(); mAppsView.setVisibility(View.VISIBLE); } } } private void updateLightStatusBar(float shift) { // Use a light system UI (dark icons) if all apps is behind at least half of the status bar. Loading src/com/android/launcher3/testing/LauncherExtension.java +0 −9 Original line number Diff line number Diff line Loading @@ -7,13 +7,10 @@ import android.view.Menu; import com.android.launcher3.AppInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherCallbacks; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * This class represents a very trivial LauncherExtension. It primarily serves as a simple Loading Loading @@ -149,12 +146,6 @@ public class LauncherExtension extends Launcher { return false; } @Override public List<ComponentKeyMapper<AppInfo>> getPredictedApps() { // To debug app predictions, enable AlphabeticalAppsList#DEBUG_PREDICTIONS return new ArrayList<>(); } @Override public void onAttachedToWindow() { } Loading Loading
src/com/android/launcher3/Launcher.java +5 −29 Original line number Diff line number Diff line Loading @@ -867,17 +867,10 @@ public class Launcher extends BaseActivity if (mOnResumeState == State.WORKSPACE) { showWorkspace(false); } else if (mOnResumeState == State.APPS) { boolean launchedFromApp = (mWaitingForResume != null); // Don't update the predicted apps if the user is returning to launcher in the apps // 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 */, !launchedFromApp /* updatePredictedApps */); showAppsView(false /* animated */); } else if (mOnResumeState == State.WIDGETS) { showWidgetsView(false, false); } if (mOnResumeState != State.APPS) { tryAndUpdatePredictedApps(); } mOnResumeState = State.NONE; mPaused = false; Loading Loading @@ -2107,7 +2100,7 @@ public class Launcher extends BaseActivity if (!isAppsViewVisible()) { getUserEventDispatcher().logActionOnControl(Action.Touch.TAP, ControlType.ALL_APPS_BUTTON); showAppsView(true /* animated */, true /* updatePredictedApps */); showAppsView(true /* animated */); } else { showWorkspace(true); } Loading Loading @@ -2672,11 +2665,8 @@ public class Launcher extends BaseActivity /** * Shows the apps view. */ public void showAppsView(boolean animated, boolean updatePredictedApps) { public void showAppsView(boolean animated) { markAppsViewShown(); if (updatePredictedApps) { tryAndUpdatePredictedApps(); } showAppsOrWidgets(State.APPS, animated); } Loading Loading @@ -2796,7 +2786,7 @@ public class Launcher extends BaseActivity public void exitSpringLoadedDragMode() { if (mState == State.APPS_SPRING_LOADED) { showAppsView(true /* animated */, false /* updatePredictedApps */); showAppsView(true /* animated */); } else if (mState == State.WIDGETS_SPRING_LOADED) { showWidgetsView(true, false); } else if (mState == State.WORKSPACE_SPRING_LOADED) { Loading @@ -2804,19 +2794,6 @@ public class Launcher extends BaseActivity } } /** * Updates the set of predicted apps if it hasn't been updated since the last time Launcher was * resumed. */ public void tryAndUpdatePredictedApps() { if (mLauncherCallbacks != null) { List<ComponentKeyMapper<AppInfo>> apps = mLauncherCallbacks.getPredictedApps(); if (apps != null) { mAppsView.setPredictedApps(apps); } } } @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { final boolean result = super.dispatchPopulateAccessibilityEvent(event); Loading Loading @@ -3531,7 +3508,6 @@ public class Launcher extends BaseActivity // Update AllApps if (mAppsView != null) { mAppsView.removeApps(appInfos); tryAndUpdatePredictedApps(); } } Loading Loading @@ -3695,7 +3671,7 @@ public class Launcher extends BaseActivity switch (keyCode) { case KeyEvent.KEYCODE_A: if (mState == State.WORKSPACE) { showAppsView(true, true); showAppsView(true); return true; } break; Loading
src/com/android/launcher3/LauncherCallbacks.java +0 −5 Original line number Diff line number Diff line Loading @@ -19,14 +19,10 @@ package com.android.launcher3; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * LauncherCallbacks is an interface used to extend the Launcher activity. It includes many hooks Loading Loading @@ -87,5 +83,4 @@ public interface LauncherCallbacks { */ boolean shouldMoveToDefaultScreenOnHomeIntent(); boolean hasSettings(); List<ComponentKeyMapper<AppInfo>> getPredictedApps(); }
src/com/android/launcher3/allapps/AllAppsContainerView.java +0 −7 Original line number Diff line number Diff line Loading @@ -114,13 +114,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc } } /** * Sets the current set of predicted apps. */ public void setPredictedApps(List<ComponentKeyMapper<AppInfo>> apps) { mApps.setPredictedApps(apps); } /** * Sets the current set of apps. */ Loading
src/com/android/launcher3/allapps/AllAppsTransitionController.java +3 −6 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */); mLauncher.showAppsView(true /* animated */); if (hasSpringAnimationHandler()) { mSpringAnimationHandler.add(mSearchSpring, true /* setDefaultValues */); // The icons are moving upwards, so we go to 0 from 1. (y-axis 1 is below 0.) Loading @@ -239,7 +239,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } mLauncher.showAppsView(true, /* animated */ false /* updatePredictedApps */); mLauncher.showAppsView(true /* animated */); } } } Loading @@ -256,12 +256,9 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect // Initialize values that should not change until #onDragEnd mStatusBarHeight = mLauncher.getDragLayer().getInsets().top; mHotseat.setVisibility(View.VISIBLE); if (!mLauncher.isAllAppsVisible()) { mLauncher.tryAndUpdatePredictedApps(); mAppsView.setVisibility(View.VISIBLE); } } } private void updateLightStatusBar(float shift) { // Use a light system UI (dark icons) if all apps is behind at least half of the status bar. Loading
src/com/android/launcher3/testing/LauncherExtension.java +0 −9 Original line number Diff line number Diff line Loading @@ -7,13 +7,10 @@ import android.view.Menu; import com.android.launcher3.AppInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherCallbacks; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; /** * This class represents a very trivial LauncherExtension. It primarily serves as a simple Loading Loading @@ -149,12 +146,6 @@ public class LauncherExtension extends Launcher { return false; } @Override public List<ComponentKeyMapper<AppInfo>> getPredictedApps() { // To debug app predictions, enable AlphabeticalAppsList#DEBUG_PREDICTIONS return new ArrayList<>(); } @Override public void onAttachedToWindow() { } Loading