diff options
| author | 2023-09-14 22:34:28 +0000 | |
|---|---|---|
| committer | 2023-09-20 22:21:44 +0000 | |
| commit | 6eff02fdad8f5224c0f22df3dd4b354916e3cc2a (patch) | |
| tree | 7872a8eacab28cd39fd7527185dbeb0a10b7544e | |
| parent | 558e2ef70a471854ce508ebca7074777f9849128 (diff) | |
Fix overlap between weather clock and smartspace
Test: manual test on Felix, Cheetah
Bug: 299034855
Change-Id: I058e643d68decf044a6e57a04c06695def09b66d
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 450010c1bcd4..8eab31e7f3f3 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -108,6 +108,8 @@ public class KeyguardClockSwitch extends RelativeLayout { private int mWeatherClockSmartspaceTranslateY = 0; private int mDrawAlpha = 255; + private int mStatusBarHeight = 0; + /** * Maintain state so that a newly connected plugin can be initialized. */ @@ -150,6 +152,8 @@ public class KeyguardClockSwitch extends RelativeLayout { R.dimen.weather_clock_smartspace_translateX); mWeatherClockSmartspaceTranslateY = mContext.getResources().getDimensionPixelSize( R.dimen.weather_clock_smartspace_translateY); + mStatusBarHeight = mContext.getResources().getDimensionPixelSize( + R.dimen.status_bar_height); updateStatusArea(/* animate= */false); } @@ -295,6 +299,8 @@ public class KeyguardClockSwitch extends RelativeLayout { mStatusAreaAnim = null; View in, out; + // statusAreaYTranslation uses for the translation for both mStatusArea and mSmallClockFrame + // statusAreaClockTranslateY only uses for mStatusArea float statusAreaYTranslation, statusAreaClockScale = 1f; float statusAreaClockTranslateX = 0f, statusAreaClockTranslateY = 0f; float clockInYTranslation, clockOutYTranslation; @@ -309,10 +315,21 @@ public class KeyguardClockSwitch extends RelativeLayout { && mClock.getLargeClock().getConfig().getHasCustomWeatherDataDisplay()) { statusAreaClockScale = mWeatherClockSmartspaceScaling; statusAreaClockTranslateX = mWeatherClockSmartspaceTranslateX; - statusAreaClockTranslateY = mWeatherClockSmartspaceTranslateY - mSmartspaceTop; if (mSplitShadeCentered) { statusAreaClockTranslateX *= SMARTSPACE_TRANSLATION_CENTER_MULTIPLIER; } + + // On large weather clock, + // top padding for time is status bar height from top of the screen. + // On small one, + // it's screenOffsetYPadding (translationY for KeyguardStatusView), + // Cause smartspace is positioned according to the smallClockFrame + // we need to translate the difference between bottom of large clock and small clock + // Also, we need to counter offset the empty date weather view, mSmartspaceTop + // mWeatherClockSmartspaceTranslateY is only for Felix + statusAreaClockTranslateY = mStatusBarHeight - 0.6F * mSmallClockFrame.getHeight() + - mSmartspaceTop - screenOffsetYPadding + - statusAreaYTranslation + mWeatherClockSmartspaceTranslateY; } clockInYTranslation = 0; clockOutYTranslation = 0; // Small clock translation is handled with statusArea |