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

Commit cf638ace authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Use more styles for preferences to allow single pane 10"

Change-Id: Ib3b1032ca45f22bca08546eb65b2c42bc1975bdf
parent b3316ef7
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -1112,6 +1112,7 @@ public abstract class PreferenceActivity extends ListActivity implements
            try {
            try {
                mFragmentBreadCrumbs = (FragmentBreadCrumbs)crumbs;
                mFragmentBreadCrumbs = (FragmentBreadCrumbs)crumbs;
            } catch (ClassCastException e) {
            } catch (ClassCastException e) {
                setTitle(title);
                return;
                return;
            }
            }
            if (mFragmentBreadCrumbs == null) {
            if (mFragmentBreadCrumbs == null) {
@@ -1125,13 +1126,18 @@ public abstract class PreferenceActivity extends ListActivity implements
                // Hide the breadcrumb section completely for single-pane
                // Hide the breadcrumb section completely for single-pane
                View bcSection = findViewById(com.android.internal.R.id.breadcrumb_section);
                View bcSection = findViewById(com.android.internal.R.id.breadcrumb_section);
                if (bcSection != null) bcSection.setVisibility(View.GONE);
                if (bcSection != null) bcSection.setVisibility(View.GONE);
                setTitle(title);
            }
            }
            mFragmentBreadCrumbs.setMaxVisible(2);
            mFragmentBreadCrumbs.setMaxVisible(2);
            mFragmentBreadCrumbs.setActivity(this);
            mFragmentBreadCrumbs.setActivity(this);
        }
        }
        if (mFragmentBreadCrumbs.getVisibility() != View.VISIBLE) {
            setTitle(title);
        } else {
            mFragmentBreadCrumbs.setTitle(title, shortTitle);
            mFragmentBreadCrumbs.setTitle(title, shortTitle);
            mFragmentBreadCrumbs.setParentTitle(null, null, null);
            mFragmentBreadCrumbs.setParentTitle(null, null, null);
        }
        }
    }


    /**
    /**
     * Should be called after onCreate to ensure that the breadcrumbs, if any, were created.
     * Should be called after onCreate to ensure that the breadcrumbs, if any, were created.
+2 −7
Original line number Original line Diff line number Diff line
@@ -30,24 +30,19 @@
        android:layout_weight="1">
        android:layout_weight="1">


        <LinearLayout
        <LinearLayout
            style="?attr/preferenceHeaderPanelStyle"
            android:id="@+id/headers"
            android:id="@+id/headers"
            android:orientation="vertical"
            android:orientation="vertical"
            android:layout_width="0px"
            android:layout_width="0px"
            android:layout_height="match_parent"
            android:layout_height="match_parent"
            android:layout_marginEnd="@dimen/preference_screen_side_margin_negative"
            android:layout_marginStart="@dimen/preference_screen_side_margin"
            android:layout_weight="@integer/preferences_left_pane_weight">
            android:layout_weight="@integer/preferences_left_pane_weight">


            <ListView android:id="@android:id/list"
            <ListView android:id="@android:id/list"
                style="?attr/preferenceListStyle"
                android:layout_width="match_parent"
                android:layout_width="match_parent"
                android:layout_height="0px"
                android:layout_height="0px"
                android:layout_weight="1"
                android:layout_weight="1"
                android:paddingStart="@dimen/preference_screen_header_padding_side"
                android:paddingEnd="@dimen/preference_screen_header_padding_side"
                android:paddingTop="@dimen/preference_screen_header_vertical_padding"
                android:paddingBottom="@dimen/preference_screen_header_vertical_padding"
                android:clipToPadding="false"
                android:clipToPadding="false"
                android:scrollbarStyle="@integer/preference_screen_header_scrollbarStyle"
                android:drawSelectorOnTop="false"
                android:drawSelectorOnTop="false"
                android:cacheColorHint="@android:color/transparent"
                android:cacheColorHint="@android:color/transparent"
                android:listPreferredItemHeight="48dp"
                android:listPreferredItemHeight="48dp"
+1 −2
Original line number Original line Diff line number Diff line
@@ -25,13 +25,12 @@
    android:layout_removeBorders="true">
    android:layout_removeBorders="true">


    <ListView android:id="@android:id/list"
    <ListView android:id="@android:id/list"
        style="?attr/preferenceFragmentListStyle"
        android:layout_width="match_parent"
        android:layout_width="match_parent"
        android:layout_height="0px"
        android:layout_height="0px"
        android:layout_weight="1"
        android:layout_weight="1"
        android:paddingTop="0dip"
        android:paddingTop="0dip"
        android:paddingBottom="@dimen/preference_fragment_padding_bottom"
        android:paddingBottom="@dimen/preference_fragment_padding_bottom"
        android:paddingStart="@dimen/preference_fragment_padding_side"
        android:paddingEnd="@dimen/preference_fragment_padding_side"
        android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
        android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
        android:clipToPadding="false"
        android:clipToPadding="false"
        android:drawSelectorOnTop="false"
        android:drawSelectorOnTop="false"
+8 −0
Original line number Original line Diff line number Diff line
@@ -737,6 +737,14 @@
        <attr name="preferenceLayoutChild" format="reference" />
        <attr name="preferenceLayoutChild" format="reference" />
        <!-- Preference panel style -->
        <!-- Preference panel style -->
        <attr name="preferencePanelStyle" format="reference" />
        <attr name="preferencePanelStyle" format="reference" />
        <!-- Preference headers panel style -->
        <attr name="preferenceHeaderPanelStyle" format="reference" />
        <!-- Preference list style -->
        <attr name="preferenceListStyle" format="reference" />
        <!-- Preference fragment list style -->
        <attr name="preferenceFragmentListStyle" format="reference" />
        <!-- Preference fragment padding side -->
        <attr name="preferenceFragmentPaddingSide" format="dimension" />
        <!-- Default style for switch preferences. -->
        <!-- Default style for switch preferences. -->
        <attr name="switchPreferenceStyle" format="reference" />
        <attr name="switchPreferenceStyle" format="reference" />


+20 −2
Original line number Original line Diff line number Diff line
@@ -1058,6 +1058,24 @@ please see styles_device_defaults.xml.
        <item name="android:background">@null</item>
        <item name="android:background">@null</item>
    </style>
    </style>


    <style name="PreferenceHeaderPanel">
        <item name="android:layout_marginStart">@dimen/preference_screen_side_margin</item>
        <item name="android:layout_marginEnd">@dimen/preference_screen_side_margin_negative</item>
        <item name="android:paddingTop">@dimen/preference_screen_header_vertical_padding</item>
        <item name="android:paddingBottom">@dimen/preference_screen_header_vertical_padding</item>
    </style>

    <style name="PreferenceHeaderList">
        <item name="android:paddingStart">@dimen/preference_screen_header_padding_side</item>
        <item name="android:paddingEnd">@dimen/preference_screen_header_padding_side</item>
        <item name="android:scrollbarStyle">@integer/preference_screen_header_scrollbarStyle</item>
    </style>

    <style name="PreferenceFragmentList">
        <item name="android:paddingStart">@dimen/preference_fragment_padding_side</item>
        <item name="android:paddingEnd">@dimen/preference_fragment_padding_side</item>
    </style>

    <!-- Other Misc Styles -->
    <!-- Other Misc Styles -->
    <eat-comment />
    <eat-comment />


@@ -2426,8 +2444,8 @@ please see styles_device_defaults.xml.
    <style name="Widget.Holo.PreferenceFrameLayout">
    <style name="Widget.Holo.PreferenceFrameLayout">
        <item name="android:borderTop">0dip</item>
        <item name="android:borderTop">0dip</item>
        <item name="android:borderBottom">@dimen/preference_fragment_padding_bottom</item>
        <item name="android:borderBottom">@dimen/preference_fragment_padding_bottom</item>
        <item name="android:borderLeft">@dimen/preference_fragment_padding_side</item>
        <item name="android:borderLeft">?attr/preferenceFragmentPaddingSide</item>
        <item name="android:borderRight">@dimen/preference_fragment_padding_side</item>
        <item name="android:borderRight">?attr/preferenceFragmentPaddingSide</item>
    </style>
    </style>


    <!-- Pointer styles -->
    <!-- Pointer styles -->
Loading