From 63fc6d8c0acb37835336862674206cf001753667 Mon Sep 17 00:00:00 2001 From: Michael W Date: Mon, 1 Jun 2020 14:43:31 +0200 Subject: SystemUI: Make clock truly invisible * When the clock is set to left and then hidden, the notification icons, which would appear on the left first transition to the right to make place for the clock then finally snap into place * The same happens when the clock was set to show right and then is hidden: The battery, wifi, etc. icons do leave space for the (not displayed) clock and then snap to the right * This patch fixes the behavior Change-Id: Ic68b1001becb91da6f1aeaca95a7312b36e1d2a1 --- .../android/systemui/statusbar/phone/CollapsedStatusBarFragment.java | 3 ++- packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java index 1607b464b80..76344345d82 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java @@ -289,7 +289,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue */ private int clockHiddenMode() { if (!mStatusBar.isClosed() && !mKeyguardMonitor.isShowing() - && !mStatusBarStateController.isDozing()) { + && !mStatusBarStateController.isDozing() + && mClockController.getClock().shouldBeVisible()) { return View.INVISIBLE; } return View.GONE; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java index f1808c133c9..b89f27d5b5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -268,7 +268,7 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C updateClockVisibility(); } - private boolean shouldBeVisible() { + public boolean shouldBeVisible() { return mClockVisibleByPolicy && mClockVisibleByUser; } -- cgit v1.2.3