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

Commit b99b91cd authored by Bryce Lee's avatar Bryce Lee
Browse files

Introduce indirection for base micro themes.

This is needed, since overlays must add/modify items to base themes, but
simply declaring the style in an overlay will override the parent. To
ensure the true parent is never overridden, a base theme is introduced
that both the regular theme and the overlay can inherit from.

Bug: 21425951
Change-Id: I0967d0b4ddf12e9765bc321a7485a6dbdfef0b1e
parent 80cf2210
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
     limitations under the License.
-->
<resources>
    <style name="Theme.Micro" parent="Theme.Material.NoActionBar">
    <style name="Theme.MicroBase" parent="Theme.Material.NoActionBar">
        <item name="alertDialogTheme">@style/Theme.Micro.Dialog.Alert</item>
        <item name="alertDialogStyle">@style/AlertDialog.Micro</item>
        <item name="dialogTheme">@style/Theme.Micro.Dialog</item>
@@ -29,7 +29,10 @@
        <item name="windowOverscan">true</item>
    </style>

    <style name="Theme.Micro.Light" parent="Theme.Material.Light.NoActionBar">
    <style name="Theme.Micro" parent="Theme.MicroBase">
    </style>

    <style name="Theme.Micro.LightBase" parent="Theme.Material.Light.NoActionBar">
        <item name="alertDialogTheme">@style/Theme.Micro.Dialog.Alert</item>
        <item name="alertDialogStyle">@style/AlertDialog.Micro</item>
        <item name="dialogTheme">@style/Theme.Micro.Dialog</item>
@@ -44,7 +47,11 @@
        <item name="windowOverscan">true</item>
    </style>

    <style name="Theme.Micro.Dialog" parent="Theme.Material.Light.Dialog">
    <!-- Indirection needed for overlays to make sure there is a common base parent -->
    <style name="Theme.Micro.Light" parent="Theme.Micro.LightBase">
    </style>

    <style name="Theme.Micro.DialogBase" parent="Theme.Material.Light.Dialog">
        <item name="windowTitleStyle">@android:style/DialogWindowTitle.Micro</item>
        <item name="windowIsFloating">false</item>
        <item name="windowFullscreen">true</item>
@@ -54,6 +61,10 @@
        <item name="windowOverscan">true</item>
    </style>

    <!-- Indirection needed for overlays to make sure there is a common base parent -->
    <style name="Theme.Micro.Dialog" parent="Theme.Micro.DialogBase">
    </style>

    <style name="Theme.Micro.Dialog.Alert">
        <item name="windowTitleStyle">@style/DialogWindowTitle.Micro</item>
        <item name="alertDialogStyle">@style/AlertDialog.Micro</item>