mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 00:36:49 +00:00
Merge "[Work profile] Fix flickering work mode switch" into sc-v2-dev
This commit is contained in:
@@ -491,6 +491,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
||||
mViewPager.initParentViews(this);
|
||||
mViewPager.getPageIndicator().setOnActivePageChangedListener(this);
|
||||
mWorkManager.attachWorkModeSwitch();
|
||||
mWorkManager.getWorkModeSwitch().post(() -> mAH[AdapterHolder.WORK].applyPadding());
|
||||
} else {
|
||||
mWorkManager.detachWorkModeSwitch();
|
||||
mViewPager = null;
|
||||
|
||||
@@ -113,10 +113,12 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi
|
||||
/**
|
||||
* Sets the enabled or disabled state of the button
|
||||
*/
|
||||
public void updateCurrentState(boolean active) {
|
||||
public void updateCurrentState(boolean isEnabled) {
|
||||
removeFlag(FLAG_PROFILE_TOGGLE_ONGOING);
|
||||
mWorkEnabled = active;
|
||||
updateVisibility();
|
||||
if (mWorkEnabled != isEnabled) {
|
||||
mWorkEnabled = isEnabled;
|
||||
updateVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +127,6 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi
|
||||
if (mWorkEnabled && mOnWorkTab) {
|
||||
setFlag(FLAG_FADE_ONGOING);
|
||||
setVisibility(VISIBLE);
|
||||
setAlpha(0);
|
||||
animate().alpha(1).withEndAction(() -> removeFlag(FLAG_FADE_ONGOING)).start();
|
||||
} else if (getVisibility() != GONE) {
|
||||
setFlag(FLAG_FADE_ONGOING);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class UserManagerState {
|
||||
* Initialises the state values for all users
|
||||
*/
|
||||
public void init(UserCache userCache, UserManager userManager) {
|
||||
for (UserHandle user : userCache.getUserProfiles()) {
|
||||
for (UserHandle user : userManager.getUserProfiles()) {
|
||||
long serialNo = userCache.getSerialNumberForUser(user);
|
||||
boolean isUserQuiet = userManager.isQuietModeEnabled(user);
|
||||
allUsers.put(serialNo, user);
|
||||
|
||||
Reference in New Issue
Block a user