From ddf8ab0f4a25e8cfb7e39072a3e24d38f6902b63 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Fri, 4 Mar 2022 20:04:27 -0800 Subject: [PATCH 01/12] Update using tabs boolean immediately if it changes. It is less erroprone to assign the new value immediately after we have changed for a change. Test: Manual Bug: 222552955 Change-Id: Ief79ce0b25587c6b6e4f41e82b33692b06b5d083 --- src/com/android/launcher3/allapps/BaseAllAppsContainerView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java index bfc75153a5..0883e21286 100644 --- a/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/BaseAllAppsContainerView.java @@ -443,8 +443,8 @@ public abstract class BaseAllAppsContainerView Date: Mon, 7 Mar 2022 18:30:29 -0800 Subject: [PATCH 02/12] Recreate All Apps when Taskbar is recreated. Test: Manual Fix: 222039500 Fix: 222037737 Fix: 222034811 Change-Id: I53aa3ae77d03ae2a1d500d906ad2ed90efda6f4a --- .../launcher3/taskbar/TaskbarControllers.java | 3 +- .../launcher3/taskbar/TaskbarSharedState.java | 2 ++ .../allapps/TaskbarAllAppsContext.java | 1 - .../allapps/TaskbarAllAppsController.java | 30 +++++++++++++++++-- .../allapps/TaskbarAllAppsSlideInView.java | 14 +++++---- .../allapps/TaskbarAllAppsViewController.java | 4 +-- 6 files changed, 42 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java index d2e24e5bfa..a5999ccaac 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java @@ -116,7 +116,7 @@ public class TaskbarControllers { taskbarEduController.init(this); taskbarPopupController.init(this); taskbarForceVisibleImmersiveController.init(this); - taskbarAllAppsController.init(this); + taskbarAllAppsController.init(this, sharedState); mControllersToLog = new LoggableTaskbarController[] { taskbarDragController, navButtonController, navbarButtonsViewController, @@ -152,6 +152,7 @@ public class TaskbarControllers { taskbarAutohideSuspendController.onDestroy(); taskbarPopupController.onDestroy(); taskbarForceVisibleImmersiveController.onDestroy(); + taskbarAllAppsController.onDestroy(); mControllersToLog = null; } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java index 23beef0a8a..a5c55b0027 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java @@ -24,4 +24,6 @@ public class TaskbarSharedState { public boolean setupUIVisible = false; + public boolean allAppsVisible = false; + } diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java index a67ca7089b..23da499c8f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java @@ -166,7 +166,6 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { super.onAttachedToWindow(); ViewTreeObserverWrapper.addOnComputeInsetsListener( getViewTreeObserver(), this); - mActivity.mAllAppsViewController.show(); } @Override diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java index cf9d778296..044459e33a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsController.java @@ -38,6 +38,7 @@ import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.taskbar.TaskbarActivityContext; import com.android.launcher3.taskbar.TaskbarControllers; +import com.android.launcher3.taskbar.TaskbarSharedState; import java.util.List; import java.util.Optional; @@ -62,6 +63,7 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList private final LayoutParams mLayoutParams; private TaskbarControllers mControllers; + private TaskbarSharedState mSharedState; /** Window context for all apps if it is open. */ private @Nullable TaskbarAllAppsContext mAllAppsContext; @@ -77,9 +79,19 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList } /** Initialize the controller. */ - public void init(TaskbarControllers controllers) { - if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) { - mControllers = controllers; + public void init(TaskbarControllers controllers, TaskbarSharedState sharedState) { + if (!FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()) { + return; + } + mControllers = controllers; + mSharedState = sharedState; + + /* + * Recreate All Apps if it was open in the previous Taskbar instance (e.g. the configuration + * changed). + */ + if (mSharedState.allAppsVisible) { + show(false); } } @@ -112,10 +124,15 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList /** Opens the {@link TaskbarAllAppsContainerView} in a new window. */ public void show() { + show(true); + } + + private void show(boolean animate) { if (mProxyView.isOpen()) { return; } mProxyView.show(); + mSharedState.allAppsVisible = true; mAllAppsContext = new TaskbarAllAppsContext(mTaskbarContext, this, @@ -129,6 +146,7 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList mAllAppsContext.getAppsView().getFloatingHeaderView() .findFixedRowByType(PredictionRowView.class) .setPredictedApps(mPredictedApps); + mAllAppsContext.getAllAppsViewController().show(animate); } /** Closes the {@link TaskbarAllAppsContainerView}. */ @@ -148,6 +166,12 @@ public final class TaskbarAllAppsController implements OnDeviceProfileChangeList return; } mProxyView.close(false); + mSharedState.allAppsVisible = false; + onDestroy(); + } + + /** Destroys the controller and any All Apps window if present. */ + public void onDestroy() { mTaskbarContext.removeOnDeviceProfileChangeListener(this); Optional.ofNullable(mAllAppsContext) .map(c -> c.getSystemService(WindowManager.class)) diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index 02aa3f208b..5d2d72af37 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -50,17 +50,21 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView Date: Thu, 10 Mar 2022 18:21:26 +0000 Subject: [PATCH 03/12] Revert "Sync hotseat/taskbar handoff" This reverts commit ede8718e63abb387bbca8b03e5f58273020cf2f2. Reason for revert: causing ANR b/223789074 Bug: 223789074 Bug: 223443781 Bug: 202507555 Change-Id: Ibd76939a345f54e8945cdd97e652f5e06e40edcb --- Android.bp | 3 -- .../TaskbarLauncherStateController.java | 35 ------------------- .../taskbar/TaskbarViewController.java | 14 ++------ 3 files changed, 3 insertions(+), 49 deletions(-) diff --git a/Android.bp b/Android.bp index c980a2e50f..f5a38b4e6f 100644 --- a/Android.bp +++ b/Android.bp @@ -31,7 +31,6 @@ android_library { "androidx.test.uiautomator_uiautomator", "androidx.preference_preference", "SystemUISharedLib", - "SystemUIAnimationLib", ], srcs: [ "tests/tapl/**/*.java", @@ -197,7 +196,6 @@ android_library { "lottie", "SystemUISharedLib", "SystemUI-statsd", - "SystemUIAnimationLib", ], manifest: "quickstep/AndroidManifest.xml", min_sdk_version: "current", @@ -289,7 +287,6 @@ android_library { "SystemUISharedLib", "Launcher3CommonDepsLib", "QuickstepResLib", - "SystemUIAnimationLib", ], manifest: "quickstep/AndroidManifest.xml", platform_apis: true, diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 235a156fb5..ebe6a04611 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -29,16 +29,13 @@ import androidx.annotation.NonNull; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseQuickstepLauncher; -import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; -import com.android.launcher3.Utilities; import com.android.launcher3.statemanager.StateManager; import com.android.launcher3.util.MultiValueAlpha; import com.android.quickstep.AnimatedFloat; import com.android.quickstep.RecentsAnimationCallbacks; import com.android.quickstep.RecentsAnimationController; import com.android.quickstep.views.RecentsView; -import com.android.systemui.animation.ViewRootSync; import com.android.systemui.shared.recents.model.ThumbnailData; import java.util.HashMap; @@ -79,9 +76,6 @@ import java.util.function.Supplier; private boolean mShouldDelayLauncherStateAnim; - // We skip any view synchronizations during init/destroy. - private boolean mCanSyncViews; - private final StateManager.StateListener mStateListener = new StateManager.StateListener() { @@ -108,8 +102,6 @@ import java.util.function.Supplier; }; public void init(TaskbarControllers controllers, BaseQuickstepLauncher launcher) { - mCanSyncViews = false; - mControllers = controllers; mLauncher = launcher; @@ -129,13 +121,9 @@ import java.util.function.Supplier; updateStateForFlag(FLAG_RESUMED, launcher.hasBeenResumed()); mLauncherState = launcher.getStateManager().getState(); applyState(0); - - mCanSyncViews = true; } public void onDestroy() { - mCanSyncViews = false; - mIconAlignmentForResumedState.finishAnimation(); mIconAlignmentForGestureState.finishAnimation(); mIconAlignmentForLauncherState.finishAnimation(); @@ -143,8 +131,6 @@ import java.util.function.Supplier; mIconAlphaForHome.setConsumer(null); mLauncher.getHotseat().setIconsAlpha(1f); mLauncher.getStateManager().removeStateListener(mStateListener); - - mCanSyncViews = true; } public Animator createAnimToLauncher(@NonNull LauncherState toState, @@ -394,27 +380,6 @@ import java.util.function.Supplier; return; } float alignment = alignmentSupplier.get(); - float currentValue = mIconAlphaForHome.getValue(); - boolean taskbarWillBeVisible = alignment < 1; - boolean firstFrameVisChanged = (taskbarWillBeVisible && Float.compare(currentValue, 1) != 0) - || (!taskbarWillBeVisible && Float.compare(currentValue, 0) != 0); - - // Sync the first frame where we swap taskbar and hotseat. - if (firstFrameVisChanged && mCanSyncViews && !Utilities.IS_RUNNING_IN_TEST_HARNESS) { - DeviceProfile dp = mLauncher.getDeviceProfile(); - - // Do all the heavy work before the sync. - mControllers.taskbarViewController.createIconAlignmentControllerIfNotExists(dp); - - ViewRootSync.synchronizeNextDraw(mLauncher.getHotseat(), - mControllers.taskbarActivityContext.getDragLayer(), - () -> updateIconAlignment(alignment)); - } else { - updateIconAlignment(alignment); - } - } - - private void updateIconAlignment(float alignment) { mControllers.taskbarViewController.setLauncherIconAlignment( alignment, mLauncher.getDeviceProfile()); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index f354b2c2a8..6e34ee03b4 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -191,16 +191,6 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar + mTaskbarIconTranslationYForStash.value); } - /** - * Creates the icon alignment controller if it does not already exist. - * @param launcherDp Launcher device profile. - */ - public void createIconAlignmentControllerIfNotExists(DeviceProfile launcherDp) { - if (mIconAlignControllerLazy == null) { - mIconAlignControllerLazy = createIconAlignmentController(launcherDp); - } - } - /** * Sets the taskbar icon alignment relative to Launcher hotseat icons * @param alignmentRatio [0, 1] @@ -208,7 +198,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar * 1 => fully aligned */ public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) { - createIconAlignmentControllerIfNotExists(launcherDp); + if (mIconAlignControllerLazy == null) { + mIconAlignControllerLazy = createIconAlignmentController(launcherDp); + } mIconAlignControllerLazy.setPlayFraction(alignmentRatio); if (alignmentRatio <= 0 || alignmentRatio >= 1) { // Cleanup lazy controller so that it is created again in next animation From cea2480cacef137347eb56646e42cfde550c498f Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Thu, 10 Mar 2022 10:27:12 -0800 Subject: [PATCH 04/12] Properly center all apps divider. Fix: 223837782 Test: Manual on large and small screens in portrait and landscape. Change-Id: Ie4d609ce6524cc739d00bec5a8d26ec4c4152633 --- .../com/android/launcher3/appprediction/AppsDividerView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java index d37e530c61..0284ae4803 100644 --- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java @@ -194,7 +194,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { @Override protected void onDraw(Canvas canvas) { if (mDividerType == DividerType.LINE) { - int l = (getWidth() - getPaddingLeft() - mDividerSize[0]) / 2; + int l = (getWidth() - mDividerSize[0]) / 2; int t = getHeight() - (getPaddingBottom() / 2); int radius = mDividerSize[1]; canvas.drawRoundRect(l, t, l + mDividerSize[0], t + mDividerSize[1], radius, radius, From b282446dac5a1affc6f85ddb66ce5507242ae8be Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Tue, 8 Mar 2022 13:05:24 -0800 Subject: [PATCH 05/12] Fix gesture navigation tutorial colors to match SUW colors. - Updated the gesture nav tutorial to use the system accent color for buttons and the feedback animations Fixes: 222269039 Test: built change, flashed and factory reset device Change-Id: I4e515aef0ccdab98f1d3900007f6006b1975b41b --- .../gesture_tutorial_action_button_background.xml | 2 +- .../gesture_tutorial_action_button_background.xml | 2 +- .../gesture_tutorial_cancel_button_background.xml | 2 +- quickstep/res/drawable/gesture_tutorial_finger_dot.xml | 2 +- quickstep/res/drawable/gesture_tutorial_loop_back.xml | 2 +- quickstep/res/drawable/gesture_tutorial_loop_home.xml | 2 +- .../res/drawable/gesture_tutorial_loop_overview.xml | 2 +- quickstep/res/values/colors.xml | 4 +--- quickstep/res/values/styles.xml | 9 +++++---- .../quickstep/interaction/TutorialController.java | 2 +- 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/quickstep/res/drawable-v28/gesture_tutorial_action_button_background.xml b/quickstep/res/drawable-v28/gesture_tutorial_action_button_background.xml index 57423c2ffc..710482f162 100644 --- a/quickstep/res/drawable-v28/gesture_tutorial_action_button_background.xml +++ b/quickstep/res/drawable-v28/gesture_tutorial_action_button_background.xml @@ -16,5 +16,5 @@ - + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_action_button_background.xml b/quickstep/res/drawable/gesture_tutorial_action_button_background.xml index ac6a52a623..98dc1a5f78 100644 --- a/quickstep/res/drawable/gesture_tutorial_action_button_background.xml +++ b/quickstep/res/drawable/gesture_tutorial_action_button_background.xml @@ -25,7 +25,7 @@ - + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_cancel_button_background.xml b/quickstep/res/drawable/gesture_tutorial_cancel_button_background.xml index 0a34af6475..77626154f8 100644 --- a/quickstep/res/drawable/gesture_tutorial_cancel_button_background.xml +++ b/quickstep/res/drawable/gesture_tutorial_cancel_button_background.xml @@ -17,5 +17,5 @@ android:shape="rectangle"> - + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_finger_dot.xml b/quickstep/res/drawable/gesture_tutorial_finger_dot.xml index 5f8aafd30a..cbb26122db 100644 --- a/quickstep/res/drawable/gesture_tutorial_finger_dot.xml +++ b/quickstep/res/drawable/gesture_tutorial_finger_dot.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_back.xml b/quickstep/res/drawable/gesture_tutorial_loop_back.xml index d2909fffc9..ae47709b22 100644 --- a/quickstep/res/drawable/gesture_tutorial_loop_back.xml +++ b/quickstep/res/drawable/gesture_tutorial_loop_back.xml @@ -85,7 +85,7 @@ diff --git a/quickstep/res/drawable/gesture_tutorial_loop_home.xml b/quickstep/res/drawable/gesture_tutorial_loop_home.xml index 931f8c0197..bed35dd0fa 100644 --- a/quickstep/res/drawable/gesture_tutorial_loop_home.xml +++ b/quickstep/res/drawable/gesture_tutorial_loop_home.xml @@ -81,7 +81,7 @@ diff --git a/quickstep/res/drawable/gesture_tutorial_loop_overview.xml b/quickstep/res/drawable/gesture_tutorial_loop_overview.xml index a4c532bdfa..53e8b5fec5 100644 --- a/quickstep/res/drawable/gesture_tutorial_loop_overview.xml +++ b/quickstep/res/drawable/gesture_tutorial_loop_overview.xml @@ -81,7 +81,7 @@ diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml index 671a617f01..8f439a231c 100644 --- a/quickstep/res/values/colors.xml +++ b/quickstep/res/values/colors.xml @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + #fff #39000000 @@ -41,8 +41,6 @@ #6DA1FF #3C4043 - #FF000000 - #B7F29F #202124 diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml index 6aa488375b..7225220876 100644 --- a/quickstep/res/values/styles.xml +++ b/quickstep/res/values/styles.xml @@ -88,7 +88,8 @@ @@ -100,7 +101,7 @@