Fix "Pause work apps" button in strange location

The issue why the button sticks up is because of the translation not resetting when closing
All apps.
- This CL resets ime insets and the position of the button to the original location.

bug: 278722407
test: manual - before:https://drive.google.com/file/d/1_L4ICHrt582KcVcpvQDK9HciC_n5eiEy/view?usp=sharing
after: https://drive.google.com/file/d/1_G8-Jd_wdUKjy7vFj6iQ1QmCx_7Qrogn/view?usp=sharing
Change-Id: Ib32b8ef950d03aa812f30c2393e3cad3201c08da
This commit is contained in:
Brandon Dayauon
2023-05-30 10:53:51 -07:00
parent db7009544e
commit 6a14189b07
3 changed files with 13 additions and 1 deletions
@@ -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) {