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:
parent
d28b0cda2d
commit
38a2d3e619
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
3
core/ui/theme/README.md
Normal 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.
|
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id(ThunderbirdPlugins.Library.android)
|
||||
id(ThunderbirdPlugins.Library.androidCompose)
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -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,
|
||||
)
|
||||
}
|
@ -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?)
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user