Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b696d898 authored by Sherry Zhou's avatar Sherry Zhou Committed by Automerger Merge Worker
Browse files

Merge "Fix overlap between weather clock and smartspace" into udc-qpr-dev am:...

Merge "Fix overlap between weather clock and smartspace" into udc-qpr-dev am: 335ebbcd am: 22437fdf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24762406



Change-Id: I91db2ccece2260a7f308afda6fc1f4001822b4a6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d2fe0f30 22437fdf
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -112,6 +112,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.
     */
@@ -154,6 +156,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);
    }

@@ -299,6 +303,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;
@@ -313,10 +319,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