Implement Edge-to-edge with newer APIs

The implementation adds a "Base" family styles, making creating themes across multiple API versions more clearer and easier.
This commit is contained in:
RikkaW
2020-10-22 16:11:07 +08:00
committed by John Wu
parent 0064b01ae0
commit c93ada03c7
10 changed files with 168 additions and 28 deletions
+3 -14
View File
@@ -1,20 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashThemeBase" parent="android:Theme.DeviceDefault.NoActionBar">
<item name="android:windowBackground">@drawable/ic_splash_activity</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="SplashTheme" parent="Theme.Splash.Light" />
<style name="SplashTheme" parent="SplashThemeBase" />
<style name="Foundation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowBackground">?colorSurface</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<!--This should be overridden in v21 for transparency, etc-->
<style name="Foundation.Compat" />
<style name="Foundation" parent="Theme.Foundation.Light" />
<!--region Do not remove-->
<style name="Empty" />
@@ -28,7 +17,7 @@
<item name="android:textStyle">bold</item>
</style>
<style name="Foundation.Default" parent="Foundation.Compat">
<style name="Foundation.Default">
<item name="android:includeFontPadding">false</item>
<item name="actionBarSize">@dimen/internal_action_bar_size</item>
<item name="popupMenuStyle">@style/Foundation.PopupMenu</item>
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.V17.Theme.Foundation.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">?colorSurface</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="Base.V17.Theme.Foundation" parent="Theme.MaterialComponents.NoActionBar">
<item name="android:windowBackground">?colorSurface</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="Theme.Foundation.Light" parent="Base.V17.Theme.Foundation.Light" />
<style name="Theme.Foundation" parent="Base.V17.Theme.Foundation" />
<style name="Base.V17.Theme.Splash.Light" parent="android:Theme.DeviceDefault.Light.NoActionBar">
<item name="android:windowBackground">@drawable/ic_splash_activity</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="Base.V17.Theme.Splash" parent="android:Theme.DeviceDefault.NoActionBar">
<item name="android:windowBackground">@drawable/ic_splash_activity</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="Theme.Splash.Light" parent="Base.V17.Theme.Splash.Light" />
<style name="Theme.Splash" parent="Base.V17.Theme.Splash" />
</resources>