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

Commit f5593956 authored by Fan Zhang's avatar Fan Zhang
Browse files

Use preference theme from SettingsLib

Bug: 36663882
Test: rerun robotests
Change-Id: I9f0f51a9d070191f5bf8f3315fef4d997d6213c3
parent 5c279e4b
Loading
Loading
Loading
Loading
+0 −66
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2016 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.
  -->

<!-- Based off frameworks/base/core/res/res/layout/preference_category_material.xml
     except that this supports icon -->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="8dp"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart" >

    <LinearLayout
        android:id="@+id/icon_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="start|center_vertical"
        android:orientation="horizontal">
        <com.android.internal.widget.PreferenceImageView
            android:id="@android:id/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:tint="?android:attr/textColorPrimary"
            android:maxWidth="18dp"
            android:maxHeight="18dp"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="56dp"
        android:orientation="vertical">
        <TextView
            android:id="@android:id/title"
            android:layout_marginTop="16dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAppearance="@android:style/TextAppearance.Material.Body2"
            android:textColor="?android:attr/colorAccent"
            android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"/>
        <TextView
            android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceListItemSecondary"
            android:textColor="?android:attr/textColorSecondary"
            android:ellipsize="end"
            android:singleLine="true" />
    </LinearLayout>

</FrameLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -30,6 +30,6 @@
        android:layout_marginStart="@dimen/preference_no_icon_padding_start"
        android:visibility="invisible" />

    <include layout="@layout/preference_material_settings"/>
    <include layout="@layout/preference_material"/>

</FrameLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -26,6 +26,6 @@
            android:visibility="invisible"
            android:layout_marginStart="@dimen/preference_no_icon_padding_start"/>

    <include layout="@layout/preference_material_settings" />
    <include layout="@layout/preference_material" />

</FrameLayout>
 No newline at end of file
+5 −48
Original line number Diff line number Diff line
@@ -19,64 +19,21 @@
<!-- Things unrelated to preference framework UI customization should go to other styles files -->
<resources>

    <dimen name="preference_no_icon_padding_start">72dp</dimen>

    <!-- Fragment style -->
    <style name="PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
    <style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragmentStyle.SettingsBase">
        <item name="android:layout">@layout/preference_list_fragment</item>
        <item name="allowDividerAfterLastItem">false</item>
    </style>

    <!-- Preferences -->
    <style name="SettingsPreference" parent="@style/Preference.Material">
        <item name="allowDividerAbove">false</item>
        <item name="allowDividerBelow">true</item>
        <item name="singleLineTitle">false</item>
        <item name="iconSpaceReserved">true</item>
    </style>

    <style name="ApnPreference" parent="SettingsPreference">
    <style name="ApnPreference" parent="Preference.SettingsBase">
        <item name="android:layout">@layout/apn_preference_layout</item>
    </style>

    <style name="FooterPreference" parent="SettingsPreference">
        <item name="android:layout">@layout/preference_footer</item>
        <item name="allowDividerAbove">true</item>
    </style>

    <style name="EditTextPreference"
           parent="@style/Preference.DialogPreference.EditTextPreference.Material">
        <item name="allowDividerAbove">false</item>
        <item name="allowDividerBelow">true</item>
        <item name="iconSpaceReserved">true</item>
        <item name="singleLineTitle">false</item>
        <item name="android:dialogLayout">@layout/preference_dialog_edittext</item>
    </style>

    <style name="SettingsDropdownPreference" parent="SettingsPreference">
        <item name="android:layout">@layout/preference_dropdown_material_settings</item>
    </style>

    <style name="SettingsDialogPreference" parent="SettingsPreference" />

    <style name="SettingsPreferenceCategory" parent="@style/Preference.Category.Material">
        <item name="allowDividerAbove">true</item>
        <item name="allowDividerBelow">true</item>
        <item name="android:layout">@layout/preference_category_material_settings</item>
    </style>

    <style name="SettingsSeekBarPreference" parent="SettingsPreference">
    <style name="SettingsSeekBarPreference" parent="Preference.SettingsBase">
        <item name="android:layout">@layout/preference_widget_seekbar_settings</item>
    </style>

    <style name="SettingsSwitchPreference" parent="@style/Preference.SwitchPreference.Material">
        <item name="allowDividerAbove">false</item>
        <item name="allowDividerBelow">true</item>
        <item name="iconSpaceReserved">true</item>
        <item name="singleLineTitle">false</item>
    </style>

    <style name="SyncSwitchPreference" parent="SettingsPreference">
    <style name="SyncSwitchPreference" parent="Preference.SettingsBase">
        <item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item>
    </style>

</resources>
 No newline at end of file
+2 −11
Original line number Diff line number Diff line
@@ -122,19 +122,10 @@
        <item name="android:windowAnimationStyle">@android:style/Animation.Activity</item>
    </style>

    <style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay.v14.Material">
        <!-- Parent path frameworks/support/v14/preference/res/values/themes.xml -->
        <item name="android:scrollbars">vertical</item>
    <style name="PreferenceTheme" parent="@style/PreferenceThemeOverlay.SettingsBase">
        <item name="preferenceFragmentStyle">@style/SettingsPreferenceFragmentStyle</item>
        <item name="apnPreferenceStyle">@style/ApnPreference</item>
        <item name="footerPreferenceStyle">@style/FooterPreference</item>
        <item name="dialogPreferenceStyle">@style/SettingsDialogPreference</item>
        <item name="dropdownPreferenceStyle">@style/SettingsDropdownPreference</item>
        <item name="editTextPreferenceStyle">@style/EditTextPreference</item>
        <item name="preferenceCategoryStyle">@style/SettingsPreferenceCategory</item>
        <item name="preferenceFragmentStyle">@style/PreferenceFragmentStyle</item>
        <item name="preferenceStyle">@style/SettingsPreference</item>
        <item name="seekBarPreferenceStyle">@style/SettingsSeekBarPreference</item>
        <item name="switchPreferenceStyle">@style/SettingsSwitchPreference</item>
    </style>

    <style name="PreferenceTheme.SetupWizard" parent="PreferenceTheme">
Loading