From 5670de0ab20b3c6a840f2a1861e53ea8f11b0af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Fri, 1 Dec 2023 14:31:01 +0100 Subject: [PATCH] Add theme2 for K9Mail --- core/ui/compose/theme2/k9mail/README.md | 12 ++ .../ui/compose/theme2/k9mail/build.gradle.kts | 12 ++ .../ui/compose/theme2/k9mail/K9MailTheme2.kt | 48 ++++++ .../ui/compose/theme2/k9mail/ThemeColors.kt | 89 +++++++++++ .../theme2/k9mail/TonalColorPalette.kt | 100 ++++++++++++ .../drawable/core_ui_theme2_k9mail_logo.xml | 151 ++++++++++++++++++ 6 files changed, 412 insertions(+) create mode 100644 core/ui/compose/theme2/k9mail/README.md create mode 100644 core/ui/compose/theme2/k9mail/build.gradle.kts create mode 100644 core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/K9MailTheme2.kt create mode 100644 core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/ThemeColors.kt create mode 100644 core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/TonalColorPalette.kt create mode 100644 core/ui/compose/theme2/k9mail/src/main/res/drawable/core_ui_theme2_k9mail_logo.xml diff --git a/core/ui/compose/theme2/k9mail/README.md b/core/ui/compose/theme2/k9mail/README.md new file mode 100644 index 000000000..c0c25acb2 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/README.md @@ -0,0 +1,12 @@ +## Core - UI - Compose - Theme2 - K9Mail + +This provides the `K9MailTheme2` composable, that's setting up the `MainTheme` with K-9 Mail specific colors, typography, shapes, elevations, sizes, spacings and images. + +```kotlin +@Composable +fun MyComposable() { + K9MailTheme2 { + // Your app content + } +} +``` diff --git a/core/ui/compose/theme2/k9mail/build.gradle.kts b/core/ui/compose/theme2/k9mail/build.gradle.kts new file mode 100644 index 000000000..a81554730 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id(ThunderbirdPlugins.Library.androidCompose) +} + +android { + namespace = "app.k9mail.core.ui.compose.theme2.k9mail" + resourcePrefix = "core_ui_theme2_k9mail" +} + +dependencies { + api(projects.core.ui.compose.theme2.common) +} diff --git a/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/K9MailTheme2.kt b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/K9MailTheme2.kt new file mode 100644 index 000000000..f9c8d6b51 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/K9MailTheme2.kt @@ -0,0 +1,48 @@ +package app.k9mail.core.ui.compose.theme2.k9mail + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.runtime.Composable +import app.k9mail.core.ui.compose.theme2.MainTheme +import app.k9mail.core.ui.compose.theme2.ThemeColorSchemeVariants +import app.k9mail.core.ui.compose.theme2.ThemeConfig +import app.k9mail.core.ui.compose.theme2.ThemeImageVariants +import app.k9mail.core.ui.compose.theme2.ThemeImages +import app.k9mail.core.ui.compose.theme2.default.defaultThemeElevations +import app.k9mail.core.ui.compose.theme2.default.defaultThemeShapes +import app.k9mail.core.ui.compose.theme2.default.defaultThemeSizes +import app.k9mail.core.ui.compose.theme2.default.defaultThemeSpacings +import app.k9mail.core.ui.compose.theme2.default.defaultTypography + +@Composable +fun K9MailTheme2( + darkTheme: Boolean = isSystemInDarkTheme(), + dynamicColor: Boolean = false, + content: @Composable () -> Unit, +) { + val images = ThemeImages( + logo = R.drawable.core_ui_theme2_k9mail_logo, + ) + + val themeConfig = ThemeConfig( + colors = ThemeColorSchemeVariants( + dark = darkThemeColorScheme, + light = lightThemeColorScheme, + ), + elevations = defaultThemeElevations, + images = ThemeImageVariants( + light = images, + dark = images, + ), + sizes = defaultThemeSizes, + spacings = defaultThemeSpacings, + shapes = defaultThemeShapes, + typography = defaultTypography, + ) + + MainTheme( + themeConfig = themeConfig, + darkTheme = darkTheme, + dynamicColor = dynamicColor, + content = content, + ) +} diff --git a/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/ThemeColors.kt b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/ThemeColors.kt new file mode 100644 index 000000000..87cb12a34 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/ThemeColors.kt @@ -0,0 +1,89 @@ +package app.k9mail.core.ui.compose.theme2.k9mail + +import app.k9mail.core.ui.compose.theme2.ThemeColorScheme + +internal val darkThemeColorScheme = ThemeColorScheme( + primary = TonalColorPalette.primary080, + onPrimary = TonalColorPalette.primary020, + primaryContainer = TonalColorPalette.primary030, + onPrimaryContainer = TonalColorPalette.primary090, + + secondary = TonalColorPalette.secondary080, + onSecondary = TonalColorPalette.secondary020, + secondaryContainer = TonalColorPalette.secondary030, + onSecondaryContainer = TonalColorPalette.secondary090, + + tertiary = TonalColorPalette.tertiary080, + onTertiary = TonalColorPalette.tertiary020, + tertiaryContainer = TonalColorPalette.tertiary030, + onTertiaryContainer = TonalColorPalette.tertiary090, + + error = TonalColorPalette.error080, + onError = TonalColorPalette.error020, + errorContainer = TonalColorPalette.error030, + onErrorContainer = TonalColorPalette.error090, + + surface = TonalColorPalette.neutral006, + onSurface = TonalColorPalette.neutral090, + onSurfaceVariant = TonalColorPalette.neutralVariant080, + surfaceContainerLowest = TonalColorPalette.neutral004, + surfaceContainerLow = TonalColorPalette.neutral010, + surfaceContainer = TonalColorPalette.neutral012, + surfaceContainerHigh = TonalColorPalette.neutral017, + surfaceContainerHighest = TonalColorPalette.neutral022, + + inverseSurface = TonalColorPalette.neutral090, + inverseOnSurface = TonalColorPalette.neutral020, + inversePrimary = TonalColorPalette.primary040, + + outline = TonalColorPalette.neutralVariant060, + outlineVariant = TonalColorPalette.neutralVariant030, + + surfaceBright = TonalColorPalette.neutral024, + surfaceDim = TonalColorPalette.neutral006, + + scrim = TonalColorPalette.neutral000, +) + +internal val lightThemeColorScheme = ThemeColorScheme( + primary = TonalColorPalette.primary040, + onPrimary = TonalColorPalette.primary100, + primaryContainer = TonalColorPalette.primary090, + onPrimaryContainer = TonalColorPalette.primary010, + + secondary = TonalColorPalette.secondary040, + onSecondary = TonalColorPalette.secondary100, + secondaryContainer = TonalColorPalette.secondary090, + onSecondaryContainer = TonalColorPalette.secondary010, + + tertiary = TonalColorPalette.tertiary040, + onTertiary = TonalColorPalette.tertiary100, + tertiaryContainer = TonalColorPalette.tertiary090, + onTertiaryContainer = TonalColorPalette.tertiary010, + + error = TonalColorPalette.error040, + onError = TonalColorPalette.error100, + errorContainer = TonalColorPalette.error090, + onErrorContainer = TonalColorPalette.error010, + + surface = TonalColorPalette.neutral098, + onSurface = TonalColorPalette.neutral010, + onSurfaceVariant = TonalColorPalette.neutralVariant030, + surfaceContainerLowest = TonalColorPalette.neutral100, + surfaceContainerLow = TonalColorPalette.neutral096, + surfaceContainer = TonalColorPalette.neutral094, + surfaceContainerHigh = TonalColorPalette.neutral092, + surfaceContainerHighest = TonalColorPalette.neutral090, + + inverseSurface = TonalColorPalette.neutral020, + inverseOnSurface = TonalColorPalette.neutral095, + inversePrimary = TonalColorPalette.primary080, + + outline = TonalColorPalette.neutralVariant050, + outlineVariant = TonalColorPalette.neutralVariant080, + + surfaceBright = TonalColorPalette.neutral098, + surfaceDim = TonalColorPalette.neutral087, + + scrim = TonalColorPalette.neutral000, +) diff --git a/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/TonalColorPalette.kt b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/TonalColorPalette.kt new file mode 100644 index 000000000..dc9438400 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/src/main/kotlin/app/k9mail/core/ui/compose/theme2/k9mail/TonalColorPalette.kt @@ -0,0 +1,100 @@ +package app.k9mail.core.ui.compose.theme2.k9mail + +import androidx.compose.ui.graphics.Color + +internal object TonalColorPalette { + val primary010 = Color(color = 0xFF3F001B) + val primary020 = Color(color = 0xFF5E112F) + val primary030 = Color(color = 0xFF7B2946) + val primary000 = Color(color = 0xFF000000) + val primary040 = Color(color = 0xFF99405D) + val primary050 = Color(color = 0xFFB75876) + val primary060 = Color(color = 0xFFD6718F) + val primary070 = Color(color = 0xFFF68BAA) + val primary080 = Color(color = 0xFFFFB1C5) + val primary090 = Color(color = 0xFFFFD9E1) + val primary095 = Color(color = 0xFFFFECEF) + val primary099 = Color(color = 0xFFFFFBFF) + val primary100 = Color(color = 0xFFFFFFFF) + + val secondary000 = Color(color = 0xFF000000) + val secondary010 = Color(color = 0xFF2B151B) + val secondary020 = Color(color = 0xFF422930) + val secondary030 = Color(color = 0xFF5B3F46) + val secondary040 = Color(color = 0xFF74565E) + val secondary050 = Color(color = 0xFF8F6F76) + val secondary060 = Color(color = 0xFFAA8890) + val secondary070 = Color(color = 0xFFC6A2AA) + val secondary080 = Color(color = 0xFFE3BDC5) + val secondary090 = Color(color = 0xFFFFD9E1) + val secondary095 = Color(color = 0xFFFFECEF) + val secondary099 = Color(color = 0xFFFFFBFF) + val secondary100 = Color(color = 0xFFFFFFFF) + + val tertiary000 = Color(color = 0xFF000000) + val tertiary010 = Color(color = 0xFF260059) + val tertiary020 = Color(color = 0xFF3C1D70) + val tertiary030 = Color(color = 0xFF533688) + val tertiary040 = Color(color = 0xFF6B4EA2) + val tertiary050 = Color(color = 0xFF8567BD) + val tertiary060 = Color(color = 0xFF9F81D9) + val tertiary070 = Color(color = 0xFFBA9CF6) + val tertiary080 = Color(color = 0xFFD3BBFF) + val tertiary090 = Color(color = 0xFFEBDDFF) + val tertiary095 = Color(color = 0xFFF7EDFF) + val tertiary099 = Color(color = 0xFFFFFBFF) + val tertiary100 = Color(color = 0xFFFFFFFF) + + val error000 = Color(color = 0xFF000000) + val error010 = Color(color = 0xFF410002) + val error020 = Color(color = 0xFF690005) + val error030 = Color(color = 0xFF93000A) + val error040 = Color(color = 0xFFBA1A1A) + val error050 = Color(color = 0xFFDE3730) + val error060 = Color(color = 0xFFFF5449) + val error070 = Color(color = 0xFFFF897D) + val error080 = Color(color = 0xFFFFB4AB) + val error090 = Color(color = 0xFFFFDAD6) + val error095 = Color(color = 0xFFFFEDEA) + val error099 = Color(color = 0xFFFFFBFF) + val error100 = Color(color = 0xFFFFFFFF) + + val neutral000 = Color(color = 0xFF000000) + val neutral004 = Color(color = 0xFF120D0E) + val neutral006 = Color(color = 0xFF171213) + val neutral010 = Color(color = 0xFF201A1B) + val neutral012 = Color(color = 0xFF241E1F) + val neutral017 = Color(color = 0xFF2F282A) + val neutral020 = Color(color = 0xFF352F30) + val neutral022 = Color(color = 0xFF3A3334) + val neutral024 = Color(color = 0xFF3E3739) + val neutral030 = Color(color = 0xFF4C4546) + val neutral040 = Color(color = 0xFF655C5E) + val neutral050 = Color(color = 0xFF7E7576) + val neutral060 = Color(color = 0xFF988E90) + val neutral070 = Color(color = 0xFFB3A9AA) + val neutral080 = Color(color = 0xFFCFC4C5) + val neutral087 = Color(color = 0xFFE3D7D8) + val neutral090 = Color(color = 0xFFECE0E1) + val neutral092 = Color(color = 0xFFF1E5E6) + val neutral094 = Color(color = 0xFFF7EBEC) + val neutral095 = Color(color = 0xFFFAEEEF) + val neutral096 = Color(color = 0xFFFDF1F2) + val neutral098 = Color(color = 0xFFFFF8F8) + val neutral099 = Color(color = 0xFFFFFBFF) + val neutral100 = Color(color = 0xFFFFFFFF) + + val neutralVariant000 = Color(color = 0xFF000000) + val neutralVariant010 = Color(color = 0xFF24191B) + val neutralVariant020 = Color(color = 0xFF3A2D30) + val neutralVariant030 = Color(color = 0xFF514346) + val neutralVariant040 = Color(color = 0xFF6A5A5E) + val neutralVariant050 = Color(color = 0xFF847376) + val neutralVariant060 = Color(color = 0xFF9E8C90) + val neutralVariant070 = Color(color = 0xFFBAA7AA) + val neutralVariant080 = Color(color = 0xFFD6C2C5) + val neutralVariant090 = Color(color = 0xFFF3DDE1) + val neutralVariant095 = Color(color = 0xFFFFECEF) + val neutralVariant099 = Color(color = 0xFFFFFBFF) + val neutralVariant100 = Color(color = 0xFFFFFFFF) +} diff --git a/core/ui/compose/theme2/k9mail/src/main/res/drawable/core_ui_theme2_k9mail_logo.xml b/core/ui/compose/theme2/k9mail/src/main/res/drawable/core_ui_theme2_k9mail_logo.xml new file mode 100644 index 000000000..2637f9700 --- /dev/null +++ b/core/ui/compose/theme2/k9mail/src/main/res/drawable/core_ui_theme2_k9mail_logo.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + +