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

Commit 90852301 authored by Michael Kwan's avatar Michael Kwan
Browse files

Allow preference theming to remove divider.

Bug: 27962897
Change-Id: I6632f2a3c3d1290c472594f127ad33c9b85023f1
parent c7b1d74a
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -189,12 +189,10 @@ public abstract class PreferenceFragment extends Fragment implements
                0);

        ListView lv = (ListView) view.findViewById(android.R.id.list);
        if (lv != null) {
            Drawable divider =
                    a.getDrawable(com.android.internal.R.styleable.PreferenceFragment_divider);
            if (divider != null) {
                lv.setDivider(divider);
            }
        if (lv != null
                && a.hasValueOrEmpty(com.android.internal.R.styleable.PreferenceFragment_divider)) {
            lv.setDivider(
                    a.getDrawable(com.android.internal.R.styleable.PreferenceFragment_divider));
        }

        a.recycle();
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ please see styles_device_defaults.xml.
        <item name="wallpaperIntraCloseExitAnimation">@anim/slide_in_exit_micro</item>
    </style>

    <style name="PreferenceFragment.Material" parent="BasePreferenceFragment">
        <item name="divider">@empty</item>
    </style>

    <style name="Widget.Material.TextView" parent="Widget.TextView">
        <item name="breakStrategy">balanced</item>
    </style>
+3 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ please see styles_device_defaults.xml.
        <item name="layout">@layout/preference_material</item>
    </style>

    <style name="PreferenceFragment.Material">
    <style name="BasePreferenceFragment">
        <item name="layout">@layout/preference_list_fragment_material</item>
        <item name="paddingStart">@dimen/preference_fragment_padding_side_material</item>
        <item name="paddingEnd">@dimen/preference_fragment_padding_side_material</item>
@@ -46,6 +46,8 @@ please see styles_device_defaults.xml.
        <item name="clipToPadding">@bool/config_preferenceFragmentClipToPadding</item>
    </style>

    <style name="PreferenceFragment.Material" parent="BasePreferenceFragment"/>

    <style name="PreferenceActivity.Material">
        <item name="layout">@layout/preference_list_content_material</item>
        <item name="headerLayout">@layout/preference_header_item_material</item>