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

Commit ccb66a27 authored by Matt Pietal's avatar Matt Pietal Committed by Automerger Merge Worker
Browse files

Merge "Large clock positioning" into sc-dev am: 4719320f am: bf438bab

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

Change-Id: I395fdd491cc16a2beccef5bac461c62837c128ae
parents c1f31789 bf438bab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@
            android:id="@+id/animatable_clock_view_large"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_gravity="center"
            android:gravity="center_horizontal"
            android:textSize="@dimen/large_clock_text_size"
            android:fontFamily="@font/clock"
+3 −0
Original line number Diff line number Diff line
@@ -20,4 +20,7 @@

    <!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) -->
    <dimen name="large_clock_text_size">200dp</dimen>

    <!-- With the large clock, move up slightly from the center -->
    <dimen name="keyguard_large_clock_top_margin">-104dp</dimen>
</resources>
+5 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@
    <dimen name="keyguard_indication_y_translation">24dp</dimen>

    <!-- The padding on the bottom of the notifications on the keyguard -->
    <dimen name="keyguard_indication_bottom_padding">12sp</dimen>
    <dimen name="keyguard_indication_bottom_padding">16sp</dimen>

    <!-- The padding at start and end of indication text shown on AOD -->
    <dimen name="keyguard_indication_text_padding">16dp</dimen>
@@ -743,6 +743,10 @@
    <dimen name="keyguard_clock_lock_margin">16dp</dimen>
    <!-- The amount to shift the clocks during a small/large transition -->
    <dimen name="keyguard_clock_switch_y_shift">10dp</dimen>
    <!-- When large clock is showing, offset the smartspace by this amount -->
    <dimen name="keyguard_smartspace_top_offset">12dp</dimen>
    <!-- With the large clock, move up slightly from the center -->
    <dimen name="keyguard_large_clock_top_margin">-52dp</dimen>

    <!-- Default line spacing multiplier between hours and minutes of the keyguard clock -->
    <item name="keyguard_clock_line_spacing_scale" type="dimen" format="float">.7</item>
+5 −1
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
    private View mKeyguardStatusArea;
    /** Mutually exclusive with mKeyguardStatusArea */
    private View mSmartspaceView;
    private int mSmartspaceTopOffset;

    /**
     * Maintain state so that a newly connected plugin can be initialized.
@@ -108,6 +109,9 @@ public class KeyguardClockSwitch extends RelativeLayout {

        mClockSwitchYAmount = mContext.getResources().getDimensionPixelSize(
                R.dimen.keyguard_clock_switch_y_shift);

        mSmartspaceTopOffset = mContext.getResources().getDimensionPixelSize(
                R.dimen.keyguard_smartspace_top_offset);
    }

    /**
@@ -205,7 +209,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
            if (indexOfChild(in) == -1) addView(in);
            direction = -1;
            smartspaceYTranslation = mSmartspaceView == null ? 0
                    : mClockFrame.getTop() - mSmartspaceView.getTop();
                    : mClockFrame.getTop() - mSmartspaceView.getTop() + mSmartspaceTopOffset;
        } else {
            in = mClockFrame;
            out = mLargeClockFrame;
+13 −4
Original line number Diff line number Diff line
@@ -191,10 +191,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
                    .getDimensionPixelSize(R.dimen.below_clock_padding_end);
            mSmartspaceView.setPaddingRelative(startPadding, 0, endPadding, 0);

            // ... but above the large clock
            lp = new RelativeLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT);
            lp.addRule(RelativeLayout.BELOW, mSmartspaceView.getId());
            mLargeClockFrame.setLayoutParams(lp);
            updateClockLayout();

            View nic = mView.findViewById(
                    R.id.left_aligned_notification_icon_container);
@@ -237,6 +234,18 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
     */
    public void onDensityOrFontScaleChanged() {
        mView.onDensityOrFontScaleChanged();

        updateClockLayout();
    }

    private void updateClockLayout() {
        if (mSmartspaceController.isEnabled()) {
            RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT,
                    MATCH_PARENT);
            lp.topMargin = getContext().getResources().getDimensionPixelSize(
                    R.dimen.keyguard_large_clock_top_margin);
            mLargeClockFrame.setLayoutParams(lp);
        }
    }

    /**
Loading