Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +26 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class KeyguardClockSwitch extends RelativeLayout { private static final long STATUS_AREA_MOVE_UP_MILLIS = 967; private static final long STATUS_AREA_MOVE_DOWN_MILLIS = 467; private static final float SMARTSPACE_TRANSLATION_CENTER_MULTIPLIER = 1.4f; private static final float SMARTSPACE_TOP_PADDING_MULTIPLIER = 2.625f; @IntDef({LARGE, SMALL}) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -92,6 +93,14 @@ public class KeyguardClockSwitch extends RelativeLayout { private KeyguardClockFrame mLargeClockFrame; private ClockController mClock; // It's bc_smartspace_view, assigned by KeyguardClockSwitchController // to get the top padding for translating smartspace for weather clock private View mSmartspace; // Smartspace in weather clock is translated by this value // to compensate for the position invisible dateWeatherView private int mSmartspaceTop = -1; private KeyguardStatusAreaView mStatusArea; private int mSmartspaceTopOffset; private float mWeatherClockSmartspaceScaling = 1f; Loading Loading @@ -130,8 +139,11 @@ public class KeyguardClockSwitch extends RelativeLayout { public void onConfigChanged() { mClockSwitchYAmount = mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_clock_switch_y_shift); mSmartspaceTopOffset = mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_smartspace_top_offset); mSmartspaceTopOffset = (int) (mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_smartspace_top_offset) * mContext.getResources().getConfiguration().fontScale / mContext.getResources().getDisplayMetrics().density * SMARTSPACE_TOP_PADDING_MULTIPLIER); mWeatherClockSmartspaceScaling = ResourcesCompat.getFloat( mContext.getResources(), R.dimen.weather_clock_smartspace_scale); mWeatherClockSmartspaceTranslateX = mContext.getResources().getDimensionPixelSize( Loading @@ -141,6 +153,12 @@ public class KeyguardClockSwitch extends RelativeLayout { updateStatusArea(/* animate= */false); } /** Get bc_smartspace_view from KeyguardClockSwitchController * Use its top to decide the translation value */ public void setSmartspace(View smartspace) { mSmartspace = smartspace; } /** Sets whether the large clock is being shown on a connected display. */ public void setLargeClockOnSecondaryDisplay(boolean onSecondaryDisplay) { if (mClock != null) { Loading Loading @@ -291,7 +309,7 @@ public class KeyguardClockSwitch extends RelativeLayout { && mClock.getLargeClock().getConfig().getHasCustomWeatherDataDisplay()) { statusAreaClockScale = mWeatherClockSmartspaceScaling; statusAreaClockTranslateX = mWeatherClockSmartspaceTranslateX; statusAreaClockTranslateY = mWeatherClockSmartspaceTranslateY; statusAreaClockTranslateY = mWeatherClockSmartspaceTranslateY - mSmartspaceTop; if (mSplitShadeCentered) { statusAreaClockTranslateX *= SMARTSPACE_TRANSLATION_CENTER_MULTIPLIER; } Loading Loading @@ -414,10 +432,14 @@ public class KeyguardClockSwitch extends RelativeLayout { post(() -> updateClockTargetRegions()); } if (mDisplayedClockSize != null && !mChildrenAreLaidOut) { if (mSmartspace != null && mSmartspaceTop != mSmartspace.getTop()) { mSmartspaceTop = mSmartspace.getTop(); post(() -> updateClockViews(mDisplayedClockSize == LARGE, mAnimateOnLayout)); } if (mDisplayedClockSize != null && !mChildrenAreLaidOut) { post(() -> updateClockViews(mDisplayedClockSize == LARGE, mAnimateOnLayout)); } mChildrenAreLaidOut = true; } Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +1 −0 Original line number Diff line number Diff line Loading @@ -371,6 +371,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mSmartspaceView.setPaddingRelative(startPadding, 0, endPadding, 0); mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView); mView.setSmartspace(mSmartspaceView); } /** Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +26 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class KeyguardClockSwitch extends RelativeLayout { private static final long STATUS_AREA_MOVE_UP_MILLIS = 967; private static final long STATUS_AREA_MOVE_DOWN_MILLIS = 467; private static final float SMARTSPACE_TRANSLATION_CENTER_MULTIPLIER = 1.4f; private static final float SMARTSPACE_TOP_PADDING_MULTIPLIER = 2.625f; @IntDef({LARGE, SMALL}) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -92,6 +93,14 @@ public class KeyguardClockSwitch extends RelativeLayout { private KeyguardClockFrame mLargeClockFrame; private ClockController mClock; // It's bc_smartspace_view, assigned by KeyguardClockSwitchController // to get the top padding for translating smartspace for weather clock private View mSmartspace; // Smartspace in weather clock is translated by this value // to compensate for the position invisible dateWeatherView private int mSmartspaceTop = -1; private KeyguardStatusAreaView mStatusArea; private int mSmartspaceTopOffset; private float mWeatherClockSmartspaceScaling = 1f; Loading Loading @@ -130,8 +139,11 @@ public class KeyguardClockSwitch extends RelativeLayout { public void onConfigChanged() { mClockSwitchYAmount = mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_clock_switch_y_shift); mSmartspaceTopOffset = mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_smartspace_top_offset); mSmartspaceTopOffset = (int) (mContext.getResources().getDimensionPixelSize( R.dimen.keyguard_smartspace_top_offset) * mContext.getResources().getConfiguration().fontScale / mContext.getResources().getDisplayMetrics().density * SMARTSPACE_TOP_PADDING_MULTIPLIER); mWeatherClockSmartspaceScaling = ResourcesCompat.getFloat( mContext.getResources(), R.dimen.weather_clock_smartspace_scale); mWeatherClockSmartspaceTranslateX = mContext.getResources().getDimensionPixelSize( Loading @@ -141,6 +153,12 @@ public class KeyguardClockSwitch extends RelativeLayout { updateStatusArea(/* animate= */false); } /** Get bc_smartspace_view from KeyguardClockSwitchController * Use its top to decide the translation value */ public void setSmartspace(View smartspace) { mSmartspace = smartspace; } /** Sets whether the large clock is being shown on a connected display. */ public void setLargeClockOnSecondaryDisplay(boolean onSecondaryDisplay) { if (mClock != null) { Loading Loading @@ -291,7 +309,7 @@ public class KeyguardClockSwitch extends RelativeLayout { && mClock.getLargeClock().getConfig().getHasCustomWeatherDataDisplay()) { statusAreaClockScale = mWeatherClockSmartspaceScaling; statusAreaClockTranslateX = mWeatherClockSmartspaceTranslateX; statusAreaClockTranslateY = mWeatherClockSmartspaceTranslateY; statusAreaClockTranslateY = mWeatherClockSmartspaceTranslateY - mSmartspaceTop; if (mSplitShadeCentered) { statusAreaClockTranslateX *= SMARTSPACE_TRANSLATION_CENTER_MULTIPLIER; } Loading Loading @@ -414,10 +432,14 @@ public class KeyguardClockSwitch extends RelativeLayout { post(() -> updateClockTargetRegions()); } if (mDisplayedClockSize != null && !mChildrenAreLaidOut) { if (mSmartspace != null && mSmartspaceTop != mSmartspace.getTop()) { mSmartspaceTop = mSmartspace.getTop(); post(() -> updateClockViews(mDisplayedClockSize == LARGE, mAnimateOnLayout)); } if (mDisplayedClockSize != null && !mChildrenAreLaidOut) { post(() -> updateClockViews(mDisplayedClockSize == LARGE, mAnimateOnLayout)); } mChildrenAreLaidOut = true; } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +1 −0 Original line number Diff line number Diff line Loading @@ -371,6 +371,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mSmartspaceView.setPaddingRelative(startPadding, 0, endPadding, 0); mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView); mView.setSmartspace(mSmartspaceView); } /** Loading