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

Commit 3ea11240 authored by Sunny Shao's avatar Sunny Shao
Browse files

Fix the category preference aligement problem

- The reason is the fixed value of the paddingStart.
- Change the value when display size is changing.

Fixes: 177968087
Test: manual test
Change-Id: Ibdcdc51e4ee7d8c327d03f0a4aee5891efe1cbd0
parent b9de6898
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -19,14 +19,13 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="24dp"
    android:paddingStart="24dp"
    android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:background="?android:attr/selectableItemBackground"
    android:baselineAligned="false"
    android:layout_marginTop="16dp"
    android:gravity="center_vertical">
    android:gravity="center_vertical"
    style="@style/PreferenceCategoryStartMargin">

    <RelativeLayout
        android:layout_width="0dp"
@@ -57,6 +56,5 @@
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="10"
            style="@style/PreferenceSummaryTextStyle"/>

    </RelativeLayout>
</LinearLayout>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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>
    <style name="PreferenceCategoryStartMargin">
        <item name="android:paddingLeft">24dp</item>
        <item name="android:paddingStart">24dp</item>
    </style>
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -22,4 +22,9 @@
        <!-- 0.8 Spacing, 0.8/11 = 0.072727273 -->
        <item name="android:letterSpacing">0.072727273</item>
    </style>

    <style name="PreferenceCategoryStartMargin">
        <item name="android:paddingLeft">?android:attr/listPreferredItemPaddingLeft</item>
        <item name="android:paddingStart">?android:attr/listPreferredItemPaddingStart</item>
    </style>
</resources>