From 3493764337c648410bfd937707e644bb6ca84ed2 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Tue, 20 Sep 2022 18:02:41 -0500 Subject: [PATCH 1/9] Adding flag for material U popup Test: compile Bug: 247880037 Change-Id: I989fe88e070f5fe14494aa2c3d00071259907472 --- src/com/android/launcher3/config/FeatureFlags.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 0e36dc0e60..045391f2ba 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -294,6 +294,9 @@ public final class FeatureFlags { public static final BooleanFlag ENABLE_WIDGET_PICKER_DEPTH = new DeviceFlag( "ENABLE_WIDGET_PICKER_DEPTH", true, "Enable changing depth in widget picker."); + public static final BooleanFlag POPUP_MATERIAL_U = new DeviceFlag( + "POPUP_MATERIAL_U", false, "Switch popup UX to use material U"); + public static void initialize(Context context) { synchronized (sDebugFlags) { for (DebugFlag flag : sDebugFlags) { From 5144be3903f97dcb8a557bfee8158ccbebdab028 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Wed, 21 Sep 2022 16:57:53 -0700 Subject: [PATCH 2/9] Prevent taps on initial TaskView animated into split select Fixes: 247843657 Test: Tapping on animating taskView as soon as split top is selected from app menu doesn't result in starting split prematurely. Change-Id: I94455d9bab381e5223f70cab981830d51a8fad6b --- .../launcher3/uioverrides/QuickstepLauncher.java | 2 +- .../android/quickstep/views/FloatingTaskView.java | 2 +- .../android/quickstep/views/GroupedTaskView.java | 4 ++-- .../com/android/quickstep/views/RecentsView.java | 4 ++-- .../src/com/android/quickstep/views/TaskView.java | 13 +++++++++++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 1316ddda25..192ac6251e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -895,7 +895,7 @@ public class QuickstepLauncher extends Launcher { // load in, and then proceed to OverviewSplitSelect. if (isInState(OVERVIEW_SPLIT_SELECT)) { SplitSelectStateController splitSelectStateController = - ((RecentsView) getOverviewPanel()).getSplitPlaceholder(); + ((RecentsView) getOverviewPanel()).getSplitSelectController(); // Launcher will restart in Overview and then transition to OverviewSplitSelect. outState.putIBinder(PENDING_SPLIT_SELECT_INFO, ObjectWrapper.wrap( new PendingSplitSelectInfo( diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index c211d7ad4b..0c327aa7fd 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -151,7 +151,7 @@ public class FloatingTaskView extends FrameLayout { RecentsView recentsView = launcher.getOverviewPanel(); mOrientationHandler = recentsView.getPagedOrientationHandler(); - mStagePosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition(); + mStagePosition = recentsView.getSplitSelectController().getActiveSplitStagePosition(); mSplitPlaceholderView.setIcon(icon, mContext.getResources().getDimensionPixelSize(R.dimen.split_placeholder_icon_size)); mSplitPlaceholderView.getIconView().setRotation(mOrientationHandler.getDegreesRotated()); diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index 44ea0a0b5e..43054bebbb 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -191,7 +191,7 @@ public class GroupedTaskView extends TaskView { // Callbacks run from remote animation when recents animation not currently running InteractionJankMonitorWrapper.begin(this, InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Enter form GroupedTaskView"); - recentsView.getSplitPlaceholder().launchTasks(this /*groupedTaskView*/, + recentsView.getSplitSelectController().launchTasks(this /*groupedTaskView*/, success -> { endCallback.executeAllAndDestroy(); InteractionJankMonitorWrapper.end( @@ -206,7 +206,7 @@ public class GroupedTaskView extends TaskView { @Override public void launchTask(@NonNull Consumer callback, boolean freezeTaskList) { - getRecentsView().getSplitPlaceholder().launchTasks(mTask.key.id, mSecondaryTask.key.id, + getRecentsView().getSplitSelectController().launchTasks(mTask.key.id, mSecondaryTask.key.id, STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList, getSplitRatio()); } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 6a94094146..3407321f8e 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -960,7 +960,7 @@ public abstract class RecentsView Date: Thu, 22 Sep 2022 01:07:08 +0000 Subject: [PATCH 3/9] Add Ime transition type, Controlled and Atomic to LatencyType. Bug: 240192346 Bug: 234812580 Test: Manual Change-Id: I90042aa41acb1a01e3c45f67ccdc9c0f2f0eaf81 --- src/com/android/launcher3/logging/StatsLogManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index 32237e2639..22627b4ac2 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -744,8 +744,9 @@ public class StatsLogManager implements ResourceBasedOverride { HOT(2), TIMEOUT(3), FAIL(4), - COLD_USERWAITING(5); - + COLD_USERWAITING(5), + ATOMIC(6), + CONTROLLED(7); private final int mId; LatencyType(int id) { From e7c222cdb528685d56a8f8c8ca540df4ba9c758d Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Thu, 22 Sep 2022 11:10:50 -0500 Subject: [PATCH 4/9] Check for null when calling getCreatedActivity which is marked as Nullable Fix: 243508135 Test: compiles Change-Id: Id1ff2cf68fa10690a1bbec60a0c17cceab9db8d1 --- .../src/com/android/quickstep/OverviewCommandHelper.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index 57a26ee8ba..875b72cb34 100644 --- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -240,8 +240,11 @@ public class OverviewCommandHelper { interactionHandler.onGestureCancelled(); cmd.removeListener(this); - RecentsView createdRecents = - activityInterface.getCreatedActivity().getOverviewPanel(); + T createdActivity = activityInterface.getCreatedActivity(); + if (createdActivity == null) { + return; + } + RecentsView createdRecents = createdActivity.getOverviewPanel(); if (createdRecents != null) { createdRecents.onRecentsAnimationComplete(); } From ceff6537eefbbd2bb56f1b9533a1c0f069cdb311 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 22 Sep 2022 12:08:41 -0700 Subject: [PATCH 5/9] Set package name on the floating intent Test: treehugger Bug: 237678727 Change-Id: I70923e62893cd6578fa3fa21e025cd5cf5e15edf --- .../android/launcher3/taskbar/FloatingTaskIntentResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/FloatingTaskIntentResolver.java b/quickstep/src/com/android/launcher3/taskbar/FloatingTaskIntentResolver.java index c62493c828..5f4d239532 100644 --- a/quickstep/src/com/android/launcher3/taskbar/FloatingTaskIntentResolver.java +++ b/quickstep/src/com/android/launcher3/taskbar/FloatingTaskIntentResolver.java @@ -68,7 +68,7 @@ public class FloatingTaskIntentResolver { return null; } ComponentName component = new ComponentName(packageName, activityName); - Intent intent = new Intent(action).setComponent(component); + Intent intent = new Intent(action).setComponent(component).setPackage(packageName); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Log.d(TAG, "createIntent returning: " + intent); return intent; From 23ff6774b758c559748d91994b989019621dd30d Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Wed, 21 Sep 2022 10:03:47 -0700 Subject: [PATCH 6/9] Fix pause work apps overlapping IME The bottom margin for button in gesture navigation is wrong. The bottom margin for the button is supposed to be 20dp from the gesture nav bar, not 20dp from the bottom of the screen. The calculation was correct for 3 button nav but was forgotten to be applied to gesture nav. bug: 246243359 test: Manual - after: https://hsv.googleplex.com/5763335673872384 Change-Id: If678a70b4ad43791cf9e66390164e1ab25a6e366 --- src/com/android/launcher3/allapps/WorkModeSwitch.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java index a5894484ee..15fb77cfb3 100644 --- a/src/com/android/launcher3/allapps/WorkModeSwitch.java +++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java @@ -97,12 +97,10 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi bottomMargin += dp.hotseatQsbHeight; } - if (!dp.isGestureMode) { - if (dp.isTaskbarPresent) { - bottomMargin += dp.taskbarSize; - } else { - bottomMargin += insets.bottom; - } + if (!dp.isGestureMode && dp.isTaskbarPresent) { + bottomMargin += dp.taskbarSize; + } else { + bottomMargin += insets.bottom; } lp.bottomMargin = bottomMargin; From 8ae6b852d71d27e232f586c408de8dc458c58caf Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 22 Sep 2022 22:10:20 +0000 Subject: [PATCH 7/9] Revert "Fix case of gesture being stuck when the Launcher is stopped mid-gesture" This reverts commit 240b064cdb9df3914fe90a55ba94a5101bbd2b22. Reason for revert: b/248344141 Change-Id: I559e583ddea4a68b4291ceb8ba119500d051ed36 --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 41c220b39b..81a5c1cb9d 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1150,13 +1150,6 @@ public abstract class AbsSwipeUpHandler, boolean isCancel) { long duration = MAX_SWIPE_DURATION; float currentShift = mCurrentShift.value; - boolean recentsVisible = mRecentsView != null - && (mRecentsView.getWindowVisibility() == View.VISIBLE); - if (!recentsVisible) { - // We've hit a case where Launcher is been stopped mid-gesture, in this case, force - // a LAST_TASK end target - isCancel = true; - } final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity, isFling, isCancel); // Set the state, but don't notify until the animation completes @@ -1236,7 +1229,7 @@ public abstract class AbsSwipeUpHandler, // Let RecentsView handle the scrolling to the task, which we launch in startNewTask() // or resumeLastTask(). - if (recentsVisible) { + if (mRecentsView != null) { ActiveGestureLog.INSTANCE.trackEvent(ActiveGestureErrorDetector.GestureEvent .SET_ON_PAGE_TRANSITION_END_CALLBACK); mRecentsView.setOnPageTransitionEndCallback( From bdcc17c2aa4e5243601b5789b8988e62955b05ac Mon Sep 17 00:00:00 2001 From: Federico Baron Date: Mon, 19 Sep 2022 13:53:32 -0700 Subject: [PATCH 8/9] Add rotation to folder pagination for delightful pagination Here we add rotation for the page indicator in order to make it align with the new animation design. Bug: 247561880 Test: manual Change-Id: I91202c8ac259d4876f6182938db79c466f99c6ed --- .../pageindicators/PageIndicatorDots.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java index 17985368a0..439e1c7a45 100644 --- a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java +++ b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java @@ -59,10 +59,13 @@ public class PageIndicatorDots extends View implements PageIndicator { private static final int DOT_ACTIVE_ALPHA = 255; private static final int DOT_INACTIVE_ALPHA = 128; private static final int DOT_GAP_FACTOR = 3; + private static final float DOT_GAP_FACTOR_FLOAT = 3.8f; // This value approximately overshoots to 1.5 times the original size. private static final float ENTER_ANIMATION_OVERSHOOT_TENSION = 4.9f; + private static final float INDICATOR_ROTATION = 180f; + private static final RectF sTempRect = new RectF(); private static final Property CURRENT_POSITION @@ -121,7 +124,12 @@ public class PageIndicatorDots extends View implements PageIndicator { mPaginationPaint.setStyle(Style.FILL); mPaginationPaint.setColor(Themes.getAttrColor(context, R.attr.folderPaginationColor)); mDotRadius = getResources().getDimension(R.dimen.page_indicator_dot_size) / 2; - mCircleGap = DOT_GAP_FACTOR * mDotRadius; + + if (SHOW_DELIGHTFUL_PAGINATION_FOLDER.get()) { + mCircleGap = DOT_GAP_FACTOR_FLOAT * mDotRadius; + } else { + mCircleGap = DOT_GAP_FACTOR * mDotRadius; + } mPageIndicatorSize = getResources().getDimension( R.dimen.page_indicator_current_page_indicator_size); if (!SHOW_DELIGHTFUL_PAGINATION_FOLDER.get()) { @@ -298,7 +306,17 @@ public class PageIndicatorDots extends View implements PageIndicator { mPaginationPaint.setAlpha(DOT_ACTIVE_ALPHA); if (SHOW_DELIGHTFUL_PAGINATION_FOLDER.get()) { - canvas.drawRect(getActiveRect(), mPaginationPaint); + RectF currRect = getActiveRect(); + int scrollPerPage = getScrollPerPage(); + + // This IF is to avoid division by 0 + if (scrollPerPage != 0) { + int delta = mCurrentScroll % scrollPerPage; + canvas.rotate((INDICATOR_ROTATION * delta) / scrollPerPage, + currRect.centerX(), currRect.centerY()); + } + + canvas.drawRect(currRect, mPaginationPaint); } else { canvas.drawRoundRect(getActiveRect(), mDotRadius, mDotRadius, mPaginationPaint); } @@ -375,11 +393,18 @@ public class PageIndicatorDots extends View implements PageIndicator { return (mPageIndicatorSize / 2) - mDotRadius; } + /** + * Returns an int that is the amount we need to scroll per page + */ + private int getScrollPerPage() { + return mNumPages > 1 ? mTotalScroll / (mNumPages - 1) : 0; + } + /** * The current scroll adjusted for the distance the indicator needs to travel on the screen */ private float getIndicatorScrollDistance() { - float scrollPerPage = mNumPages > 1 ? mTotalScroll / (mNumPages - 1) : 0; + int scrollPerPage = getScrollPerPage(); return scrollPerPage != 0 ? ((float) mCurrentScroll / scrollPerPage) * mCircleGap : 0; } From 3aec5d59dcadd25b245b74687b033547ab66ddab Mon Sep 17 00:00:00 2001 From: Becky Qiu Date: Fri, 16 Sep 2022 11:17:50 -0700 Subject: [PATCH 9/9] [Toast] Change toast qpr1 feature flags to all apps device config. Bug: 247122218 Test: local Change-Id: I096f9fe4f8d071ea4b3292c6245da0c0ec509077 --- src/com/android/launcher3/Launcher.java | 2 +- src/com/android/launcher3/config/FeatureFlags.java | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 17fb7ebcd4..ce3abe60df 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -481,7 +481,6 @@ public class Launcher extends StatefulActivity mAppWidgetHost = createAppWidgetHost(); mAppWidgetHost.startListening(); - inflateRootView(R.layout.launcher); setupViews(); crossFadeWithPreviousAppearance(); mPopupDataProvider = new PopupDataProvider(this::updateNotificationDots); @@ -1262,6 +1261,7 @@ public class Launcher extends StatefulActivity * Finds all the views we need and configure them properly. */ protected void setupViews() { + inflateRootView(R.layout.launcher); mDragLayer = findViewById(R.id.drag_layer); mFocusHandler = mDragLayer.getFocusIndicatorHelper(); mWorkspace = mDragLayer.findViewById(R.id.workspace); diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index ef6350ed54..f14d3aa6f8 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -94,9 +94,6 @@ public final class FeatureFlags { getDebugFlag("ENABLE_FLOATING_SEARCH_BAR", false, "Keep All Apps search bar at the bottom (but above keyboard if open)"); - public static final BooleanFlag ENABLE_QUICK_SEARCH = new DeviceFlag("ENABLE_QUICK_SEARCH", - true, "Use quick search behavior."); - public static final BooleanFlag ENABLE_HIDE_HEADER = new DeviceFlag("ENABLE_HIDE_HEADER", true, "Hide header on keyboard before typing in all apps"); @@ -281,14 +278,6 @@ public final class FeatureFlags { "FOLDABLE_WORKSPACE_REORDER", true, "In foldables, when reordering the icons and widgets, is now going to use both sides"); - public static final BooleanFlag SHOW_SEARCH_EDUCARD_QSB = new DeviceFlag( - "SHOW_SEARCH_EDUCARD_QSB", false, "Shows Search Educard for QSB entry in OneSearch."); - - public static final BooleanFlag ENABLE_IME_LATENCY_LOGGER = getDebugFlag( - "ENABLE_IME_LATENCY_LOGGER", false, - "Enable option to log the keyboard latency for both atomic and controlled keyboard " - + "animations on an EditText"); - public static final BooleanFlag ENABLE_WIDGET_PICKER_DEPTH = new DeviceFlag( "ENABLE_WIDGET_PICKER_DEPTH", false, "Enable changing depth in widget picker.");