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

Commit aa568bbd authored by Matt Pietal's avatar Matt Pietal
Browse files

AOD/LS - Large clock adjustments

For smaller displays and/or displays set to use a larger size/font,
the large clock would display too far down on the screen. Remove some
padding, and use variable sizes for the font depending on the
available height.

Fixes: 176474531
Test: manual, testing multiple display sizes and burn-in testing
Change-Id: I865ea965d83ae25ea9b53f6aacd37492ddc21930
parent 47fcbd74
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/keyguard_status_area"
        android:paddingTop="20dp"
        android:visibility="gone">
        <com.android.keyguard.AnimatableClockView
            android:id="@+id/animatable_clock_view_large"
@@ -97,7 +96,7 @@
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:gravity="center_horizontal"
            android:textSize="200dp"
            android:textSize="@dimen/large_clock_text_size"
            android:letterSpacing="0.02"
            android:lineSpacingMultiplier=".8"
            android:includeFontPadding="false"
+20 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<resources>
    <!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) -->
    <dimen name="large_clock_text_size">170dp</dimen>
</resources>
+4 −1
Original line number Diff line number Diff line
@@ -17,4 +17,7 @@
<resources>
    <!-- Minimum margin between clock and top of screen or ambient indication -->
    <dimen name="keyguard_clock_top_margin">76dp</dimen>

    <!-- Large clock maximum font size (dp is intentional, to prevent any further scaling) -->
    <dimen name="large_clock_text_size">200dp</dimen>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,13 @@
         burn-in on AOD. -->
    <dimen name="burn_in_prevention_offset_y">50dp</dimen>

    <!-- The maximum offset in either direction that elements are moved vertically to prevent
         burn-in on AOD. -->
    <dimen name="burn_in_prevention_offset_y_large_clock">42dp</dimen>

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

    <!-- The maximum offset in either direction that icons move to prevent burn-in on AOD. -->
    <dimen name="default_burn_in_prevention_offset">15dp</dimen>

+5 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import android.widget.TextClock;
import android.widget.TextView;

import com.android.internal.colorextraction.ColorExtractor;
import com.android.keyguard.dagger.KeyguardStatusViewScope;
@@ -143,6 +144,10 @@ public class KeyguardClockSwitch extends RelativeLayout {
        setTextSize(TypedValue.COMPLEX_UNIT_PX, mContext.getResources()
                .getDimensionPixelSize(R.dimen.widget_big_font_size));

        ((TextView) mNewLockscreenLargeClockFrame.getChildAt(0))
                .setTextSize(TypedValue.COMPLEX_UNIT_PX, mContext.getResources()
                        .getDimensionPixelSize(R.dimen.large_clock_text_size));

        mClockSwitchYAmount = mContext.getResources().getDimensionPixelSize(
                R.dimen.keyguard_clock_switch_y_shift);
    }
@@ -374,7 +379,6 @@ public class KeyguardClockSwitch extends RelativeLayout {
        if (hasVisibleNotifications == mHasVisibleNotifications) {
            return;
        }

        animateClockChange(!hasVisibleNotifications);

        mHasVisibleNotifications = hasVisibleNotifications;
Loading