From 98db0df4ab948b760061c9b4e79cd6031ab493ac Mon Sep 17 00:00:00 2001 From: Federico Baron Date: Tue, 18 Oct 2022 12:14:49 -0700 Subject: [PATCH] Hide QSB (toast) when editing workspace Here we hide QSB when we enter drag mode in order to follow the guidelines set by https://docs.google.com/presentation/d/1FOmmCdmGmSMR77_901IOMbvbPVxPmjaAdxZjy-D9tw0/edit#slide=id.g159289e55db_0_229 Bug: 251259222 Test: Enter edit mode with SHOW_HOME_GARDENING flag on, notice how QSB disappears when we enter drag Change-Id: If1a00ac62cec21a641295494d3a2dbb1f267bd62 --- .../WorkspaceStateTransitionAnimation.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 264c0a79dc..62e7ef308c 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -35,6 +35,7 @@ import static com.android.launcher3.anim.Interpolators.ACCEL_2; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.ZOOM_OUT; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; +import static com.android.launcher3.config.FeatureFlags.HOME_GARDENING_WORKSPACE_BUTTONS; import static com.android.launcher3.config.FeatureFlags.SHOW_HOME_GARDENING; import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS; import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS; @@ -171,6 +172,18 @@ public class WorkspaceStateTransitionAnimation { }); } + if (HOME_GARDENING_WORKSPACE_BUTTONS.get()) { + propertySetter.setViewAlpha( + mLauncher.getHotseat().getQsb(), + state == SPRING_LOADED ? 0 : 1, + workspaceFadeInterpolator); + propertySetter.addEndListener(success -> { + if (success) { + mLauncher.getHotseat().getQsb().setClickable(state != SPRING_LOADED); + } + }); + } + // Update the accessibility flags for hotseat based on launcher state. hotseat.setImportantForAccessibility( state.hasFlag(FLAG_HOTSEAT_INACCESSIBLE)