From 699568050da6694c0610de67bf3713cf330df922 Mon Sep 17 00:00:00 2001 From: Robert Snoeberger Date: Tue, 16 Apr 2019 16:55:21 -0400 Subject: [PATCH] Add smart space to custom clock faces. This changes adds a hook to the ClockPlugin to allow the custom clock to control the position of the smart space. Still todo: - move out of the way for the lock icon - don't slide smart space down on lock screen when no notifs are showing Bug: 129348218 Test: Manually checked custom clock faces. Change-Id: I2472f6b2bb54f94e2e673f01c78170c0e7f87627 --- .../com/android/systemui/plugins/ClockPlugin.java | 10 ++++++- .../SystemUI/res-keyguard/layout/analog_clock.xml | 16 ----------- .../SystemUI/res-keyguard/layout/bubble_clock.xml | 16 ----------- .../com/android/keyguard/KeyguardClockSwitch.java | 14 +++++++++ .../com/android/keyguard/KeyguardStatusView.java | 10 +++++++ .../keyguard/clock/AnalogClockController.java | 33 ++++++++-------------- .../keyguard/clock/BubbleClockController.java | 33 ++++++++-------------- .../com/android/keyguard/clock/ClockLayout.java | 12 +------- .../keyguard/clock/DefaultClockController.java | 5 ++++ .../stack/NotificationStackScrollLayout.java | 4 +-- .../phone/CollapsedStatusBarFragment.java | 1 - .../phone/KeyguardClockPositionAlgorithm.java | 17 ++++++++--- .../statusbar/phone/NotificationPanelView.java | 8 ++++-- .../keyguard/clock/AnalogClockControllerTest.java | 12 ++++---- .../keyguard/clock/BubbleClockControllerTest.java | 8 +++--- .../phone/KeyguardClockPositionAlgorithmTest.java | 5 ++-- .../statusbar/phone/NotificationPanelViewTest.java | 8 +++--- 17 files changed, 100 insertions(+), 112 deletions(-) diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java index 58d50ead72ce..6c6c9270bc84 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockPlugin.java @@ -28,7 +28,7 @@ import java.util.TimeZone; public interface ClockPlugin extends Plugin { String ACTION = "com.android.systemui.action.PLUGIN_CLOCK"; - int VERSION = 4; + int VERSION = 5; /** * Get the name of the clock face. @@ -72,6 +72,14 @@ public interface ClockPlugin extends Plugin { } /** + * Returns the preferred Y position of the clock. + * + * @param totalHeight Height of the parent container. + * @return preferred Y position. + */ + int getPreferredY(int totalHeight); + + /** * Allows the plugin to clean up resources when no longer needed. * * Called when the view previously created by {@link ClockPlugin#getView()} has been detached diff --git a/packages/SystemUI/res-keyguard/layout/analog_clock.xml b/packages/SystemUI/res-keyguard/layout/analog_clock.xml index cf6d35ee27af..ee0df48f4f5d 100644 --- a/packages/SystemUI/res-keyguard/layout/analog_clock.xml +++ b/packages/SystemUI/res-keyguard/layout/analog_clock.xml @@ -19,22 +19,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" > - -