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

Commit 3b2a339f authored by Edgar Wang's avatar Edgar Wang
Browse files

Update Preference style

- Set Title/Summary left alignment
- Update FooterPreference layout
- Set Title font size to 20sp
- Adjust preferenceCategory TextAppearence
- Adjust ListItemPaddingStart and End
- Move Theme.SettingsBase from Settings to SettingsLib
- Create Theme.SubSettingsBase for client team

Bug: 182374464
Test: visual
Change-Id: Ia541e6e66dfdf029367c464eab96e5cf1e3f8d66
parent 0bbe29b6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
    android:background="?android:attr/selectableItemBackground"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingStart="@dimen/app_preference_padding_start"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">

    <LinearLayout
@@ -29,7 +29,7 @@
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:minWidth="56dp"
        android:minWidth="@dimen/app_icon_min_width"
        android:orientation="horizontal"
        android:paddingEnd="8dp"
        android:paddingTop="4dp"
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:background="?android:attr/selectableItemBackground"
    android:orientation="vertical"
    android:clipToPadding="false">

    <LinearLayout
+40 −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.
  -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/icon_frame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:minWidth="@dimen/icon_min_width"
    android:gravity="start|center_vertical"
    android:orientation="horizontal"
    android:paddingLeft="0dp"
    android:paddingStart="0dp"
    android:paddingRight="8dp"
    android:paddingEnd="8dp"
    android:paddingTop="4dp"
    android:paddingBottom="4dp">

    <androidx.preference.internal.PreferenceImageView
        android:id="@android:id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:maxWidth="48dp"
        app:maxHeight="48dp"/>

</LinearLayout>
+35 −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.
  -->

<!-- We use a FrameLayout as we want to place the invisible spinner on top of the other views -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <!-- This spinner should be invisible in the layout and take up no space, when the Preference
         is clicked the dropdown will appear from this location on screen. -->
    <Spinner
        android:id="@+id/spinner"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/preference_dropdown_padding_start"
        android:layout_marginLeft="@dimen/preference_dropdown_padding_start"
        android:visibility="invisible" />

    <include layout="@layout/settings_preference" />

</FrameLayout>
 No newline at end of file
+76 −0
Original line number Diff line number Diff line
@@ -19,33 +19,35 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:gravity="center_vertical"
    android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    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"
    style="@style/PreferenceCategoryStartMargin">
    android:clipToPadding="false"
    android:baselineAligned="false">

    <include layout="@layout/image_frame"/>

    <RelativeLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:paddingTop="8dp"
        android:paddingBottom="8dp">
        android:paddingTop="16dp"
        android:paddingBottom="16dp">

        <TextView
            android:id="@android:id/title"
            android:layout_width="match_parent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:textAlignment="viewStart"
            style="@style/PreferenceCategoryTitleTextStyle"/>
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceListItem"
            android:ellipsize="marquee"/>

        <TextView
            android:id="@android:id/summary"
            android:ellipsize="end"
            android:singleLine="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/title"
@@ -56,5 +58,19 @@
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="10"
            style="@style/PreferenceSummaryTextStyle"/>

    </RelativeLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout
        android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="end|center_vertical"
        android:paddingLeft="16dp"
        android:paddingStart="16dp"
        android:paddingRight="0dp"
        android:paddingEnd="0dp"
        android:orientation="vertical"/>

</LinearLayout>
 No newline at end of file
Loading