From da9520355f1d8b330ab006ef99b20c3ebd5f6c42 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Wed, 17 Jul 2024 11:15:47 -0700 Subject: [PATCH] Don't let settings button clickable during animation. Otherwise the user will open settings instead of unlocking the container like normal. bug: 349115995 Test: before: https://drive.google.com/file/d/1jmd9Pxp6d0aGSC5Sp7efrlY6JLCPvKLR/view?usp=sharing after: https://drive.google.com/file/d/1xyKPd_hT9ut10r5B1PHxLO9gE3zh9vxK/view?usp=sharing Flag: com.android.launcher3.enable_private_space Change-Id: Icefaf7de72678ccf0b976039f4a3ee88c6712167 --- .../launcher3/allapps/PrivateProfileManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java index c1264d6135..904e973778 100644 --- a/src/com/android/launcher3/allapps/PrivateProfileManager.java +++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java @@ -403,6 +403,7 @@ public class PrivateProfileManager extends UserProfileManager { mLockText.setHorizontallyScrolling(false); mPrivateSpaceSettingsButton.setVisibility( isPrivateSpaceSettingsAvailable() ? VISIBLE : GONE); + mPrivateSpaceSettingsButton.setClickable(isPrivateSpaceSettingsAvailable()); } lockPill.setVisibility(VISIBLE); lockPill.setOnClickListener(view -> lockingAction(/* lock */ true)); @@ -425,6 +426,7 @@ public class PrivateProfileManager extends UserProfileManager { lockPill.setContentDescription(mLockedStateContentDesc); mPrivateSpaceSettingsButton.setVisibility(GONE); + mPrivateSpaceSettingsButton.setClickable(false); transitionView.setVisibility(GONE); } case STATE_TRANSITION -> { @@ -794,6 +796,14 @@ public class PrivateProfileManager extends UserProfileManager { @Override public void onAnimationStart(Animator animator) { mPrivateSpaceSettingsButton.setVisibility(VISIBLE); + mPrivateSpaceSettingsButton.setClickable(false); + } + + @Override + public void onAnimationEnd(Animator animator) { + if (expand) { + mPrivateSpaceSettingsButton.setClickable(true); + } } }); return settingsAlphaAnim;