diff --git a/app-k9mail/dependencies/releaseRuntimeClasspath.txt b/app-k9mail/dependencies/releaseRuntimeClasspath.txt index d41699639..ec7d02783 100644 --- a/app-k9mail/dependencies/releaseRuntimeClasspath.txt +++ b/app-k9mail/dependencies/releaseRuntimeClasspath.txt @@ -25,14 +25,12 @@ androidx.compose.foundation:foundation-layout:1.6.5 androidx.compose.foundation:foundation:1.6.5 androidx.compose.material3:material3-android:1.2.1 androidx.compose.material3:material3:1.2.1 -androidx.compose.material:material-android:1.6.5 androidx.compose.material:material-icons-core-android:1.6.5 androidx.compose.material:material-icons-core:1.6.5 androidx.compose.material:material-icons-extended-android:1.6.5 androidx.compose.material:material-icons-extended:1.6.5 androidx.compose.material:material-ripple-android:1.6.5 androidx.compose.material:material-ripple:1.6.5 -androidx.compose.material:material:1.6.5 androidx.compose.runtime:runtime-android:1.6.5 androidx.compose.runtime:runtime-saveable-android:1.6.5 androidx.compose.runtime:runtime-saveable:1.6.5 diff --git a/app-thunderbird/dependencies/releaseRuntimeClasspath.txt b/app-thunderbird/dependencies/releaseRuntimeClasspath.txt index d41699639..ec7d02783 100644 --- a/app-thunderbird/dependencies/releaseRuntimeClasspath.txt +++ b/app-thunderbird/dependencies/releaseRuntimeClasspath.txt @@ -25,14 +25,12 @@ androidx.compose.foundation:foundation-layout:1.6.5 androidx.compose.foundation:foundation:1.6.5 androidx.compose.material3:material3-android:1.2.1 androidx.compose.material3:material3:1.2.1 -androidx.compose.material:material-android:1.6.5 androidx.compose.material:material-icons-core-android:1.6.5 androidx.compose.material:material-icons-core:1.6.5 androidx.compose.material:material-icons-extended-android:1.6.5 androidx.compose.material:material-icons-extended:1.6.5 androidx.compose.material:material-ripple-android:1.6.5 androidx.compose.material:material-ripple:1.6.5 -androidx.compose.material:material:1.6.5 androidx.compose.runtime:runtime-android:1.6.5 androidx.compose.runtime:runtime-saveable-android:1.6.5 androidx.compose.runtime:runtime-saveable:1.6.5 diff --git a/core/ui/compose/theme/README.md b/core/ui/compose/theme/README.md deleted file mode 100644 index b7db51035..000000000 --- a/core/ui/compose/theme/README.md +++ /dev/null @@ -1,27 +0,0 @@ -## Core - UI - Compose - Theme - -This provides the `MainTheme` with dark/light variation, a wrapper for the Compose Material2 theme. It supports [CompositionLocal](https://developer.android.com/jetpack/compose/compositionlocal) changes to colors, typography, shapes and adds additionally elevations, sizes, spacings and images. - -To change Material2 related properties use `MainTheme` instead of `MaterialTheme`: - -- `MainTheme.colors`: Material2 colors -- `MainTheme.typography`: Material 2 typography -- `MainTheme.shapes`: Material2 shapes -- `MainTheme.spacings`: Spacings (quarter, half, default, oneHalf, double, triple, quadruple) while default is 8 dp. -- `MainTheme.sizes`: Sizes (smaller, small, medium, large, larger, huge, huger) -- `MainTheme.elevations`: Elevation, e.g. card -- `MainTheme.images`: Images used across the theme, e.g. logo - -Included are two derived themes for K-9 and Thunderbird look: `K9Theme` and `ThunderbirdTheme`. - -To render previews for both themes use `PreviewWithThemes`. This also includes a dark/light variation: - -``` -@Preview(showBackground = true) -@Composable -fun MyViewPreview() { - PreviewWithThemes { - MyView() - } -} -``` diff --git a/core/ui/compose/theme/build.gradle.kts b/core/ui/compose/theme/build.gradle.kts deleted file mode 100644 index 4aaafa4ea..000000000 --- a/core/ui/compose/theme/build.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id(ThunderbirdPlugins.Library.androidCompose) -} - -android { - namespace = "app.k9mail.core.ui.compose.theme" - resourcePrefix = "core_ui_theme_" -} - -dependencies { - api(projects.core.ui.compose.common) - implementation(libs.androidx.compose.material) - - implementation(libs.androidx.activity) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Elevations.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Elevations.kt deleted file mode 100644 index a609ad94f..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Elevations.kt +++ /dev/null @@ -1,15 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.dp - -@Immutable -data class Elevations( - val default: Dp = 0.dp, - val raised: Dp = 2.dp, - val card: Dp = 4.dp, -) - -internal val LocalElevations = staticCompositionLocalOf { Elevations() } diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Images.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Images.kt deleted file mode 100644 index 109f9422c..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Images.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.annotation.DrawableRes -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf - -@Immutable -data class Images( - @DrawableRes val logo: Int, -) - -internal val LocalImages = staticCompositionLocalOf { - error("No LocalImages defined") -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt deleted file mode 100644 index c14681151..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/K9Theme.kt +++ /dev/null @@ -1,39 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.runtime.Composable -import app.k9mail.core.ui.compose.theme.color.MaterialColor -import app.k9mail.core.ui.compose.theme.color.darkColors -import app.k9mail.core.ui.compose.theme.color.lightColors - -private val k9LightColorPalette = lightColors( - primary = MaterialColor.gray_800, - primaryVariant = MaterialColor.gray_700, - secondary = MaterialColor.pink_500, - secondaryVariant = MaterialColor.pink_300, - toolbar = MaterialColor.gray_100, -) - -private val k9DarkColorPalette = darkColors( - primary = MaterialColor.gray_100, - primaryVariant = MaterialColor.gray_400, - secondary = MaterialColor.pink_300, - secondaryVariant = MaterialColor.pink_500, -) - -@Composable -fun K9Theme( - darkTheme: Boolean = isSystemInDarkTheme(), - content: @Composable () -> Unit, -) { - val images = Images(logo = R.drawable.core_ui_theme_k9_logo) - - MainTheme( - lightColorPalette = k9LightColorPalette, - darkColorPalette = k9DarkColorPalette, - lightImages = images, - darkImages = images, - darkTheme = darkTheme, - content = content, - ) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/MainTheme.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/MainTheme.kt deleted file mode 100644 index 28023ac4d..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/MainTheme.kt +++ /dev/null @@ -1,93 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Typography -import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider -import androidx.compose.runtime.ReadOnlyComposable -import app.k9mail.core.ui.compose.theme.color.Colors -import app.k9mail.core.ui.compose.theme.color.LocalColors -import app.k9mail.core.ui.compose.theme.color.SetSystemBarsColor -import app.k9mail.core.ui.compose.theme.color.toMaterialColors - -@Composable -fun MainTheme( - lightColorPalette: Colors, - darkColorPalette: Colors, - lightImages: Images, - darkImages: Images, - darkTheme: Boolean = isSystemInDarkTheme(), - content: @Composable () -> Unit, -) { - val colors = if (darkTheme) { - darkColorPalette - } else { - lightColorPalette - } - val images = if (darkTheme) { - darkImages - } else { - lightImages - } - - SetSystemBarsColor( - darkTheme = darkTheme, - color = colors.toolbar, - ) - - val shapes = MainTheme.shapes - - CompositionLocalProvider( - LocalColors provides colors, - LocalElevations provides Elevations(), - LocalImages provides images, - LocalSizes provides Sizes(), - LocalSpacings provides Spacings(), - LocalShapes provides shapes, - ) { - MaterialTheme( - colors = colors.toMaterialColors(), - typography = typography, - shapes = shapes.toMaterialShapes(), - content = content, - ) - } -} - -object MainTheme { - val colors: Colors - @Composable - @ReadOnlyComposable - get() = LocalColors.current - - val typography: Typography - @Composable - @ReadOnlyComposable - get() = MaterialTheme.typography - - val shapes: Shapes - @Composable - @ReadOnlyComposable - get() = LocalShapes.current - - val spacings: Spacings - @Composable - @ReadOnlyComposable - get() = LocalSpacings.current - - val sizes: Sizes - @Composable - @ReadOnlyComposable - get() = LocalSizes.current - - val elevations: Elevations - @Composable - @ReadOnlyComposable - get() = LocalElevations.current - - val images: Images - @Composable - @ReadOnlyComposable - get() = LocalImages.current -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/PreviewWithThemes.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/PreviewWithThemes.kt deleted file mode 100644 index fe347b0fa..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/PreviewWithThemes.kt +++ /dev/null @@ -1,64 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.padding -import androidx.compose.material.Surface -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.unit.sp - -@Composable -fun PreviewWithThemes( - modifier: Modifier = Modifier, - content: @Composable () -> Unit, -) { - Column( - modifier = modifier, - ) { - PreviewHeader(themeName = "K9Theme") - K9Theme { - PreviewSurface(content = content) - } - K9Theme(darkTheme = true) { - PreviewSurface(content = content) - } - - PreviewHeader(themeName = "ThunderbirdTheme") - ThunderbirdTheme { - PreviewSurface(content = content) - } - ThunderbirdTheme(darkTheme = true) { - PreviewSurface(content = content) - } - } -} - -@Composable -private fun PreviewHeader( - themeName: String, -) { - Surface( - color = Color.Cyan, - ) { - Text( - text = themeName, - fontSize = 4.sp, - modifier = Modifier.padding( - start = MainTheme.spacings.half, - end = MainTheme.spacings.half, - ), - ) - } -} - -@Composable -private fun PreviewSurface( - content: @Composable () -> Unit, -) { - Surface( - color = MainTheme.colors.background, - content = content, - ) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Shapes.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Shapes.kt deleted file mode 100644 index 5435a8d2b..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Shapes.kt +++ /dev/null @@ -1,23 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.foundation.shape.CornerBasedShape -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf -import androidx.compose.ui.unit.dp -import androidx.compose.material.Shapes as MaterialShapes - -@Immutable -data class Shapes( - val small: CornerBasedShape = RoundedCornerShape(4.dp), - val medium: CornerBasedShape = RoundedCornerShape(4.dp), - val large: CornerBasedShape = RoundedCornerShape(0.dp), -) - -internal fun Shapes.toMaterialShapes() = MaterialShapes( - small = small, - medium = medium, - large = large, -) - -internal val LocalShapes = staticCompositionLocalOf { Shapes() } diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Sizes.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Sizes.kt deleted file mode 100644 index fc5b60c70..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Sizes.kt +++ /dev/null @@ -1,25 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.dp - -@Immutable -data class Sizes( - val smaller: Dp = 8.dp, - val small: Dp = 16.dp, - val medium: Dp = 32.dp, - val large: Dp = 64.dp, - val larger: Dp = 128.dp, - val huge: Dp = 256.dp, - val huger: Dp = 384.dp, - - val icon: Dp = 24.dp, - val largeIcon: Dp = 32.dp, - - val topBarHeight: Dp = 56.dp, - val bottomBarHeight: Dp = 56.dp, -) - -internal val LocalSizes = staticCompositionLocalOf { Sizes() } diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Spacings.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Spacings.kt deleted file mode 100644 index 8db26b1b9..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Spacings.kt +++ /dev/null @@ -1,21 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.dp - -@Immutable -data class Spacings( - val zero: Dp = 0.dp, - - val quarter: Dp = 2.dp, - val half: Dp = 4.dp, - val default: Dp = 8.dp, - val oneHalf: Dp = 12.dp, - val double: Dp = 16.dp, - val triple: Dp = 24.dp, - val quadruple: Dp = 32.dp, -) - -internal val LocalSpacings = staticCompositionLocalOf { Spacings() } diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt deleted file mode 100644 index 48a33971d..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/ThunderbirdTheme.kt +++ /dev/null @@ -1,38 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.runtime.Composable -import app.k9mail.core.ui.compose.theme.color.MaterialColor -import app.k9mail.core.ui.compose.theme.color.darkColors -import app.k9mail.core.ui.compose.theme.color.lightColors - -private val thunderbirdLightColorPalette = lightColors( - primary = MaterialColor.blue_800, - primaryVariant = MaterialColor.light_blue_700, - secondary = MaterialColor.pink_500, - secondaryVariant = MaterialColor.pink_300, -) - -private val thunderbirdDarkColorPalette = darkColors( - primary = MaterialColor.blue_200, - primaryVariant = MaterialColor.blue_400, - secondary = MaterialColor.pink_300, - secondaryVariant = MaterialColor.pink_500, -) - -@Composable -fun ThunderbirdTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - content: @Composable () -> Unit, -) { - val images = Images(logo = R.drawable.core_ui_theme_thunderbird_logo) - - MainTheme( - lightColorPalette = thunderbirdLightColorPalette, - darkColorPalette = thunderbirdDarkColorPalette, - lightImages = images, - darkImages = images, - darkTheme = darkTheme, - content = content, - ) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Typography.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Typography.kt deleted file mode 100644 index 55785e02f..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/Typography.kt +++ /dev/null @@ -1,123 +0,0 @@ -package app.k9mail.core.ui.compose.theme - -import androidx.compose.material.Typography -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.sp - -@Suppress("MagicNumber") -val typography = typographyFromDefaults( - h1 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Light, - fontSize = 96.sp, - letterSpacing = (-1.5).sp, - ), - h2 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Light, - fontSize = 60.sp, - letterSpacing = (-0.5).sp, - ), - h3 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 48.sp, - letterSpacing = 0.sp, - ), - h4 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 34.sp, - letterSpacing = 0.25.sp, - ), - h5 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 24.sp, - letterSpacing = 0.sp, - ), - h6 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Medium, - fontSize = 20.sp, - letterSpacing = 0.15.sp, - ), - subtitle1 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 16.sp, - letterSpacing = 0.15.sp, - ), - subtitle2 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Medium, - fontSize = 14.sp, - letterSpacing = 0.1.sp, - ), - body1 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 16.sp, - letterSpacing = 0.5.sp, - ), - body2 = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 14.sp, - letterSpacing = 0.25.sp, - ), - button = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Medium, - fontSize = 14.sp, - letterSpacing = 1.25.sp, - ), - caption = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 12.sp, - letterSpacing = 0.4.sp, - ), - overline = TextStyle( - fontFamily = FontFamily.Default, - fontWeight = FontWeight.Normal, - fontSize = 10.sp, - letterSpacing = 1.5.sp, - ), -) - -@Suppress("LongParameterList") -fun typographyFromDefaults( - h1: TextStyle, - h2: TextStyle, - h3: TextStyle, - h4: TextStyle, - h5: TextStyle, - h6: TextStyle, - subtitle1: TextStyle, - subtitle2: TextStyle, - body1: TextStyle, - body2: TextStyle, - button: TextStyle, - caption: TextStyle, - overline: TextStyle, -): Typography { - val defaults = Typography() - return Typography( - h1 = defaults.h1.merge(h1), - h2 = defaults.h2.merge(h2), - h3 = defaults.h3.merge(h3), - h4 = defaults.h4.merge(h4), - h5 = defaults.h5.merge(h5), - h6 = defaults.h6.merge(h6), - subtitle1 = defaults.subtitle1.merge(subtitle1), - subtitle2 = defaults.subtitle2.merge(subtitle2), - body1 = defaults.body1.merge(body1), - body2 = defaults.body2.merge(body2), - button = defaults.button.merge(button), - caption = defaults.caption.merge(caption), - overline = defaults.overline.merge(overline), - ) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt deleted file mode 100644 index 3bb7e0fdd..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/Colors.kt +++ /dev/null @@ -1,128 +0,0 @@ -package app.k9mail.core.ui.compose.theme.color - -import androidx.compose.runtime.Immutable -import androidx.compose.runtime.staticCompositionLocalOf -import androidx.compose.ui.graphics.Color -import androidx.compose.material.Colors as MaterialColors - -@Immutable -data class Colors( - val primary: Color, - val primaryVariant: Color, - val secondary: Color, - val secondaryVariant: Color, - val background: Color, - val surface: Color, - val success: Color, - val error: Color, - val warning: Color, - val info: Color, - val onPrimary: Color, - val onSecondary: Color, - val onBackground: Color, - val onBackgroundSecondary: Color, - val onSurface: Color, - val onMessage: Color, - val toolbar: Color, - val isLight: Boolean, -) - -@Suppress("LongParameterList") -internal fun lightColors( - primary: Color = MaterialColor.deep_purple_600, - primaryVariant: Color = MaterialColor.deep_purple_900, - secondary: Color = MaterialColor.cyan_600, - secondaryVariant: Color = MaterialColor.cyan_800, - background: Color = Color.White, - surface: Color = Color.White, - success: Color = MaterialColor.green_600, - error: Color = MaterialColor.red_600, - warning: Color = MaterialColor.orange_600, - info: Color = MaterialColor.yellow_600, - onPrimary: Color = Color.White, - onSecondary: Color = Color.Black, - onBackground: Color = Color.Black, - onBackgroundSecondary: Color = MaterialColor.gray_700, - onSurface: Color = Color.Black, - onMessage: Color = Color.White, - toolbar: Color = primary, -) = Colors( - primary = primary, - primaryVariant = primaryVariant, - secondary = secondary, - secondaryVariant = secondaryVariant, - background = background, - surface = surface, - success = success, - error = error, - warning = warning, - info = info, - onPrimary = onPrimary, - onSecondary = onSecondary, - onBackground = onBackground, - onBackgroundSecondary = onBackgroundSecondary, - onSurface = onSurface, - onMessage = onMessage, - toolbar = toolbar, - isLight = true, -) - -@Suppress("LongParameterList") -internal fun darkColors( - primary: Color = MaterialColor.deep_purple_200, - primaryVariant: Color = MaterialColor.deep_purple_50, - secondary: Color = MaterialColor.cyan_300, - secondaryVariant: Color = secondary, - background: Color = MaterialColor.gray_950, - surface: Color = MaterialColor.gray_950, - success: Color = MaterialColor.green_300, - error: Color = MaterialColor.red_300, - warning: Color = MaterialColor.orange_300, - info: Color = MaterialColor.yellow_300, - onPrimary: Color = Color.Black, - onSecondary: Color = Color.Black, - onBackground: Color = Color.White, - onBackgroundSecondary: Color = MaterialColor.gray_400, - onSurface: Color = Color.White, - onMessage: Color = Color.Black, - toolbar: Color = surface, -) = Colors( - primary = primary, - primaryVariant = primaryVariant, - secondary = secondary, - secondaryVariant = secondaryVariant, - background = background, - surface = surface, - success = success, - error = error, - warning = warning, - info = info, - onPrimary = onPrimary, - onSecondary = onSecondary, - onBackground = onBackground, - onBackgroundSecondary = onBackgroundSecondary, - onSurface = onSurface, - onMessage = onMessage, - toolbar = toolbar, - isLight = false, -) - -internal fun Colors.toMaterialColors(): MaterialColors { - return MaterialColors( - primary = primary, - primaryVariant = primaryVariant, - secondary = secondary, - secondaryVariant = secondaryVariant, - background = background, - surface = surface, - error = error, - onPrimary = onPrimary, - onSecondary = onSecondary, - onBackground = onBackground, - onSurface = onSurface, - onError = onMessage, - isLight = isLight, - ) -} - -internal val LocalColors = staticCompositionLocalOf { lightColors() } diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/MaterialColor.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/MaterialColor.kt deleted file mode 100644 index 31b3268fa..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/MaterialColor.kt +++ /dev/null @@ -1,218 +0,0 @@ -@file:Suppress("unused") - -package app.k9mail.core.ui.compose.theme.color - -import androidx.compose.ui.graphics.Color - -internal object MaterialColor { - - val red_50 = Color(color = 0xFFFFEBEE) - val red_100 = Color(color = 0xFFFFCDD2) - val red_200 = Color(color = 0xFFEF9A9A) - val red_300 = Color(color = 0xFFE57373) - val red_400 = Color(color = 0xFFEF5350) - val red_500 = Color(color = 0xFFF44336) - val red_600 = Color(color = 0xFFE53935) - val red_700 = Color(color = 0xFFD32F2F) - val red_800 = Color(color = 0xFFC62828) - val red_900 = Color(color = 0xFFB71C1C) - - val deep_purple_50 = Color(color = 0xFFEDE7F6) - val deep_purple_100 = Color(color = 0xFFD1C4E9) - val deep_purple_200 = Color(color = 0xFFB39DDB) - val deep_purple_300 = Color(color = 0xFF9575CD) - val deep_purple_400 = Color(color = 0xFF7E57C2) - val deep_purple_500 = Color(color = 0xFF673AB7) - val deep_purple_600 = Color(color = 0xFF5E35B1) - val deep_purple_700 = Color(color = 0xFF512DA8) - val deep_purple_800 = Color(color = 0xFF4527A0) - val deep_purple_900 = Color(color = 0xFF311B92) - - val light_blue_50 = Color(color = 0xFFE1F5FE) - val light_blue_100 = Color(color = 0xFFB3E5FC) - val light_blue_200 = Color(color = 0xFF81D4FA) - val light_blue_300 = Color(color = 0xFF4FC3F7) - val light_blue_400 = Color(color = 0xFF29B6F6) - val light_blue_500 = Color(color = 0xFF03A9F4) - val light_blue_600 = Color(color = 0xFF039BE5) - val light_blue_700 = Color(color = 0xFF0288D1) - val light_blue_800 = Color(color = 0xFF0277BD) - val light_blue_900 = Color(color = 0xFF01579B) - - val green_50 = Color(color = 0xFFE8F5E9) - val green_100 = Color(color = 0xFFC8E6C9) - val green_200 = Color(color = 0xFFA5D6A7) - val green_300 = Color(color = 0xFF81C784) - val green_400 = Color(color = 0xFF66BB6A) - val green_500 = Color(color = 0xFF4CAF50) - val green_600 = Color(color = 0xFF43A047) - val green_700 = Color(color = 0xFF388E3C) - val green_800 = Color(color = 0xFF2E7D32) - val green_900 = Color(color = 0xFF1B5E20) - - val yellow_50 = Color(color = 0xFFFFFDE7) - val yellow_100 = Color(color = 0xFFFFF9C4) - val yellow_200 = Color(color = 0xFFFFF59D) - val yellow_300 = Color(color = 0xFFFFF176) - val yellow_400 = Color(color = 0xFFFFEE58) - val yellow_500 = Color(color = 0xFFFFEB3B) - val yellow_600 = Color(color = 0xFFFDD835) - val yellow_700 = Color(color = 0xFFFBC02D) - val yellow_800 = Color(color = 0xFFF9A825) - val yellow_900 = Color(color = 0xFFF57F17) - - val deep_orange_50 = Color(color = 0xFFFBE9E7) - val deep_orange_100 = Color(color = 0xFFFFCCBC) - val deep_orange_200 = Color(color = 0xFFFFAB91) - val deep_orange_300 = Color(color = 0xFFFF8A65) - val deep_orange_400 = Color(color = 0xFFFF7043) - val deep_orange_500 = Color(color = 0xFFFF5722) - val deep_orange_600 = Color(color = 0xFFF4511E) - val deep_orange_700 = Color(color = 0xFFE64A19) - val deep_orange_800 = Color(color = 0xFFD84315) - val deep_orange_900 = Color(color = 0xFFBF360C) - - val blue_gray_50 = Color(color = 0xFFECEFF1) - val blue_gray_100 = Color(color = 0xFFCFD8DC) - val blue_gray_200 = Color(color = 0xFFB0BEC5) - val blue_gray_300 = Color(color = 0xFF90A4AE) - val blue_gray_400 = Color(color = 0xFF78909C) - val blue_gray_500 = Color(color = 0xFF607D8B) - val blue_gray_600 = Color(color = 0xFF546E7A) - val blue_gray_700 = Color(color = 0xFF455A64) - val blue_gray_800 = Color(color = 0xFF37474F) - val blue_gray_900 = Color(color = 0xFF263238) - - val pink_50 = Color(color = 0xFFFCE4EC) - val pink_100 = Color(color = 0xFFF8BBD0) - val pink_200 = Color(color = 0xFFF48FB1) - val pink_300 = Color(color = 0xFFF06292) - val pink_400 = Color(color = 0xFFEC407A) - val pink_500 = Color(color = 0xFFE91E63) - val pink_600 = Color(color = 0xFFD81B60) - val pink_700 = Color(color = 0xFFC2185B) - val pink_800 = Color(color = 0xFFAD1457) - val pink_900 = Color(color = 0xFF880E4F) - - val indigo_50 = Color(color = 0xFFE8EAF6) - val indigo_100 = Color(color = 0xFFC5CAE9) - val indigo_200 = Color(color = 0xFF9FA8DA) - val indigo_300 = Color(color = 0xFF7986CB) - val indigo_400 = Color(color = 0xFF5C6BC0) - val indigo_500 = Color(color = 0xFF3F51B5) - val indigo_600 = Color(color = 0xFF3949AB) - val indigo_700 = Color(color = 0xFF303F9F) - val indigo_800 = Color(color = 0xFF283593) - val indigo_900 = Color(color = 0xFF1A237E) - - val cyan_50 = Color(color = 0xFFE0F7FA) - val cyan_100 = Color(color = 0xFFB2EBF2) - val cyan_200 = Color(color = 0xFF80DEEA) - val cyan_300 = Color(color = 0xFF4DD0E1) - val cyan_400 = Color(color = 0xFF26C6DA) - val cyan_500 = Color(color = 0xFF00BCD4) - val cyan_600 = Color(color = 0xFF00ACC1) - val cyan_700 = Color(color = 0xFF0097A7) - val cyan_800 = Color(color = 0xFF00838F) - val cyan_900 = Color(color = 0xFF006064) - - val light_green_50 = Color(color = 0xFFF1F8E9) - val light_green_100 = Color(color = 0xFFDCEDC8) - val light_green_200 = Color(color = 0xFFC5E1A5) - val light_green_300 = Color(color = 0xFFAED581) - val light_green_400 = Color(color = 0xFF9CCC65) - val light_green_500 = Color(color = 0xFF8BC34A) - val light_green_600 = Color(color = 0xFF7CB342) - val light_green_700 = Color(color = 0xFF689F38) - val light_green_800 = Color(color = 0xFF558B2F) - val light_green_900 = Color(color = 0xFF33691E) - - val amber_50 = Color(color = 0xFFFFF8E1) - val amber_100 = Color(color = 0xFFFFECB3) - val amber_200 = Color(color = 0xFFFFE082) - val amber_300 = Color(color = 0xFFFFD54F) - val amber_400 = Color(color = 0xFFFFCA28) - val amber_500 = Color(color = 0xFFFFC107) - val amber_600 = Color(color = 0xFFFFB300) - val amber_700 = Color(color = 0xFFFFA000) - val amber_800 = Color(color = 0xFFFF8F00) - val amber_900 = Color(color = 0xFFFF6F00) - - val brown_50 = Color(color = 0xFFEFEBE9) - val brown_100 = Color(color = 0xFFD7CCC8) - val brown_200 = Color(color = 0xFFBCAAA4) - val brown_300 = Color(color = 0xFFA1887F) - val brown_400 = Color(color = 0xFF8D6E63) - val brown_500 = Color(color = 0xFF795548) - val brown_600 = Color(color = 0xFF6D4C41) - val brown_700 = Color(color = 0xFF5D4037) - val brown_800 = Color(color = 0xFF4E342E) - val brown_900 = Color(color = 0xFF3E2723) - - val purple_50 = Color(color = 0xFFF3E5F5) - val purple_100 = Color(color = 0xFFE1BEE7) - val purple_200 = Color(color = 0xFFCE93D8) - val purple_300 = Color(color = 0xFFBA68C8) - val purple_400 = Color(color = 0xFFAB47BC) - val purple_500 = Color(color = 0xFF9C27B0) - val purple_600 = Color(color = 0xFF8E24AA) - val purple_700 = Color(color = 0xFF7B1FA2) - val purple_800 = Color(color = 0xFF6A1B9A) - val purple_900 = Color(color = 0xFF4A148C) - - val blue_50 = Color(color = 0xFFE3F2FD) - val blue_100 = Color(color = 0xFFBBDEFB) - val blue_200 = Color(color = 0xFF90CAF9) - val blue_300 = Color(color = 0xFF64B5F6) - val blue_400 = Color(color = 0xFF42A5F5) - val blue_500 = Color(color = 0xFF2196F3) - val blue_600 = Color(color = 0xFF1E88E5) - val blue_700 = Color(color = 0xFF1976D2) - val blue_800 = Color(color = 0xFF1565C0) - val blue_900 = Color(color = 0xFF0D47A1) - - val teal_50 = Color(color = 0xFFE0F2F1) - val teal_100 = Color(color = 0xFFB2DFDB) - val teal_200 = Color(color = 0xFF80CBC4) - val teal_300 = Color(color = 0xFF4DB6AC) - val teal_400 = Color(color = 0xFF26A69A) - val teal_500 = Color(color = 0xFF009688) - val teal_600 = Color(color = 0xFF00897B) - val teal_700 = Color(color = 0xFF00796B) - val teal_800 = Color(color = 0xFF00695C) - val teal_900 = Color(color = 0xFF004D40) - - val lime_50 = Color(color = 0xFFF9FBE7) - val lime_100 = Color(color = 0xFFF0F4C3) - val lime_200 = Color(color = 0xFFE6EE9C) - val lime_300 = Color(color = 0xFFDCE775) - val lime_400 = Color(color = 0xFFD4E157) - val lime_500 = Color(color = 0xFFCDDC39) - val lime_600 = Color(color = 0xFFC0CA33) - val lime_700 = Color(color = 0xFFAFB42B) - val lime_800 = Color(color = 0xFF9E9D24) - val lime_900 = Color(color = 0xFF827717) - - val orange_50 = Color(color = 0xFFFFF3E0) - val orange_100 = Color(color = 0xFFFFE0B2) - val orange_200 = Color(color = 0xFFFFCC80) - val orange_300 = Color(color = 0xFFFFB74D) - val orange_400 = Color(color = 0xFFFFA726) - val orange_500 = Color(color = 0xFFFF9800) - val orange_600 = Color(color = 0xFFFB8C00) - val orange_700 = Color(color = 0xFFF57C00) - val orange_800 = Color(color = 0xFFEF6C00) - val orange_900 = Color(color = 0xFFE65100) - - val gray_50 = Color(color = 0xFFFAFAFA) - val gray_100 = Color(color = 0xFFF5F5F5) - val gray_200 = Color(color = 0xFFEEEEEE) - val gray_300 = Color(color = 0xFFE0E0E0) - val gray_400 = Color(color = 0xFFBDBDBD) - val gray_500 = Color(color = 0xFF9E9E9E) - val gray_600 = Color(color = 0xFF757575) - val gray_700 = Color(color = 0xFF616161) - val gray_800 = Color(color = 0xFF424242) - val gray_900 = Color(color = 0xFF212121) - val gray_950 = Color(color = 0xFF121212) -} diff --git a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/SystemBarsColor.kt b/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/SystemBarsColor.kt deleted file mode 100644 index 7c9aa4e79..000000000 --- a/core/ui/compose/theme/src/main/java/app/k9mail/core/ui/compose/theme/color/SystemBarsColor.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.k9mail.core.ui.compose.theme.color - -import android.app.Activity -import androidx.compose.runtime.Composable -import androidx.compose.runtime.SideEffect -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.toArgb -import androidx.compose.ui.platform.LocalView -import androidx.core.view.WindowCompat - -@Composable -fun SetSystemBarsColor( - darkTheme: Boolean, - color: Color = Color.Transparent, -) { - val view = LocalView.current - if (!view.isInEditMode) { - SideEffect { - val window = (view.context as Activity).window - window.statusBarColor = color.toArgb() - WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme - } - } -} diff --git a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml b/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml deleted file mode 100644 index 2637f9700..000000000 --- a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_k9_logo.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_thunderbird_logo.xml b/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_thunderbird_logo.xml deleted file mode 100644 index 24f06c976..000000000 --- a/core/ui/compose/theme/src/main/res/drawable/core_ui_theme_thunderbird_logo.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d6e773b71..463ee5f8c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -121,7 +121,6 @@ androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "a androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "androidxBiometric" } androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidxComposeBom" } androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" } -androidx-compose-material = { module = "androidx.compose.material:material" } androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } androidx-compose-material3 = { module = "androidx.compose.material3:material3" } androidx-compose-material3-windowSizeClass = { module = "androidx.compose.material3:material3-window-size-class" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 099d7a533..678e7a8cf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -76,7 +76,6 @@ include( ":core:android:testing", ":core:ui:compose:common", ":core:ui:compose:designsystem", - ":core:ui:compose:theme", ":core:ui:compose:theme2:common", ":core:ui:compose:theme2:k9mail", ":core:ui:compose:theme2:thunderbird",