Loading quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +14 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DragSource; Loading @@ -51,6 +52,8 @@ import com.android.launcher3.model.BgDataModel.FixedContainerItems; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.uioverrides.PredictedAppIcon; import com.android.launcher3.uioverrides.QuickstepLauncher; Loading Loading @@ -89,10 +92,14 @@ public class HotseatPredictionController implements DragController.DragListener, private List<PredictedAppIcon.PredictedIconOutlineDrawing> mOutlineDrawings = new ArrayList<>(); private boolean mEnableHotseatLongPressTipForTesting = true; private final View.OnLongClickListener mPredictionLongClickListener = v -> { if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; if (mLauncher.getWorkspace().isSwitchingState()) return false; if (!mLauncher.getOnboardingPrefs().getBoolean( TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onWorkspaceItemLongClick"); if (mEnableHotseatLongPressTipForTesting && !mLauncher.getOnboardingPrefs().getBoolean( OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN)) { Snackbar.show(mLauncher, R.string.hotseat_tip_gaps_filled, R.string.hotseat_prediction_settings, null, Loading Loading @@ -132,6 +139,12 @@ public class HotseatPredictionController implements DragController.DragListener, onHotseatHierarchyChanged(); } /** Enables/disabled the hotseat prediction icon long press edu for testing. */ @VisibleForTesting public void enableHotseatEdu(boolean enable) { mEnableHotseatLongPressTipForTesting = enable; } private void onHotseatHierarchyChanged() { if (mPauseFlags == 0 && !mLauncher.isWorkspaceLoading()) { // Post update after a single frame to avoid layout within layout Loading quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +6 −0 Original line number Diff line number Diff line Loading @@ -317,6 +317,12 @@ public class QuickstepLauncher extends Launcher { return mHotseatPredictionController; } @Override public void enableHotseatEdu(boolean enable) { super.enableHotseatEdu(enable); mHotseatPredictionController.enableHotseatEdu(enable); } /** * Builds the {@link QuickstepTransitionManager} instance to use for managing transitions. */ Loading src/com/android/launcher3/Launcher.java +4 −0 Original line number Diff line number Diff line Loading @@ -3259,6 +3259,10 @@ public class Launcher extends StatefulActivity<LauncherState> return new LauncherAccessibilityDelegate(this); } /** Enables/disabled the hotseat prediction icon long press edu for testing. */ @VisibleForTesting public void enableHotseatEdu(boolean enable) {} /** * @see LauncherState#getOverviewScaleAndOffset(Launcher) */ Loading tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest { // Pre verifying the screens executeOnLauncher(launcher -> { launcher.enableHotseatEdu(false); assertPagesExist(launcher, 0, 1); assertItemsOnPage(launcher, 0, "Play Store", "Maps"); assertPageEmpty(launcher, 1); Loading @@ -67,6 +68,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest { @After public void tearDown() { executeOnLauncher(launcher -> launcher.enableHotseatEdu(true)); mLauncher.useDefaultWorkspaceLayoutOnReload(); } Loading Loading
quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +14 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DragSource; Loading @@ -51,6 +52,8 @@ import com.android.launcher3.model.BgDataModel.FixedContainerItems; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.touch.ItemLongClickListener; import com.android.launcher3.uioverrides.PredictedAppIcon; import com.android.launcher3.uioverrides.QuickstepLauncher; Loading Loading @@ -89,10 +92,14 @@ public class HotseatPredictionController implements DragController.DragListener, private List<PredictedAppIcon.PredictedIconOutlineDrawing> mOutlineDrawings = new ArrayList<>(); private boolean mEnableHotseatLongPressTipForTesting = true; private final View.OnLongClickListener mPredictionLongClickListener = v -> { if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; if (mLauncher.getWorkspace().isSwitchingState()) return false; if (!mLauncher.getOnboardingPrefs().getBoolean( TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onWorkspaceItemLongClick"); if (mEnableHotseatLongPressTipForTesting && !mLauncher.getOnboardingPrefs().getBoolean( OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN)) { Snackbar.show(mLauncher, R.string.hotseat_tip_gaps_filled, R.string.hotseat_prediction_settings, null, Loading Loading @@ -132,6 +139,12 @@ public class HotseatPredictionController implements DragController.DragListener, onHotseatHierarchyChanged(); } /** Enables/disabled the hotseat prediction icon long press edu for testing. */ @VisibleForTesting public void enableHotseatEdu(boolean enable) { mEnableHotseatLongPressTipForTesting = enable; } private void onHotseatHierarchyChanged() { if (mPauseFlags == 0 && !mLauncher.isWorkspaceLoading()) { // Post update after a single frame to avoid layout within layout Loading
quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +6 −0 Original line number Diff line number Diff line Loading @@ -317,6 +317,12 @@ public class QuickstepLauncher extends Launcher { return mHotseatPredictionController; } @Override public void enableHotseatEdu(boolean enable) { super.enableHotseatEdu(enable); mHotseatPredictionController.enableHotseatEdu(enable); } /** * Builds the {@link QuickstepTransitionManager} instance to use for managing transitions. */ Loading
src/com/android/launcher3/Launcher.java +4 −0 Original line number Diff line number Diff line Loading @@ -3259,6 +3259,10 @@ public class Launcher extends StatefulActivity<LauncherState> return new LauncherAccessibilityDelegate(this); } /** Enables/disabled the hotseat prediction icon long press edu for testing. */ @VisibleForTesting public void enableHotseatEdu(boolean enable) {} /** * @see LauncherState#getOverviewScaleAndOffset(Launcher) */ Loading
tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest { // Pre verifying the screens executeOnLauncher(launcher -> { launcher.enableHotseatEdu(false); assertPagesExist(launcher, 0, 1); assertItemsOnPage(launcher, 0, "Play Store", "Maps"); assertPageEmpty(launcher, 1); Loading @@ -67,6 +68,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest { @After public void tearDown() { executeOnLauncher(launcher -> launcher.enableHotseatEdu(true)); mLauncher.useDefaultWorkspaceLayoutOnReload(); } Loading