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

Commit 78cbf5df authored by Edgar Wang's avatar Edgar Wang
Browse files

Move Settings preferenceCategory style into SettingsTheme

- remove devider above and below category

Bug: 176407895
Test: manual
Change-Id: Ic3cdae8300c2b615bd065fe3ffa01ba7cf5f074b
parent 1e2d5e88
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@ android_library {

    resource_dirs: ["res"],

    static_libs: [
            "androidx.preference_preference",
        ],

    sdk_version: "system_current",
    min_sdk_version: "21",
}
+62 −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"
    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">

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

        <TextView
            android:id="@android:id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:textAlignment="viewStart"
            style="@style/PreferenceCategoryTitleTextStyle"/>

        <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"
            android:layout_alignLeft="@android:id/title"
            android:layout_alignStart="@android:id/title"
            android:layout_gravity="start"
            android:textAlignment="viewStart"
            android:textColor="?android:attr/textColorSecondary"
            android:maxLines="10"
            style="@style/PreferenceSummaryTextStyle"/>

    </RelativeLayout>
</LinearLayout>
 No newline at end of file
+25 −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="TextAppearance.CategoryTitle"
           parent="@*android:style/TextAppearance.DeviceDefault.Body2">
        <item name="android:textAllCaps">true</item>
        <item name="android:textSize">11sp</item>
        <!-- 0.8 Spacing, 0.8/11 = 0.072727273 -->
        <item name="android:letterSpacing">0.072727273</item>
    </style>
</resources>
+31 −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="PreferenceTheme" parent="@style/PreferenceThemeOverlay">
        <item name="preferenceCategoryStyle">@style/SettingsCategoryPreference</item>
        <!-- For preference category color -->
        <item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle
        </item>
        <item name="preferenceCategoryTitleTextColor">?android:attr/textColorSecondary</item>
    </style>

    <style name="SettingsCategoryPreference" parent="@style/Preference.Category.Material">
        <item name="android:layout">@layout/preference_category_settings</item>
        <item name="allowDividerAbove">false</item>
        <item name="allowDividerBelow">false</item>
    </style>
</resources>