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

Commit 0dc194d4 authored by Arc Wang's avatar Arc Wang
Browse files

Adjust layout of UsageProgressBarPreference

Use ConstraintLayout to fix UI problems when there are
large font size and large display size in Display Settings.

Bug: 177617478
Test: manual visual
      Set largest font size and larger display size then observe UI.
Change-Id: I85f82b8eeff58f67157786e63552d7811a9d286d
parent 2e4306e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ android_library {

    static_libs: [
        "androidx.preference_preference",
        "androidx-constraintlayout_constraintlayout",
    ],

    sdk_version: "system_current",
+15 −9
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
@@ -26,29 +27,34 @@
    android:paddingTop="32dp"
    android:paddingBottom="32dp">

    <RelativeLayout
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/usage_summary"
            android:layout_width="wrap_content"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignBaseline="@id/total_summary"
            app:layout_constraintWidth_percent="0.6"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBaseline_toBaselineOf="@id/total_summary"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:fontFamily="@*android:string/config_headlineFontFamily"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Display1"
            android:textSize="20sp"/>
            android:textSize="14sp"
            android:textAlignment="viewStart"/>
        <TextView
            android:id="@+id/total_summary"
            android:layout_width="wrap_content"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            app:layout_constraintWidth_percent="0.4"
            app:layout_constraintEnd_toEndOf="parent"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"/>
    </RelativeLayout>
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
            android:textSize="14sp"
            android:textAlignment="viewEnd"/>
    </androidx.constraintlayout.widget.ConstraintLayout>

    <ProgressBar
        android:id="@android:id/progress"