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

Commit a3b332e6 authored by Arc Wang's avatar Arc Wang Committed by Android (Google) Code Review
Browse files

Merge "Tweak UI of UsageProgressBarPreference" into sc-dev

parents 7804da16 5ec2095f
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -24,29 +24,27 @@
    android:orientation="vertical"
    android:layout_marginStart="16dp"
    android:layout_marginEnd="16dp"
    android:paddingTop="32dp"
    android:paddingBottom="32dp">
    android:paddingTop="16dp"
    android:paddingBottom="16dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/usage_summary"
            android:layout_width="0dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_constraintWidth_percent="0.45"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBaseline_toBaselineOf="@id/total_summary"
            android:ellipsize="marquee"
            android:fontFamily="@*android:string/config_headlineFontFamily"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Display1"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
            android:textSize="14sp"
            android:textAlignment="viewStart"/>
        <TextView
            android:id="@+id/total_summary"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintWidth_percent="0.45"
            app:layout_constraintStart_toEndOf="@id/usage_summary"
            app:layout_constraintEnd_toStartOf="@id/custom_content"
            android:ellipsize="marquee"
            android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
@@ -54,12 +52,11 @@
            android:textAlignment="viewEnd"/>
        <FrameLayout
            android:id="@+id/custom_content"
            android:layout_width="0dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintBottom_toBottomOf="@id/total_summary"
            app:layout_constraintWidth_percent="0.1"/>
            app:layout_constraintBottom_toBottomOf="@id/total_summary"/>
    </androidx.constraintlayout.widget.ConstraintLayout>

    <ProgressBar
@@ -67,8 +64,7 @@
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scaleY="2"
        android:layout_marginTop="4dp"
        android:scaleY="4"
        android:max="100"/>

    <TextView
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.content.Context;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.RelativeSizeSpan;
import android.text.style.AbsoluteSizeSpan;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
@@ -192,7 +192,7 @@ public class UsageProgressBarPreference extends Preference {
        final Matcher matcher = mNumberPattern.matcher(summary);
        if (matcher.find()) {
            final SpannableString spannableSummary =  new SpannableString(summary);
            spannableSummary.setSpan(new RelativeSizeSpan(2.4f), matcher.start(),
            spannableSummary.setSpan(new AbsoluteSizeSpan(64, true /* dip */), matcher.start(),
                    matcher.end(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            return spannableSummary;
        }