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

Move FeatureThemeProvider to :core:ui:theme:api module

This commit is contained in:
Wolf-Martell Montwé 2024-09-06 10:58:53 +02:00
parent d28b0cda2d
commit 38a2d3e619
No known key found for this signature in database
GPG Key ID: 6D45B21512ACBF72
9 changed files with 24 additions and 20 deletions

View File

@ -4,9 +4,9 @@ import app.k9mail.auth.K9OAuthConfigurationFactory
import app.k9mail.core.common.oauth.OAuthConfigurationFactory
import app.k9mail.core.common.provider.AppNameProvider
import app.k9mail.core.featureflag.FeatureFlagFactory
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
import app.k9mail.core.ui.theme.api.ThemeProvider
import app.k9mail.dev.developmentModuleAdditions
import app.k9mail.feature.launcher.FeatureLauncherExternalContract.FeatureThemeProvider
import app.k9mail.feature.widget.shortcut.LauncherShortcutActivity
import app.k9mail.featureflag.K9FeatureFlagFactory
import app.k9mail.provider.K9AppNameProvider

View File

@ -2,9 +2,9 @@ package app.k9mail.provider
import androidx.compose.runtime.Composable
import app.k9mail.core.ui.compose.theme2.k9mail.K9MailTheme2
import app.k9mail.feature.launcher.FeatureLauncherExternalContract
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
class K9FeatureThemeProvider : FeatureLauncherExternalContract.FeatureThemeProvider {
class K9FeatureThemeProvider : FeatureThemeProvider {
@Composable
override fun WithTheme(content: @Composable () -> Unit) {
K9MailTheme2 {

View File

@ -3,8 +3,8 @@ package net.thunderbird.android
import app.k9mail.core.common.oauth.OAuthConfigurationFactory
import app.k9mail.core.common.provider.AppNameProvider
import app.k9mail.core.featureflag.FeatureFlagFactory
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
import app.k9mail.core.ui.theme.api.ThemeProvider
import app.k9mail.feature.launcher.FeatureLauncherExternalContract.FeatureThemeProvider
import app.k9mail.feature.widget.shortcut.LauncherShortcutActivity
import com.fsck.k9.AppConfig
import com.fsck.k9.activity.MessageCompose

View File

@ -2,9 +2,9 @@ package net.thunderbird.android.provider
import androidx.compose.runtime.Composable
import app.k9mail.core.ui.compose.theme2.thunderbird.ThunderbirdTheme2
import app.k9mail.feature.launcher.FeatureLauncherExternalContract
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
class TbFeatureThemeProvider : FeatureLauncherExternalContract.FeatureThemeProvider {
class TbFeatureThemeProvider : FeatureThemeProvider {
@Composable
override fun WithTheme(content: @Composable () -> Unit) {
ThunderbirdTheme2 {

3
core/ui/theme/README.md Normal file
View File

@ -0,0 +1,3 @@
## Theme
The app theme is provided by the `ThemeProvider` found in the `api` module and should be implemented in the app modules with the required app themes from the `core:compose` and `core:legacy` modules.

View File

@ -1,5 +1,5 @@
plugins {
id(ThunderbirdPlugins.Library.android)
id(ThunderbirdPlugins.Library.androidCompose)
}
android {

View File

@ -0,0 +1,13 @@
package app.k9mail.core.ui.theme.api
import androidx.compose.runtime.Composable
/**
* Provides the compose theme for a feature.
*/
fun interface FeatureThemeProvider {
@Composable
fun WithTheme(
content: @Composable () -> Unit,
)
}

View File

@ -1,22 +1,10 @@
package app.k9mail.feature.launcher
import androidx.compose.runtime.Composable
/**
* Contract defining the external functionality of the feature launcher to be provided by the host application.
*/
interface FeatureLauncherExternalContract {
/**
* Provides the theme for the feature.
*/
fun interface FeatureThemeProvider {
@Composable
fun WithTheme(
content: @Composable () -> Unit,
)
}
fun interface AccountSetupFinishedLauncher {
fun launch(accountUuid: String?)
}

View File

@ -7,7 +7,7 @@ import androidx.compose.ui.Modifier
import androidx.navigation.compose.rememberNavController
import app.k9mail.core.ui.compose.common.activity.LocalActivity
import app.k9mail.core.ui.compose.designsystem.atom.Surface
import app.k9mail.feature.launcher.FeatureLauncherExternalContract.FeatureThemeProvider
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
import app.k9mail.feature.launcher.navigation.FeatureLauncherNavHost
import org.koin.compose.koinInject