Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +36 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.content.Context; import android.graphics.Paint; import android.graphics.Paint.Style; import android.os.Build; import android.transition.Fade; import android.transition.Transition; import android.transition.TransitionListenerAdapter; import android.transition.TransitionManager; Loading Loading @@ -115,6 +116,11 @@ public class KeyguardClockSwitch extends RelativeLayout { */ private float mDarkAmount; /** * Boolean value indicating if notifications are visible on lock screen. */ private boolean mHasVisibleNotifications; /** * If the Keyguard Slice has a header (big center-aligned text.) */ Loading Loading @@ -325,6 +331,24 @@ public class KeyguardClockSwitch extends RelativeLayout { if (mClockPlugin != null) { mClockPlugin.setDarkAmount(darkAmount); } updateBigClockAlpha(); } /** * Set whether or not the lock screen is showing notifications. */ void setHasVisibleNotifications(boolean hasVisibleNotifications) { if (hasVisibleNotifications == mHasVisibleNotifications) { return; } mHasVisibleNotifications = hasVisibleNotifications; if (mDarkAmount == 0f && mBigClockContainer != null) { // Starting a fade transition since the visibility of the big clock will change. TransitionManager.beginDelayedTransition(mBigClockContainer, new Fade().setDuration(KeyguardSliceView.DEFAULT_ANIM_DURATION / 2).addTarget( mBigClockContainer)); } updateBigClockAlpha(); } public Paint getPaint() { Loading Loading @@ -401,6 +425,18 @@ public class KeyguardClockSwitch extends RelativeLayout { } } private void updateBigClockAlpha() { if (mBigClockContainer != null) { final float alpha = mHasVisibleNotifications ? mDarkAmount : 1f; mBigClockContainer.setAlpha(alpha); if (alpha == 0f) { mBigClockContainer.setVisibility(INVISIBLE); } else if (mBigClockContainer.getVisibility() == INVISIBLE) { mBigClockContainer.setVisibility(VISIBLE); } } } /** * Sets if the keyguard slice is showing a center-aligned header. We need a smaller clock in * these cases. Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +7 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,13 @@ public class KeyguardStatusView extends GridLayout implements return mClockView.hasCustomClock(); } /** * Set whether or not the lock screen is showing notifications. */ public void setHasVisibleNotifications(boolean hasVisibleNotifications) { mClockView.setHasVisibleNotifications(hasVisibleNotifications); } private void setEnableMarquee(boolean enabled) { if (DEBUG) Log.v(TAG, "Schedule setEnableMarquee: " + (enabled ? "Enable" : "Disable")); if (enabled) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +4 −1 Original line number Diff line number Diff line Loading @@ -710,6 +710,9 @@ public class NotificationPanelView extends PanelView implements int bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding); int clockPreferredY = mKeyguardStatusView.getClockPreferredY(totalHeight); boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled(); final boolean hasVisibleNotifications = !bypassEnabled && mNotificationStackScroller.getVisibleNotificationCount() != 0; mKeyguardStatusView.setHasVisibleNotifications(hasVisibleNotifications); mClockPositionAlgorithm.setup( mStatusBarMinHeight, totalHeight - bottomPadding, Loading @@ -720,7 +723,7 @@ public class NotificationPanelView extends PanelView implements - mShelfHeight / 2.0f - mDarkIconSize / 2.0f), clockPreferredY, hasCustomClock(), mNotificationStackScroller.getVisibleNotificationCount() != 0, hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, bypassEnabled, Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +36 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.content.Context; import android.graphics.Paint; import android.graphics.Paint.Style; import android.os.Build; import android.transition.Fade; import android.transition.Transition; import android.transition.TransitionListenerAdapter; import android.transition.TransitionManager; Loading Loading @@ -115,6 +116,11 @@ public class KeyguardClockSwitch extends RelativeLayout { */ private float mDarkAmount; /** * Boolean value indicating if notifications are visible on lock screen. */ private boolean mHasVisibleNotifications; /** * If the Keyguard Slice has a header (big center-aligned text.) */ Loading Loading @@ -325,6 +331,24 @@ public class KeyguardClockSwitch extends RelativeLayout { if (mClockPlugin != null) { mClockPlugin.setDarkAmount(darkAmount); } updateBigClockAlpha(); } /** * Set whether or not the lock screen is showing notifications. */ void setHasVisibleNotifications(boolean hasVisibleNotifications) { if (hasVisibleNotifications == mHasVisibleNotifications) { return; } mHasVisibleNotifications = hasVisibleNotifications; if (mDarkAmount == 0f && mBigClockContainer != null) { // Starting a fade transition since the visibility of the big clock will change. TransitionManager.beginDelayedTransition(mBigClockContainer, new Fade().setDuration(KeyguardSliceView.DEFAULT_ANIM_DURATION / 2).addTarget( mBigClockContainer)); } updateBigClockAlpha(); } public Paint getPaint() { Loading Loading @@ -401,6 +425,18 @@ public class KeyguardClockSwitch extends RelativeLayout { } } private void updateBigClockAlpha() { if (mBigClockContainer != null) { final float alpha = mHasVisibleNotifications ? mDarkAmount : 1f; mBigClockContainer.setAlpha(alpha); if (alpha == 0f) { mBigClockContainer.setVisibility(INVISIBLE); } else if (mBigClockContainer.getVisibility() == INVISIBLE) { mBigClockContainer.setVisibility(VISIBLE); } } } /** * Sets if the keyguard slice is showing a center-aligned header. We need a smaller clock in * these cases. Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +7 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,13 @@ public class KeyguardStatusView extends GridLayout implements return mClockView.hasCustomClock(); } /** * Set whether or not the lock screen is showing notifications. */ public void setHasVisibleNotifications(boolean hasVisibleNotifications) { mClockView.setHasVisibleNotifications(hasVisibleNotifications); } private void setEnableMarquee(boolean enabled) { if (DEBUG) Log.v(TAG, "Schedule setEnableMarquee: " + (enabled ? "Enable" : "Disable")); if (enabled) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +4 −1 Original line number Diff line number Diff line Loading @@ -710,6 +710,9 @@ public class NotificationPanelView extends PanelView implements int bottomPadding = Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding); int clockPreferredY = mKeyguardStatusView.getClockPreferredY(totalHeight); boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled(); final boolean hasVisibleNotifications = !bypassEnabled && mNotificationStackScroller.getVisibleNotificationCount() != 0; mKeyguardStatusView.setHasVisibleNotifications(hasVisibleNotifications); mClockPositionAlgorithm.setup( mStatusBarMinHeight, totalHeight - bottomPadding, Loading @@ -720,7 +723,7 @@ public class NotificationPanelView extends PanelView implements - mShelfHeight / 2.0f - mDarkIconSize / 2.0f), clockPreferredY, hasCustomClock(), mNotificationStackScroller.getVisibleNotificationCount() != 0, hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount, bypassEnabled, Loading