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

Commit ad7c4b9c authored by Jay Thomas Sullivan's avatar Jay Thomas Sullivan Committed by Yi-an Chen
Browse files

[XPD] Use DrawableStateLayout background

For the following Preferences:

- Preference
- SelectorWithWidgetPreference
- TwoTargetPreference

...make the layout's root element a DrawableStateLayout, and set its
'background' attribute to "@drawable/settingslib_round_background".

This should have no visual impact, and only has effect when expressive
design is enabled. But it changes the source of the Preference's
background image (instead of ?selectableItemBackground, it will be
@drawable/settingslib_round_background_stateful). (Note that before this
change, the background is currently being set at runtime, in code, to a
fixed background.)

Test: manual
Relnote: N/A
Flag: com.android.settingslib.widget.theme.flags.is_expressive_design_enabled
Bug: 375480009
Change-Id: I9597b867109de218b323f469a4dfbcc30d2564b5
parent 9b1db66a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
    limitations under the License.
  -->

<LinearLayout
<com.android.settingslib.widget.DrawableStateLinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
@@ -58,4 +58,4 @@
            android:id="@+id/selector_extra_widget"
            style="?expressiveSelectorWithWidgetPreferenceExtraWidgetImageStyle" />
    </LinearLayout>
</LinearLayout>
</com.android.settingslib.widget.DrawableStateLinearLayout>
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
    </style>

    <style name="ExpressiveSelectorWithWidgetPreferenceRootLayoutStyle">
        <item name="android:background">?android:attr/selectableItemBackground</item>
        <item name="android:background">@drawable/settingslib_round_background_stateful</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:minHeight">?android:attr/listPreferredItemHeightSmall</item>
        <item name="android:paddingStart">?android:attr/listPreferredItemPaddingStart</item>
+3 −1
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:colorControlHighlight">
    android:color="?android:colorControlHighlight"
    android:paddingStart="32dp"
    android:paddingEnd="32dp">
    <item
        android:start="?android:attr/listPreferredItemPaddingStart"
        android:end="?android:attr/listPreferredItemPaddingEnd">
+3 −1
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:colorControlHighlight">
    android:color="?android:colorControlHighlight"
    android:paddingStart="32dp"
    android:paddingEnd="32dp">
    <item
        android:start="?android:attr/listPreferredItemPaddingStart"
        android:end="?android:attr/listPreferredItemPaddingEnd">
+3 −1
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@
  -->

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="?android:colorControlHighlight">
    android:color="?android:colorControlHighlight"
    android:paddingStart="32dp"
    android:paddingEnd="32dp">
    <item
        android:start="?android:attr/listPreferredItemPaddingStart"
        android:end="?android:attr/listPreferredItemPaddingEnd">
Loading