diff options
author | Brandon Dayauon <brdayauon@google.com> | 2023-06-01 19:00:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-06-01 19:00:27 +0000 |
commit | 052045907c3fbaffe44d07aec28f8fb428bd14c4 (patch) | |
tree | d30db981652ae2a66532f5554e785c8e72481451 /src | |
parent | bcf6111413a5c849fb0538259752f89bf2715257 (diff) | |
parent | 6a14189b071180b8dfdbfa9e3860405b2e3c0a5b (diff) | |
download | Launcher3-052045907c3fbaffe44d07aec28f8fb428bd14c4.tar.gz |
Merge "Fix "Pause work apps" button in strange location" into udc-dev
Diffstat (limited to 'src')
3 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 21dfbe1d0c..d4140d851c 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -444,6 +444,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> // Animate to A-Z with 0 time to reset the animation with proper state management. animateToSearchState(false, 0); } + if (isSearching()) { + mWorkManager.reset(); + } } @Override diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java index 663fdb9822..8c2fb195c6 100644 --- a/src/com/android/launcher3/allapps/WorkModeSwitch.java +++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java @@ -166,7 +166,7 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, return super.onApplyWindowInsets(insets); } - private void updateTranslationY() { + void updateTranslationY() { setTranslationY(-mImeInsets.bottom); } @@ -180,6 +180,10 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, rect.set(insets.left, insets.top, insets.right, insets.bottom); } + public Rect getImeInsets() { + return mImeInsets; + } + @Override public void onTranslationStart() { setFlag(FLAG_TRANSLATION_ONGOING); diff --git a/src/com/android/launcher3/allapps/WorkProfileManager.java b/src/com/android/launcher3/allapps/WorkProfileManager.java index 30af50261d..44c233f557 100644 --- a/src/com/android/launcher3/allapps/WorkProfileManager.java +++ b/src/com/android/launcher3/allapps/WorkProfileManager.java @@ -136,6 +136,11 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP public void reset() { boolean isEnabled = !mAllApps.getAppsStore().hasModelFlag(FLAG_QUIET_MODE_ENABLED); updateCurrentState(isEnabled ? STATE_ENABLED : STATE_DISABLED); + if (mWorkModeSwitch != null) { + // reset the position of the button and clear IME insets. + mWorkModeSwitch.getImeInsets().setEmpty(); + mWorkModeSwitch.updateTranslationY(); + } } private void updateCurrentState(@WorkProfileState int currentState) { |