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

Commit 482dd9bc authored by Richard MacGregor's avatar Richard MacGregor
Browse files

[XPD] Support Switch style injection

This change implements "style injection" for the switch preference which
uses a MaterialSwitch

...where "style injection" means that the Switch's layouts do not
directly reference any <style>s, but instead receive them via a
corresponding theme <attr>.

Bug: 375480015
Test: manual
Flag: com.android.settingslib.widget.theme.flags.is_expressive_design_enabled
Relnote: N/A
Change-Id: I2ef36a331cc5ba3c4b7112c3e19ea59699228147
parent 170c6493
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,4 +20,4 @@
    android:theme="@style/Theme.Material3.DynamicColors.DayNight"
    android:id="@+id/switchWidget"
    android:filterTouchesWhenObscured="false"
    style="@style/SettingslibSwitchStyle.Expressive"/>
 No newline at end of file
    style="?expressiveSwitchStyle"/>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@
        <!-- Set up edge-to-edge configuration for top app bar -->
        <item name="android:clipToPadding">false</item>
        <item name="android:clipChildren">false</item>

        <!-- For Expressive Switch -->
        <item name="expressiveSwitchStyle">@style/SettingslibSwitchStyle.Expressive</item>
    </style>

    <!-- Using in SubSettings page including injected settings page -->
+2 −0
Original line number Diff line number Diff line
@@ -22,4 +22,6 @@
        <!-- Specifies that the textView is collapsable. -->
        <attr name="isCollapsable" format="boolean"/>
    </declare-styleable>

    <attr name="expressiveSwitchStyle" format="reference" />
</resources>
 No newline at end of file