Avoid stock statusbar flash when enabling layout
This commit is contained in:
+11
-12
@@ -153,7 +153,7 @@ final class StockClockController {
|
||||
}
|
||||
runtimeContext.getModeStateRepository().addLayoutEnabledListener(enabled -> {
|
||||
if (enabled) {
|
||||
restoreAllOwnedClocks();
|
||||
suspendOwnedClockTickers();
|
||||
} else {
|
||||
refreshAllClocks();
|
||||
}
|
||||
@@ -212,23 +212,22 @@ final class StockClockController {
|
||||
}
|
||||
}
|
||||
|
||||
private void removeAllRowOverlays() {
|
||||
for (TextView clockView : new ArrayList<>(trackedClocks)) {
|
||||
removeRowOverlay(clockView);
|
||||
private void suspendOwnedClockTickers() {
|
||||
for (TextView clockView : new ArrayList<>(ownedClocks)) {
|
||||
stopTicker(clockView);
|
||||
}
|
||||
}
|
||||
|
||||
private void restoreAllOwnedClocks() {
|
||||
for (TextView clockView : new ArrayList<>(trackedClocks)) {
|
||||
restoreOwnedClock(clockView);
|
||||
}
|
||||
removeAllRowOverlays();
|
||||
}
|
||||
|
||||
private void applyClockText(TextView clockView) {
|
||||
SbtSettings settings = RuntimeSettingsCache.get(clockView.getContext());
|
||||
boolean layoutEnabled = settings.clockEnabled;
|
||||
if (layoutEnabled || !hasCustomClockTextEnabled(settings)) {
|
||||
if (layoutEnabled) {
|
||||
if (ownedClocks.contains(clockView)) {
|
||||
stopTicker(clockView);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!hasCustomClockTextEnabled(settings)) {
|
||||
restoreOwnedClock(clockView);
|
||||
return;
|
||||
}
|
||||
|
||||
+3
@@ -237,6 +237,9 @@ final class StockUnlockedNotificationIconsController {
|
||||
}
|
||||
|
||||
private boolean shouldManageContainer(View view) {
|
||||
if (!isFeatureEnabled(view.getContext())) {
|
||||
return false;
|
||||
}
|
||||
if (!isUnlockedScene()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user