Merge "Don't always set the clock to View.GONE" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-05-18 14:21:48 +00:00
committed by Android (Google) Code Review

View File

@@ -165,7 +165,9 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
showNotificationIconArea(animate); showNotificationIconArea(animate);
} }
} }
if ((diff1 & DISABLE_CLOCK) != 0) { // The clock may have already been hidden, but we might want to shift its
// visibility to GONE from INVISIBLE or vice versa
if ((diff1 & DISABLE_CLOCK) != 0 || mClockView.getVisibility() != clockHiddenMode()) {
if ((state1 & DISABLE_CLOCK) != 0) { if ((state1 & DISABLE_CLOCK) != 0) {
hideClock(animate); hideClock(animate);
} else { } else {
@@ -212,13 +214,24 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
} }
public void hideClock(boolean animate) { public void hideClock(boolean animate) {
animateHiddenState(mClockView, View.GONE, animate); animateHiddenState(mClockView, clockHiddenMode(), animate);
} }
public void showClock(boolean animate) { public void showClock(boolean animate) {
animateShow(mClockView, animate); animateShow(mClockView, animate);
} }
/**
* If panel is expanded/expanding it usually means QS shade is opening, so
* don't set the clock GONE otherwise it'll mess up the animation.
*/
private int clockHiddenMode() {
if (!mStatusBar.isClosed() && !mKeyguardMonitor.isShowing()) {
return View.INVISIBLE;
}
return View.GONE;
}
public void hideNotificationIconArea(boolean animate) { public void hideNotificationIconArea(boolean animate) {
animateHide(mNotificationIconAreaInner, animate); animateHide(mNotificationIconAreaInner, animate);
} }