0
0
mirror of https://github.com/thunderbird/thunderbird-android.git synced 2024-09-19 19:52:14 +02:00

Add Material 3 common legacy theme2

This commit is contained in:
Wolf-Martell Montwé 2024-03-07 15:38:32 +01:00
parent 05940f9213
commit 666fff086f
No known key found for this signature in database
GPG Key ID: 6D45B21512ACBF72
10 changed files with 74 additions and 29 deletions

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.K9.Startup" parent="Theme.K9.DayNight" />
</resources>

View File

@ -5,12 +5,7 @@
<item name="android:windowBackground">@android:color/black</item>
</style>
<!-- Empty base themes that can be easily replaced by RRO (Runtime Resource Overlay) themes -->
<style name="Theme.K9.Light.Base" parent="Theme.Material3.Light.NoActionBar" />
<style name="Theme.K9.Dark.Base" parent="Theme.Material3.Dark.NoActionBar" />
<style name="Theme.K9.Light.Common" parent="Theme.K9.Light.Base">
<!-- Colors -->
<style name="Theme.K9.Light" parent="Theme2.Main.Light">
<item name="colorPrimary">@color/k9_primary_040</item>
<item name="colorOnPrimary">@color/k9_primary_100</item>
<item name="colorPrimaryInverse">@color/k9_primary_080</item>
@ -58,7 +53,6 @@
<item name="colorErrorContainer">@color/k9_error_090</item>
<item name="colorOnErrorContainer">@color/k9_error_010</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeCloseDrawable">@drawable/ic_close</item>
<item name="actionBarPopupTheme">@style/Widget.App.ActionMode.PopupMenu</item>
<item name="toolbarStyle">@style/Widget.App.Toolbar</item>
@ -106,17 +100,7 @@
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Light</item>
</style>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<item name="android:statusBarColor">?attr/colorSurfaceInverse</item>
<item name="android:navigationBarColor">?attr/colorSurfaceInverse</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:navigationBarColor">?attr/colorSurfaceContainer</item>
</style>
<style name="Theme.K9.Dark.Common" parent="Theme.K9.Dark.Base">
<style name="Theme.K9.Dark" parent="Theme2.Main.Dark">
<!-- Colors -->
<item name="colorPrimary">@color/k9_primary_080</item>
<item name="colorOnPrimary">@color/k9_primary_020</item>
@ -165,7 +149,6 @@
<item name="colorErrorContainer">@color/k9_error_030</item>
<item name="colorOnErrorContainer">@color/k9_error_090</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeCloseDrawable">@drawable/ic_close</item>
<item name="actionBarPopupTheme">@style/Widget.App.ActionMode.PopupMenu</item>
<item name="toolbarStyle">@style/Widget.App.Toolbar</item>

View File

@ -7,6 +7,5 @@ android {
}
dependencies {
// TODO Remove this dependency once the legacy theme is available
api(libs.android.material)
api(projects.core.ui.legacy.theme2.common)
}

View File

@ -0,0 +1,12 @@
## Core - UI - Legacy - Theme 2
Legacy Theme 2 represents a Material 3 adaptation of the legacy application theme. It follows the design principles of Material 3, while ensuring compatibility with the existing implementation.
It is available in two variants:
- [K9Mail](./k9mail) - The theme for the K-9 Mail app.
- [Thunderbird](./thunderbird) - The theme for the Thunderbird app.
It's not suggested to use the contained modules for new features. Use the Composable UI along our [theme 2](../../compose/theme2) and [design system](../../compose/designsystem) instead.
This is only maintained for the purpose of supporting the existing implementation.

View File

@ -0,0 +1,11 @@
plugins {
id(ThunderbirdPlugins.Library.android)
}
android {
namespace = "app.k9mail.core.ui.legacy.theme2.common"
}
dependencies {
api(libs.android.material)
}

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<style name="Theme2.Main.Light" parent="Theme2.Main.Light.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:navigationBarColor">?attr/colorSurfaceInverse</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<style name="Theme2.Main.Dark" parent="Theme2.Main.Dark.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:windowLightStatusBar">false</item>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<style name="Theme2.Main.Light" parent="Theme2.Main.Light.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:windowLightStatusBar">true</item>
@ -9,7 +9,7 @@
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<style name="Theme2.Main.Dark" parent="Theme2.Main.Dark.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:windowLightStatusBar">false</item>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme2.Main.Startup" parent="Theme2.Main.DayNight" />
</resources>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Empty base themes that can be easily replaced by RRO (Runtime Resource Overlay) themes -->
<style name="Theme2.Main.Light.Base" parent="Theme.Material3.Light.NoActionBar" />
<style name="Theme2.Main.Dark.Base" parent="Theme.Material3.Dark.NoActionBar" />
<style name="Theme2.Main.DayNight.Base" parent="Theme.Material3.DayNight.NoActionBar" />
<!-- Common main themes -->
<style name="Theme2.Main.Light.Common" parent="Theme2.Main.Light.Base">
<!-- Draw action mode above content -->
<item name="windowActionModeOverlay">true</item>
</style>
<style name="Theme2.Main.Dark.Common" parent="Theme2.Main.Dark.Base">
<!-- Draw action mode above content -->
<item name="windowActionModeOverlay">true</item>
</style>
<style name="Theme2.Main.DayNight.Common" parent="Theme2.Main.Light.Base" />
<!-- Main themes -->
<style name="Theme2.Main.Light" parent="Theme2.Main.Light.Common">
<item name="android:statusBarColor">?attr/colorSurfaceInverse</item>
<item name="android:navigationBarColor">?attr/colorSurfaceInverse</item>
</style>
<style name="Theme2.Main.Dark" parent="Theme2.Main.Dark.Common">
<item name="android:statusBarColor">?attr/colorSurfaceContainer</item>
<item name="android:navigationBarColor">?attr/colorSurfaceContainer</item>
</style>
<style name="Theme2.Main.DayNight" parent="Theme2.Main.Light" />
<style name="Theme2.Main.Startup" parent="Theme2.Main.Dark">
<item name="android:windowBackground">@android:color/black</item>
</style>
</resources>

View File

@ -82,6 +82,7 @@ include(
":core:ui:compose:theme2:thunderbird",
":core:ui:compose:testing",
":core:ui:legacy:designsystem",
":core:ui:legacy:theme2:common",
)
include(