[AllApps][Work] Introduce work toggle Fab

Screenshot: https://screenshot.googleplex.com/C4r7kKPxv3PKdyN
Bug: 186856928
Test: on-device
Change-Id: Ifd8ce20fcf2247a6e80537dc7631458e594a8a63
This commit is contained in:
Samuel Fufa
2021-05-25 19:21:37 -05:00
parent eb1617521c
commit 45e0e26971
10 changed files with 124 additions and 446 deletions

View File

@@ -228,7 +228,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
}
private void resetWorkProfile() {
mWorkModeSwitch.update(!mAllAppsStore.hasModelFlag(FLAG_QUIET_MODE_ENABLED));
mWorkModeSwitch.updateCurrentState(!mAllAppsStore.hasModelFlag(FLAG_QUIET_MODE_ENABLED));
mAH[AdapterHolder.WORK].setupOverlay();
mAH[AdapterHolder.WORK].applyPadding();
}
@@ -482,7 +482,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
private void setupWorkToggle() {
if (Utilities.ATLEAST_P) {
mWorkModeSwitch = (WorkModeSwitch) mLauncher.getLayoutInflater().inflate(
R.layout.work_mode_switch, this, false);
R.layout.work_mode_fab, this, false);
this.addView(mWorkModeSwitch);
mWorkModeSwitch.setInsets(mInsets);
mWorkModeSwitch.post(this::resetWorkProfile);