mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Recreate taskbar when dark mode changes
Also dispatch sysui flags to all controllers upon recreate, not just NavbarButtonsViewController. Additionally, tell the controllers to skip the animation due to the flag changes if it's fromInit. Test: Enable themed icons, switch dark theme in quick settings, ensure taskbar updates Fixes: 204403933 Change-Id: Ic43a50cf0456175f9beba5c29360440f051cbd2d
This commit is contained in:
@@ -121,10 +121,9 @@ public class NavbarButtonsViewController {
|
||||
/**
|
||||
* Initializes the controller
|
||||
*/
|
||||
public void init(TaskbarControllers controllers, TaskbarSharedState sharedState) {
|
||||
public void init(TaskbarControllers controllers) {
|
||||
mControllers = controllers;
|
||||
mNavButtonsView.getLayoutParams().height = mContext.getDeviceProfile().taskbarSize;
|
||||
parseSystemUiFlags(sharedState.sysuiStateFlags);
|
||||
mNavButtonTranslationYMultiplier.value = 1;
|
||||
|
||||
mA11yLongClickListener = view -> {
|
||||
@@ -290,12 +289,15 @@ public class NavbarButtonsViewController {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateStateForSysuiFlags(int systemUiStateFlags) {
|
||||
public void updateStateForSysuiFlags(int systemUiStateFlags, boolean skipAnim) {
|
||||
if (systemUiStateFlags == mSysuiStateFlags) {
|
||||
return;
|
||||
}
|
||||
parseSystemUiFlags(systemUiStateFlags);
|
||||
applyState();
|
||||
if (skipAnim) {
|
||||
mPropertyHolders.forEach(StatePropertyHolder::endAnimation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user