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