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

Commit 963d92cc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update spacing/layout of LS clock"

parents 07569c92 741c6e36
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -67,20 +67,18 @@
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true"
        android:layout_marginBottom="24dp"
        android:visibility="gone">
        <com.android.keyguard.AnimatableClockView
            android:id="@+id/animatable_clock_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:textSize="80dp"
            android:letterSpacing="0.02"
            android:lineSpacingMultiplier=".8"
            android:includeFontPadding="false"
            android:fontFamily="@font/clock"
            android:typeface="monospace"
            android:format12Hour="hh\nmm"
            android:format24Hour="HH\nmm"
            android:elegantTextHeight="false"
        />
    </FrameLayout>
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.keyguard;

import android.graphics.Color;
import android.graphics.Paint;
import android.util.MathUtils;

import com.android.settingslib.Utils;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -54,6 +56,11 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
        mStatusBarStateController.removeCallback(mStatusBarStateListener);
    }

    float getClockTextTopPadding() {
        Paint.FontMetrics fm = mView.getPaint().getFontMetrics();
        return MathUtils.abs(fm.ascent - fm.top);
    }

    /**
     * Updates the time for this view.
     */
+5 −0
Original line number Diff line number Diff line
@@ -232,6 +232,11 @@ public class KeyguardClockSwitch extends RelativeLayout {
        }
    }

    float getClockTextTopPadding() {
        Paint.FontMetrics fm = mClockView.getPaint().getFontMetrics();
        return fm.ascent - fm.top;
    }

    /**
     * Set container for big clock face appearing behind NSSL and KeyguardStatusView.
     */
+9 −0
Original line number Diff line number Diff line
@@ -239,6 +239,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
        mView.setFormat24Hour(Patterns.sClockView24);
    }

    float getClockTextTopPadding() {
        if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1
                && mNewLockScreenClockViewController != null) {
            return mNewLockScreenClockViewController.getClockTextTopPadding();
        }

        return mView.getClockTextTopPadding();
    }

    private void updateAodIcons() {
        NotificationIconContainer nic = (NotificationIconContainer)
                mView.findViewById(
+3 −8
Original line number Diff line number Diff line
@@ -154,12 +154,7 @@ public class KeyguardSliceView extends LinearLayout {
    public void updateLockScreenMode(int mode) {
        mLockScreenMode = mode;
        if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) {
            // add top padding to better align with top of clock
            final int topPadding = (int) TypedValue.applyDimension(
                    TypedValue.COMPLEX_UNIT_DIP,
                    20,
                    getResources().getDisplayMetrics());
            mTitle.setPaddingRelative(0, topPadding, 0, 0);
            mTitle.setPaddingRelative(0, 0, 0, 0);
            mTitle.setGravity(Gravity.START);
            setGravity(Gravity.START);
            RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) getLayoutParams();
@@ -524,9 +519,9 @@ public class KeyguardSliceView extends LinearLayout {
                    .getDimension(R.dimen.widget_horizontal_padding) / 2;
            if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) {
                // orientation is vertical, so add padding to top & bottom
                setPadding(0, padding, 0, padding * (hasText ? 1 : -1));
                setPadding(0, padding, 0, hasText ? padding : 0);
            } else {
                // oreintation is horizontal, so add padding to left & right
                // orientation is horizontal, so add padding to left & right
                setPadding(padding, 0, padding * (hasText ? 1 : -1), 0);
            }

Loading