Switch to small clock in split shade in certain edge scenarios

The large weather clock can overlap the notification shelf when it
switches to the left side in AOD. This is avoided by swapping the clock
into the small version for this specific scenario.

Bug: 283103625
Test: Manually checked swapping clock during AOD transition for jank
Change-Id: Iea694b9e14d0f5183dacb73044c20d70213accea
This commit is contained in:
Hawkwood Glazier
2023-05-18 16:37:35 +00:00
parent f91a331f1d
commit b741b754b8
2 changed files with 14 additions and 0 deletions

View File

@@ -314,6 +314,14 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
}
}
/**
* Returns true if the large clock will block the notification shelf in AOD
*/
public boolean isLargeClockBlockingNotificationShelf() {
ClockController clock = mKeyguardClockSwitchController.getClock();
return clock != null && clock.getLargeClock().getConfig().getHasCustomWeatherDataDisplay();
}
/**
* Updates the alignment of the KeyguardStatusView and animates the transition if requested.
*/

View File

@@ -1570,6 +1570,12 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
// When media is visible, it overlaps with the large clock. Use small clock instead.
return SMALL;
}
// To prevent the weather clock from overlapping with the notification shelf on AOD, we use
// the small clock here
if (mKeyguardStatusViewController.isLargeClockBlockingNotificationShelf()
&& hasVisibleNotifications() && isOnAod()) {
return SMALL;
}
return LARGE;
}