Add theme2 for K9Mail

This commit is contained in:
Wolf-Martell Montwé 2023-12-01 14:31:01 +01:00
parent 237c753b02
commit 5670de0ab2
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
6 changed files with 412 additions and 0 deletions

View file

@ -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
}
}
```

View file

@ -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)
}

View file

@ -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,
)
}

View file

@ -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,
)

View file

@ -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)
}

View file

@ -0,0 +1,151 @@
<!-- TODO: Remove this copy of the app icon and use the app icon instead -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="72dp"
android:height="72dp"
android:viewportWidth="192"
android:viewportHeight="192">
<path
android:fillColor="#607d8b"
android:fillType="evenOdd"
android:pathData="m32,116v12l25.61,38c2.07,3.59 5.94,6 10.39,6h56c4.46,0 8.32,-2.41 10.39,-6h0.01l25.6,-38v-12z"
android:strokeWidth="0.376"
android:strokeColor="#00000000"
android:strokeLineCap="butt"
android:strokeLineJoin="miter" />
<path
android:fillColor="#263238"
android:fillType="nonZero"
android:pathData="M64,16h8v28h-8z"
android:strokeWidth="5.99999952"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#263238"
android:fillType="nonZero"
android:pathData="M120,16h8v28h-8z"
android:strokeWidth="5.99999952"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#4d6570"
android:fillType="nonZero"
android:pathData="m32,127v1l25.61,38c2.07,3.59 5.94,6 10.39,6h56c4.46,0 8.32,-2.41 10.39,-6h0.01l25.6,-38v-1l-25.6,38h-0.01c-2.07,3.59 -5.94,6 -10.39,6h-56c-4.46,0 -8.32,-2.41 -10.39,-6z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#607d8b"
android:fillType="nonZero"
android:pathData="M80,14L80,22A6,6 0,0 1,74 28L50,28A6,6 0,0 1,44 22L44,14A6,6 0,0 1,50 8L74,8A6,6 0,0 1,80 14z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#607d8b"
android:fillType="nonZero"
android:pathData="M148,14L148,22A6,6 0,0 1,142 28L118,28A6,6 0,0 1,112 22L112,14A6,6 0,0 1,118 8L142,8A6,6 0,0 1,148 14z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#4d6570"
android:fillType="nonZero"
android:pathData="m44,21v1c0,3.32 2.68,6 6,6h24c3.32,0 6,-2.68 6,-6v-1c0,3.32 -2.68,6 -6,6h-24c-3.32,0 -6,-2.68 -6,-6z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#4d6570"
android:fillType="nonZero"
android:pathData="m112,21v1c0,3.32 2.68,6 6,6h24c3.32,0 6,-2.68 6,-6v-1c0,3.32 -2.68,6 -6,6h-24c-3.32,0 -6,-2.68 -6,-6z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#8097a2"
android:fillType="nonZero"
android:pathData="m50,8c-3.32,0 -6,2.68 -6,6v1c0,-3.32 2.68,-6 6,-6h24c3.32,0 6,2.68 6,6v-1c0,-3.32 -2.68,-6 -6,-6z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#8097a2"
android:fillType="nonZero"
android:pathData="m118,8c-3.32,0 -6,2.68 -6,6v1c0,-3.32 2.68,-6 6,-6h24c3.32,0 6,2.68 6,6v-1c0,-3.32 -2.68,-6 -6,-6z"
android:strokeWidth="0.34016225"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#ff1744"
android:fillType="nonZero"
android:pathData="M172,48L172,116A12,12 0,0 1,160 128L32,128A12,12 0,0 1,20 116L20,48A12,12 0,0 1,32 36L160,36A12,12 0,0 1,172 48z"
android:strokeWidth="0.340162"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="m36,52 l60,32 60,-32"
android:strokeWidth="6"
android:strokeColor="#fbe9e7"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#ff4569"
android:fillType="nonZero"
android:pathData="m32,36c-6.65,0 -12,5.35 -12,12v1c0,-6.65 5.35,-12 12,-12h128c6.65,0 12,5.35 12,12v-1c0,-6.65 -5.35,-12 -12,-12z"
android:strokeWidth="0.340162"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#d81a3d"
android:fillType="nonZero"
android:pathData="m20,115v1c0,6.65 5.35,12 12,12h128c6.65,0 12,-5.35 12,-12v-1c0,6.65 -5.35,12 -12,12h-128c-6.65,0 -12,-5.35 -12,-12z"
android:strokeWidth="0.340162"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#263238"
android:fillType="nonZero"
android:pathData="M108,158L108,170A6,6 0,0 1,102 176L90,176A6,6 0,0 1,84 170L84,158A6,6 0,0 1,90 152L102,152A6,6 0,0 1,108 158z"
android:strokeWidth="0.340162"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#263238"
android:fillType="nonZero"
android:pathData="M96,172m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"
android:strokeWidth="9"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#37474f"
android:fillType="nonZero"
android:pathData="m90,152c-3.32,0 -6,2.68 -6,6v1c0,-3.32 2.68,-6 6,-6h12c3.32,0 6,2.68 6,6v-1c0,-3.32 -2.68,-6 -6,-6z"
android:strokeWidth="0.340162"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
<path
android:fillColor="#1a252a"
android:fillType="nonZero"
android:pathData="m84.02,171.43a12,12 0,0 0,-0.02 0.57,12 12,0 0,0 12,12 12,12 0,0 0,12 -12,12 12,0 0,0 -0.02,-0.41 12,12 0,0 1,-11.98 11.41,12 12,0 0,1 -11.98,-11.57z"
android:strokeWidth="9"
android:strokeColor="#00000000"
android:strokeLineCap="round"
android:strokeLineJoin="miter" />
</vector>