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

Commit 21cbd245 authored by Darrell Shi's avatar Darrell Shi
Browse files

Add a y translation to clock complication.

The clock complication comes with internal paddings that make the
spacing with the complications below too large, even without any layout
engine margin. Without a better solution, add a y translation to the
clock so reduce the spacing, and also change its text size to dp unit
so it doesn't respond to system text size change, which would mess up
the translation.

Test: https://screenshot.googleplex.com/BLfQEhA6i2t4qyu
Test: https://screenshot.googleplex.com/BbuvDvfmahtNy5U
Bug: 257553229
Change-Id: I7350981a28af590f6e70fb4fab004d5180cda502
parent e5f9a95a
Loading
Loading
Loading
Loading
+26 −19
Original line number Diff line number Diff line
@@ -14,9 +14,13 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<com.android.systemui.shared.shadow.DoubleShadowTextClock
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <com.android.systemui.shared.shadow.DoubleShadowTextClock
        android:id="@+id/time_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
@@ -27,6 +31,7 @@
        android:fontFeatureSettings="pnum, lnum"
        android:letterSpacing="0.02"
        android:textSize="@dimen/dream_overlay_complication_clock_time_text_size"
        android:translationY="@dimen/dream_overlay_complication_clock_time_translation_y"
        app:keyShadowBlur="@dimen/dream_overlay_clock_key_text_shadow_radius"
        app:keyShadowOffsetX="@dimen/dream_overlay_clock_key_text_shadow_dx"
        app:keyShadowOffsetY="@dimen/dream_overlay_clock_key_text_shadow_dy"
@@ -36,3 +41,5 @@
        app:ambientShadowOffsetY="@dimen/dream_overlay_clock_ambient_text_shadow_dy"
        app:ambientShadowAlpha="0.3"
        />

</FrameLayout>
+2 −1
Original line number Diff line number Diff line
@@ -1500,7 +1500,8 @@
    <dimen name="dream_overlay_status_bar_extra_margin">8dp</dimen>

    <!-- Dream overlay complications related dimensions -->
    <dimen name="dream_overlay_complication_clock_time_text_size">86sp</dimen>
    <dimen name="dream_overlay_complication_clock_time_text_size">86dp</dimen>
    <dimen name="dream_overlay_complication_clock_time_translation_y">28dp</dimen>
    <dimen name="dream_overlay_complication_home_controls_padding">28dp</dimen>
    <dimen name="dream_overlay_complication_clock_subtitle_text_size">24sp</dimen>
    <dimen name="dream_overlay_complication_preview_text_size">36sp</dimen>
+3 −2
Original line number Diff line number Diff line
@@ -45,11 +45,12 @@ public interface DreamClockTimeComplicationModule {
    @Provides
    @Named(DREAM_CLOCK_TIME_COMPLICATION_VIEW)
    static View provideComplicationView(LayoutInflater layoutInflater) {
        final TextClock view = Preconditions.checkNotNull((TextClock)
        final View view = Preconditions.checkNotNull(
                        layoutInflater.inflate(R.layout.dream_overlay_complication_clock_time,
                                null, false),
                "R.layout.dream_overlay_complication_clock_time did not properly inflated");
        view.setFontVariationSettings(TAG_WEIGHT + WEIGHT);
        ((TextClock) view.findViewById(R.id.time_view)).setFontVariationSettings(
                TAG_WEIGHT + WEIGHT);
        return view;
    }
}