Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 13:56:56 +01:00
parent 75dc487a7a
commit 39c29d175b
6317 changed files with 388324 additions and 2 deletions

View file

@ -0,0 +1,15 @@
## Core - UI - Compose - Theme2 - Common
This provides the common `MainTheme` with dark/light variation support, a wrapper for the Compose Material 3 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 Material 3 related properties use `MainTheme` instead of `MaterialTheme`:
- `MainTheme.colors`: Material 3 color scheme
- `MainTheme.elevations`: Elevation levels as [defined](https://m3.material.io/styles/elevation/overview) in Material3
- `MainTheme.images`: Images used across the theme, e.g. logo
- `MainTheme.shapes`: Shapes as [defined](https://m3.material.io/styles/shape/overview) in Material 3
- `MainTheme.sizes`: Sizes (smaller, small, medium, large, larger, huge, huger)
- `MainTheme.spacings`: Spacings (quarter, half, default, oneHalf, double, triple, quadruple) while default is 8 dp.
- `MainTheme.typography`: Material 3 typography
To use the MainTheme, you need to provide a `ThemeConfig` with your desired colors, typography, shapes, elevations, sizes, spacings and images. The `ThemeConfig` is a data class that holds all the necessary information for the `MainTheme` to work.

View file

@ -0,0 +1,18 @@
plugins {
id(ThunderbirdPlugins.Library.androidCompose)
}
android {
namespace = "app.k9mail.core.ui.compose.theme2"
resourcePrefix = "core_ui_theme2"
}
dependencies {
api(projects.core.ui.compose.common)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.android.material)
implementation(libs.androidx.activity)
}

View file

@ -0,0 +1,111 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ReadOnlyComposable
@Composable
fun MainTheme(
themeConfig: ThemeConfig,
darkTheme: Boolean = isSystemInDarkTheme(),
dynamicColor: Boolean = true,
content: @Composable () -> Unit,
) {
val themeColorScheme = selectThemeColorScheme(
themeConfig = themeConfig,
darkTheme = darkTheme,
dynamicColor = dynamicColor,
)
val themeImages = selectThemeImages(
themeConfig = themeConfig,
darkTheme = darkTheme,
)
SystemBar(
darkTheme = darkTheme,
colorScheme = themeColorScheme,
)
CompositionLocalProvider(
LocalThemeColorScheme provides themeColorScheme,
LocalThemeElevations provides themeConfig.elevations,
LocalThemeImages provides themeImages,
LocalThemeShapes provides themeConfig.shapes,
LocalThemeSizes provides themeConfig.sizes,
LocalThemeSpacings provides themeConfig.spacings,
LocalThemeTypography provides themeConfig.typography,
) {
MaterialTheme(
colorScheme = themeColorScheme.toMaterial3ColorScheme(),
shapes = themeConfig.shapes.toMaterial3Shapes(),
typography = themeConfig.typography.toMaterial3Typography(),
content = content,
)
}
}
/**
* Contains functions to access the current theme values provided at the call site's position in
* the hierarchy.
*/
object MainTheme {
/**
* Retrieves the current [ColorScheme] at the call site's position in the hierarchy.
*/
val colors: ThemeColorScheme
@Composable
@ReadOnlyComposable
get() = LocalThemeColorScheme.current
/**
* Retrieves the current [ThemeElevations] at the call site's position in the hierarchy.
*/
val elevations: ThemeElevations
@Composable
@ReadOnlyComposable
get() = LocalThemeElevations.current
/**
* Retrieves the current [ThemeImages] at the call site's position in the hierarchy.
*/
val images: ThemeImages
@Composable
@ReadOnlyComposable
get() = LocalThemeImages.current
/**
* Retrieves the current [ThemeShapes] at the call site's position in the hierarchy.
*/
val shapes: ThemeShapes
@Composable
@ReadOnlyComposable
get() = LocalThemeShapes.current
/**
* Retrieves the current [ThemeSizes] at the call site's position in the hierarchy.
*/
val sizes: ThemeSizes
@Composable
@ReadOnlyComposable
get() = LocalThemeSizes.current
/**
* Retrieves the current [ThemeSpacings] at the call site's position in the hierarchy.
*/
val spacings: ThemeSpacings
@Composable
@ReadOnlyComposable
get() = LocalThemeSpacings.current
/**
* Retrieves the current [ThemeTypography] at the call site's position in the hierarchy.
*/
val typography: ThemeTypography
@Composable
@ReadOnlyComposable
get() = LocalThemeTypography.current
}

View file

@ -0,0 +1,182 @@
package app.k9mail.core.ui.compose.theme2
import android.content.Context
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import com.google.android.material.color.MaterialColors
@Composable
internal fun selectThemeColorScheme(
themeConfig: ThemeConfig,
darkTheme: Boolean,
dynamicColor: Boolean,
): ThemeColorScheme {
return when {
dynamicColor && supportsDynamicColor() -> {
val context = LocalContext.current
val colorScheme = if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
colorScheme.toDynamicThemeColorScheme(darkTheme, themeConfig.colors)
}
darkTheme -> themeConfig.colors.dark
else -> themeConfig.colors.light
}
}
// Supported from Android 12+
private fun supportsDynamicColor(): Boolean {
return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S
}
@Suppress("LongMethod")
private fun ColorScheme.toDynamicThemeColorScheme(
darkTheme: Boolean,
colors: ThemeColorSchemeVariants,
): ThemeColorScheme {
val colorScheme = if (darkTheme) colors.dark else colors.light
val info = colorScheme.info.toHarmonizedColor(primary)
val onInfo = colorScheme.onInfo.toHarmonizedColor(primary)
val infoContainer = colorScheme.infoContainer.toHarmonizedColor(primary)
val onInfoContainer = colorScheme.onInfoContainer.toHarmonizedColor(primary)
val success = colorScheme.success.toHarmonizedColor(primary)
val onSuccess = colorScheme.onSuccess.toHarmonizedColor(primary)
val successContainer = colorScheme.successContainer.toHarmonizedColor(primary)
val onSuccessContainer = colorScheme.onSuccessContainer.toHarmonizedColor(primary)
val warning = colorScheme.warning.toHarmonizedColor(primary)
val onWarning = colorScheme.onWarning.toHarmonizedColor(primary)
val warningContainer = colorScheme.warningContainer.toHarmonizedColor(primary)
val onWarningContainer = colorScheme.onWarningContainer.toHarmonizedColor(primary)
return ThemeColorScheme(
primary = primary,
onPrimary = onPrimary,
primaryContainer = primaryContainer,
onPrimaryContainer = onPrimaryContainer,
secondary = secondary,
onSecondary = onSecondary,
secondaryContainer = secondaryContainer,
onSecondaryContainer = onSecondaryContainer,
tertiary = tertiary,
onTertiary = onTertiary,
tertiaryContainer = tertiaryContainer,
onTertiaryContainer = onTertiaryContainer,
error = error,
onError = onError,
errorContainer = errorContainer,
onErrorContainer = onErrorContainer,
surface = surface,
onSurface = onSurface,
onSurfaceVariant = onSurfaceVariant,
surfaceContainerLowest = surfaceContainerLowest,
surfaceContainerLow = surfaceContainerLow,
surfaceContainer = surfaceContainer,
surfaceContainerHigh = surfaceContainerHigh,
surfaceContainerHighest = surfaceContainerHighest,
inverseSurface = inverseSurface,
inverseOnSurface = inverseOnSurface,
inversePrimary = inversePrimary,
outline = outline,
outlineVariant = outlineVariant,
surfaceBright = surfaceBright,
surfaceDim = surfaceDim,
scrim = scrim,
info = info,
onInfo = onInfo,
infoContainer = infoContainer,
onInfoContainer = onInfoContainer,
success = success,
onSuccess = onSuccess,
successContainer = successContainer,
onSuccessContainer = onSuccessContainer,
warning = warning,
onWarning = onWarning,
warningContainer = warningContainer,
onWarningContainer = onWarningContainer,
)
}
/**
* The color roles of a theme accent color. They are used to define the main accent color and its complementary colors
* in a Material Design theme.
*
* These roles are used to create a harmonious color scheme that works well together.
*
* The roles are:
* - `accent`: The main accent color.
* - `onAccent`: The color used for text and icons on top of the accent color.
* - `accentContainer`: A container color that complements the accent color.
* - `onAccentContainer`: The color used for text and icons on top of the accent container color.
*
* @param accent The main accent color.
* @param onAccent The color used for text and icons on top of the accent color.
* @param accentContainer A container color that complements the accent color.
* @param onAccentContainer The color used for text and icons on top of the accent container color.
*/
data class ColorRoles(
val accent: Color,
val onAccent: Color,
val accentContainer: Color,
val onAccentContainer: Color,
)
/**
* Returns a harmonized color that is derived from the given color and the target color.
*
* This function uses Material Colors to harmonize the two colors.
*
* @param target The target color to harmonize with.
* @return A new color that is harmonized with the target color.
*/
fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb()))
/**
* Returns a [ColorRoles] object that contains the accent colors derived from the given color.
*
* This function uses Material Colors to retrieve the accent colors based on the provided color.
*
* @param context The context to use for retrieving the color roles.
* @return A [ColorRoles] object containing the accent colors.
*/
fun Color.toColorRoles(context: Context): ColorRoles {
val colorRoles = MaterialColors.getColorRoles(context, this.toArgb())
return ColorRoles(
accent = Color(colorRoles.accent),
onAccent = Color(colorRoles.onAccent),
accentContainer = Color(colorRoles.accentContainer),
onAccentContainer = Color(colorRoles.onAccentContainer),
)
}
/**
* Returns a surface container color that is a composite of the given color and the theme surface container color.
*
* The alpha value is applied to the given color before compositing.
*
* @param alpha The alpha value to apply to the color.
* @return A new color that is a composite of the given color and the theme surface container color.
*/
@Composable
fun Color.toSurfaceContainer(alpha: Float): Color {
val color = copy(alpha = alpha)
return color.compositeOver(MainTheme.colors.surfaceContainer)
}

View file

@ -0,0 +1,12 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.runtime.Composable
@Composable
internal fun selectThemeImages(
themeConfig: ThemeConfig,
darkTheme: Boolean,
) = when {
darkTheme -> themeConfig.images.dark
else -> themeConfig.images.light
}

View file

@ -0,0 +1,24 @@
package app.k9mail.core.ui.compose.theme2
import android.app.Activity
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalView
import androidx.core.view.WindowCompat
@Composable
fun SystemBar(
darkTheme: Boolean,
colorScheme: ThemeColorScheme,
) {
val view = LocalView.current
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.surfaceContainer.toArgb()
window.navigationBarColor = colorScheme.surfaceContainer.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
}
}
}

View file

@ -0,0 +1,144 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.material3.ColorScheme
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.material3.LocalContentColor as Material3LocalContentColor
/**
* Theme color scheme following Material 3 color roles.
*
* This supports tone-based Surfaces introduced for Material 3.
*
* @see: https://m3.material.io/styles/color/roles
* @see: https://material.io/blog/tone-based-surface-color-m3
*/
@Immutable
data class ThemeColorScheme(
val primary: Color,
val onPrimary: Color,
val primaryContainer: Color,
val onPrimaryContainer: Color,
val secondary: Color,
val onSecondary: Color,
val secondaryContainer: Color,
val onSecondaryContainer: Color,
val tertiary: Color,
val onTertiary: Color,
val tertiaryContainer: Color,
val onTertiaryContainer: Color,
val error: Color,
val onError: Color,
val errorContainer: Color,
val onErrorContainer: Color,
val surfaceDim: Color,
val surface: Color,
val surfaceBright: Color,
val onSurface: Color,
val onSurfaceVariant: Color,
val surfaceContainerLowest: Color,
val surfaceContainerLow: Color,
val surfaceContainer: Color,
val surfaceContainerHigh: Color,
val surfaceContainerHighest: Color,
val inverseSurface: Color,
val inverseOnSurface: Color,
val inversePrimary: Color,
val outline: Color,
val outlineVariant: Color,
val scrim: Color,
// extra colors
val info: Color,
val onInfo: Color,
val infoContainer: Color,
val onInfoContainer: Color,
val success: Color,
val onSuccess: Color,
val successContainer: Color,
val onSuccessContainer: Color,
val warning: Color,
val onWarning: Color,
val warningContainer: Color,
val onWarningContainer: Color,
)
/**
* Convert a [ThemeColorScheme] to a Material 3 [ColorScheme].
*
* Note: background, onBackground are deprecated and mapped to surface, onSurface.
*/
internal fun ThemeColorScheme.toMaterial3ColorScheme(): ColorScheme {
return ColorScheme(
primary = primary,
onPrimary = onPrimary,
primaryContainer = primaryContainer,
onPrimaryContainer = onPrimaryContainer,
secondary = secondary,
onSecondary = onSecondary,
secondaryContainer = secondaryContainer,
onSecondaryContainer = onSecondaryContainer,
tertiary = tertiary,
onTertiary = onTertiary,
tertiaryContainer = tertiaryContainer,
onTertiaryContainer = onTertiaryContainer,
error = error,
onError = onError,
errorContainer = errorContainer,
onErrorContainer = onErrorContainer,
surfaceDim = surfaceDim,
surface = surface,
surfaceBright = surfaceBright,
onSurface = onSurface,
onSurfaceVariant = onSurfaceVariant,
surfaceContainerLowest = surfaceContainerLowest,
surfaceContainerLow = surfaceContainerLow,
surfaceContainer = surfaceContainer,
surfaceContainerHigh = surfaceContainerHigh,
surfaceContainerHighest = surfaceContainerHighest,
inverseSurface = inverseSurface,
inverseOnSurface = inverseOnSurface,
inversePrimary = inversePrimary,
outline = outline,
outlineVariant = outlineVariant,
scrim = scrim,
// Remapping properties due to changes in Material 3 tone based surface colors
// https://material.io/blog/tone-based-surface-color-m3
background = surface,
onBackground = onSurface,
surfaceVariant = surfaceContainerHighest,
surfaceTint = surfaceContainerHighest,
)
}
internal val LocalThemeColorScheme = staticCompositionLocalOf<ThemeColorScheme> {
error("No ThemeColorScheme provided")
}
/**
* CompositionLocal used to specify the default color for text and icons.
*
* This uses the Material 3 [LocalContentColor] implementation.
*/
val LocalContentColor get() = Material3LocalContentColor

View file

@ -0,0 +1,26 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.runtime.Immutable
@Immutable
data class ThemeConfig(
val colors: ThemeColorSchemeVariants,
val elevations: ThemeElevations,
val images: ThemeImageVariants,
val shapes: ThemeShapes,
val sizes: ThemeSizes,
val spacings: ThemeSpacings,
val typography: ThemeTypography,
)
@Immutable
data class ThemeColorSchemeVariants(
val dark: ThemeColorScheme,
val light: ThemeColorScheme,
)
@Immutable
data class ThemeImageVariants(
val dark: ThemeImages,
val light: ThemeImages,
)

View file

@ -0,0 +1,29 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
/**
* Elevation values used in the app.
*
* Material uses six levels of elevation, each with a corresponding dp value. These values are named for their
* relative distance above the UIs surface: 0, +1, +2, +3, +4, and +5. An elements resting state can be on
* levels 0 to +3, while levels +4 and +5 are reserved for user-interacted states such as hover and dragged.
*
* @see: https://m3.material.io/styles/elevation/tokens
*/
@Immutable
data class ThemeElevations(
val level0: Dp = 0.dp,
val level1: Dp = 1.dp,
val level2: Dp = 3.dp,
val level3: Dp = 6.dp,
val level4: Dp = 8.dp,
val level5: Dp = 12.dp,
)
internal val LocalThemeElevations = staticCompositionLocalOf<ThemeElevations> {
error("No ThemeElevations provided")
}

View file

@ -0,0 +1,15 @@
package app.k9mail.core.ui.compose.theme2
import androidx.annotation.DrawableRes
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
@Suppress("detekt.UnnecessaryAnnotationUseSiteTarget") // https://github.com/detekt/detekt/issues/8212
@Immutable
data class ThemeImages(
@param:DrawableRes val logo: Int,
)
internal val LocalThemeImages = staticCompositionLocalOf<ThemeImages> {
error("No ThemeImages provided")
}

View file

@ -0,0 +1,51 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.foundation.shape.CornerBasedShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Shapes
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.dp
/**
* The shapes used in the app.
*
* The shapes are defined as:
*
* - None
* - ExtraSmall
* - Small
* - Medium
* - Large
* - ExtraLarge
* - Full
*
* The default values are based on the Material Design guidelines.
*
* Shapes None and Full are omitted as None is a RectangleShape and Full is a CircleShape.
*
* @see: https://m3.material.io/styles/shape/overview
*/
@Immutable
data class ThemeShapes(
val extraSmall: CornerBasedShape = RoundedCornerShape(4.dp),
val small: CornerBasedShape = RoundedCornerShape(8.dp),
val medium: CornerBasedShape = RoundedCornerShape(12.dp),
val large: CornerBasedShape = RoundedCornerShape(16.dp),
val extraLarge: CornerBasedShape = RoundedCornerShape(28.dp),
)
/**
* Converts the [ThemeShapes] to Material 3 [Shapes].
*/
internal fun ThemeShapes.toMaterial3Shapes() = Shapes(
extraSmall = extraSmall,
small = small,
medium = medium,
large = large,
extraLarge = extraLarge,
)
internal val LocalThemeShapes = staticCompositionLocalOf<ThemeShapes> {
error("No ThemeShapes provided")
}

View file

@ -0,0 +1,30 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.Dp
@Immutable
data class ThemeSizes(
val smaller: Dp,
val small: Dp,
val medium: Dp,
val large: Dp,
val larger: Dp,
val huge: Dp,
val huger: Dp,
val iconSmall: Dp,
val icon: Dp,
val iconLarge: Dp,
val iconAvatar: Dp,
val topBarHeight: Dp,
val bottomBarHeight: Dp,
val bottomBarHeightWithFab: Dp,
val bannerGlobalHeight: Dp,
)
internal val LocalThemeSizes = staticCompositionLocalOf<ThemeSizes> {
error("No ThemeSizes provided")
}

View file

@ -0,0 +1,21 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.unit.Dp
@Immutable
data class ThemeSpacings(
val zero: Dp,
val quarter: Dp,
val half: Dp,
val default: Dp,
val oneHalf: Dp,
val double: Dp,
val triple: Dp,
val quadruple: Dp,
)
internal val LocalThemeSpacings = staticCompositionLocalOf<ThemeSpacings> {
error("No ThemeSpacings provided")
}

View file

@ -0,0 +1,50 @@
package app.k9mail.core.ui.compose.theme2
import androidx.compose.material3.Typography
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.text.TextStyle
@Immutable
data class ThemeTypography(
val displayLarge: TextStyle,
val displayMedium: TextStyle,
val displaySmall: TextStyle,
val headlineLarge: TextStyle,
val headlineMedium: TextStyle,
val headlineSmall: TextStyle,
val titleLarge: TextStyle,
val titleMedium: TextStyle,
val titleSmall: TextStyle,
val bodyLarge: TextStyle,
val bodyMedium: TextStyle,
val bodySmall: TextStyle,
val labelLarge: TextStyle,
val labelMedium: TextStyle,
val labelSmall: TextStyle,
)
/**
* Convert [ThemeTypography] to Material 3 [Typography]
*/
internal fun ThemeTypography.toMaterial3Typography() = Typography(
displayLarge = displayLarge,
displayMedium = displayMedium,
displaySmall = displaySmall,
headlineLarge = headlineLarge,
headlineMedium = headlineMedium,
headlineSmall = headlineSmall,
titleLarge = titleLarge,
titleMedium = titleMedium,
titleSmall = titleSmall,
bodyLarge = bodyLarge,
bodyMedium = bodyMedium,
bodySmall = bodySmall,
labelLarge = labelLarge,
labelMedium = labelMedium,
labelSmall = labelSmall,
)
internal val LocalThemeTypography = staticCompositionLocalOf<ThemeTypography> {
error("No ThemeTypography provided")
}

View file

@ -0,0 +1,16 @@
package app.k9mail.core.ui.compose.theme2.default
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme2.ThemeElevations
/**
* Default values for Material elevation taken from https://m3.material.io/styles/elevation/tokens
*/
val defaultThemeElevations = ThemeElevations(
level0 = 0.dp,
level1 = 1.dp,
level2 = 3.dp,
level3 = 6.dp,
level4 = 8.dp,
level5 = 12.dp,
)

View file

@ -0,0 +1,13 @@
package app.k9mail.core.ui.compose.theme2.default
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme2.ThemeShapes
val defaultThemeShapes = ThemeShapes(
extraSmall = RoundedCornerShape(4.dp),
small = RoundedCornerShape(8.dp),
medium = RoundedCornerShape(12.dp),
large = RoundedCornerShape(16.dp),
extraLarge = RoundedCornerShape(28.dp),
)

View file

@ -0,0 +1,24 @@
package app.k9mail.core.ui.compose.theme2.default
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme2.ThemeSizes
val defaultThemeSizes = ThemeSizes(
smaller = 8.dp,
small = 16.dp,
medium = 32.dp,
large = 64.dp,
larger = 128.dp,
huge = 256.dp,
huger = 384.dp,
iconSmall = 16.dp,
icon = 24.dp,
iconLarge = 32.dp,
iconAvatar = 48.dp,
topBarHeight = 64.dp,
bottomBarHeight = 80.dp,
bottomBarHeightWithFab = 72.dp,
bannerGlobalHeight = 48.dp,
)

View file

@ -0,0 +1,15 @@
package app.k9mail.core.ui.compose.theme2.default
import androidx.compose.ui.unit.dp
import app.k9mail.core.ui.compose.theme2.ThemeSpacings
val defaultThemeSpacings = ThemeSpacings(
zero = 0.dp,
quarter = 2.dp,
half = 4.dp,
default = 8.dp,
oneHalf = 12.dp,
double = 16.dp,
triple = 24.dp,
quadruple = 32.dp,
)

View file

@ -0,0 +1,116 @@
package app.k9mail.core.ui.compose.theme2.default
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
import app.k9mail.core.ui.compose.theme2.ThemeTypography
@Suppress("MagicNumber")
val defaultTypography = ThemeTypography(
displayLarge = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 57.sp,
lineHeight = 64.sp,
letterSpacing = (-0.2).sp,
),
displayMedium = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 45.sp,
lineHeight = 52.sp,
letterSpacing = 0.sp,
),
displaySmall = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 36.sp,
lineHeight = 44.sp,
letterSpacing = 0.sp,
),
headlineLarge = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 32.sp,
lineHeight = 40.sp,
letterSpacing = 0.sp,
),
headlineMedium = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 28.sp,
lineHeight = 36.sp,
letterSpacing = 0.sp,
),
headlineSmall = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 24.sp,
lineHeight = 32.sp,
letterSpacing = 0.sp,
),
titleLarge = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp,
),
titleMedium = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Medium,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.2.sp,
),
titleSmall = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
),
bodyLarge = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp,
),
bodyMedium = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.2.sp,
),
bodySmall = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Normal,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.4.sp,
),
labelLarge = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.SemiBold,
fontSize = 14.sp,
lineHeight = 20.sp,
letterSpacing = 0.1.sp,
),
labelMedium = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Bold,
fontSize = 12.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp,
),
labelSmall = TextStyle(
fontFamily = FontFamily.SansSerif,
fontWeight = FontWeight.Bold,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp,
),
)

View file

@ -0,0 +1,13 @@
## 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,120 @@
package app.k9mail.core.ui.compose.theme2.k9mail
import androidx.compose.ui.graphics.Color
import app.k9mail.core.ui.compose.theme2.ThemeColorScheme
internal val lightThemeColorScheme = ThemeColorScheme(
primary = Color(color = 0xFF5F303D),
onPrimary = Color(color = 0xFFFFFFFF),
primaryContainer = Color(color = 0xFF875360),
onPrimaryContainer = Color(color = 0xFFFFFFFF),
secondary = Color(color = 0xFF422129),
onSecondary = Color(color = 0xFFFFFFFF),
secondaryContainer = Color(color = 0xFF68414B),
onSecondaryContainer = Color(color = 0xFFFFE2E7),
tertiary = Color(color = 0xFF443968),
onTertiary = Color(color = 0xFFFFFFFF),
tertiaryContainer = Color(color = 0xFF685C8E),
onTertiaryContainer = Color(color = 0xFFFFFFFF),
error = Color(color = 0xFF7F1D1D),
onError = Color(color = 0xFFFFFFFF),
errorContainer = Color(color = 0xFFFEF2F2),
onErrorContainer = Color(color = 0xFF7F1D1D),
surfaceDim = Color(color = 0xFFDCD9D9),
surface = Color(color = 0xFFFCF8F8),
surfaceBright = Color(color = 0xFFFCF8F8),
onSurface = Color(color = 0xFF1C1B1B),
onSurfaceVariant = Color(color = 0xFF45474A),
surfaceContainerLowest = Color(color = 0xFFFFFFFF),
surfaceContainerLow = Color(color = 0xFFF6F3F2),
surfaceContainer = Color(color = 0xFFF1EDEC),
surfaceContainerHigh = Color(color = 0xFFEBE7E7),
surfaceContainerHighest = Color(color = 0xFFE5E2E1),
inverseSurface = Color(color = 0xFF313030),
inverseOnSurface = Color(color = 0xFFF3F0EF),
inversePrimary = Color(color = 0xFFF7B5C4),
outline = Color(color = 0xFF75777A),
outlineVariant = Color(color = 0xFFC5C6CA),
scrim = Color.Black,
info = Color(color = 0xFF004F9B),
onInfo = Color(color = 0xFFFFFFFF),
infoContainer = Color(color = 0xFFF0F8FF),
onInfoContainer = Color(color = 0xFF004F9B),
success = Color(color = 0xFF194E2C),
onSuccess = Color(color = 0xFFFFFFFF),
successContainer = Color(color = 0xFFF4F9F4),
onSuccessContainer = Color(color = 0xFF194E2C),
warning = Color(color = 0xFF713F12),
onWarning = Color(color = 0xFFFEFAE8),
warningContainer = Color(color = 0xFFFEFAE8),
onWarningContainer = Color(color = 0xFF713F12),
)
internal val darkThemeColorScheme = ThemeColorScheme(
primary = Color(color = 0xFFF1E7FF),
onPrimary = Color(color = 0xFF37265D),
primaryContainer = Color(color = 0xFFCBB7F9),
onPrimaryContainer = Color(color = 0xFF39285F),
secondary = Color(color = 0xFFF1E7FF),
onSecondary = Color(color = 0xFF332D41),
secondaryContainer = Color(color = 0xFFC7BDD7),
onSecondaryContainer = Color(color = 0xFF352F43),
tertiary = Color(color = 0xFFFFDBE5),
onTertiary = Color(color = 0xFF472732),
tertiaryContainer = Color(color = 0xFFDDAEBC),
onTertiaryContainer = Color(color = 0xFF43242F),
error = Color(color = 0xFFFCA5A5),
onError = Color(color = 0xFF450A0A),
errorContainer = Color(color = 0xFF7F1D1D),
onErrorContainer = Color(color = 0xFFFEF2F2),
surfaceDim = Color(color = 0xFF131314),
surface = Color(color = 0xFF131314),
surfaceBright = Color(color = 0xFF39393A),
onSurface = Color(color = 0xFFE5E2E3),
onSurfaceVariant = Color(color = 0xFFC5C6CC),
surfaceContainerLowest = Color(color = 0xFF0E0E0F),
surfaceContainerLow = Color(color = 0xFF1B1B1C),
surfaceContainer = Color(color = 0xFF201F20),
surfaceContainerHigh = Color(color = 0xFF2A2A2B),
surfaceContainerHighest = Color(color = 0xFF353436),
inverseSurface = Color(color = 0xFFE5E2E3),
inverseOnSurface = Color(color = 0xFF313031),
inversePrimary = Color(color = 0xFF66558F),
outline = Color(color = 0xFF8F9096),
outlineVariant = Color(color = 0xFF44474C),
scrim = Color.Black,
info = Color(color = 0xFFBEE6FF),
onInfo = Color(color = 0xFF002E41),
infoContainer = Color(color = 0xFF262C40),
onInfoContainer = Color(color = 0xFFBEE6FF),
success = Color(color = 0xFF8EE7AA),
onSuccess = Color(color = 0xFF082B16),
successContainer = Color(color = 0xFF082B16),
onSuccessContainer = Color(color = 0xFF8EE7AA),
warning = Color(color = 0xFFFEE78A),
onWarning = Color(color = 0xFF411107),
warningContainer = Color(color = 0xFF423606),
onWarningContainer = Color(color = 0xFFFEE78A),
)

View file

@ -0,0 +1,171 @@
<!-- 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>

View file

@ -0,0 +1,12 @@
plugins {
id(ThunderbirdPlugins.Library.androidCompose)
}
android {
namespace = "app.k9mail.core.ui.compose.theme2.thunderbird"
resourcePrefix = "core_ui_theme2_thunderbird"
}
dependencies {
api(projects.core.ui.compose.theme2.common)
}

View file

@ -0,0 +1,120 @@
package app.k9mail.core.ui.compose.theme2.thunderbird
import androidx.compose.ui.graphics.Color
import app.k9mail.core.ui.compose.theme2.ThemeColorScheme
internal val lightThemeColorScheme = ThemeColorScheme(
primary = Color(color = 0xFF004F9B),
onPrimary = Color(color = 0xFFFFFFFF),
primaryContainer = Color(color = 0xFF1373D9),
onPrimaryContainer = Color(color = 0xFFFFFFFF),
secondary = Color(color = 0xFF003D75),
onSecondary = Color(color = 0xFFFFFFFF),
secondaryContainer = Color(color = 0xFF2E61A0),
onSecondaryContainer = Color(color = 0xFFFFFFFF),
tertiary = Color(color = 0xFF54008E),
onTertiary = Color(color = 0xFFFFFFFF),
tertiaryContainer = Color(color = 0xFF7B35B8),
onTertiaryContainer = Color(color = 0xFFFFFFFF),
error = Color(color = 0xFF7F1D1D),
onError = Color(color = 0xFFFFFFFF),
errorContainer = Color(color = 0xFFFEF2F2),
onErrorContainer = Color(color = 0xFF7F1D1D),
surfaceDim = Color(color = 0xFFDCD9D9),
surface = Color(color = 0xFFFCF8F8),
surfaceBright = Color(color = 0xFFFCF8F8),
onSurface = Color(color = 0xFF1C1B1B),
onSurfaceVariant = Color(color = 0xFF45474A),
surfaceContainerLowest = Color(color = 0xFFFFFFFF),
surfaceContainerLow = Color(color = 0xFFF6F3F2),
surfaceContainer = Color(color = 0xFFF1EDEC),
surfaceContainerHigh = Color(color = 0xFFEBE7E7),
surfaceContainerHighest = Color(color = 0xFFE5E2E1),
inverseSurface = Color(color = 0xFF313030),
inverseOnSurface = Color(color = 0xFFF3F0EF),
inversePrimary = Color(color = 0xFFA9C7FF),
outline = Color(color = 0xFF75777A),
outlineVariant = Color(color = 0xFFC5C6CA),
scrim = Color.Black,
info = Color(color = 0xFF004F9B),
onInfo = Color(color = 0xFFFFFFFF),
infoContainer = Color(color = 0xFFF0F8FF),
onInfoContainer = Color(color = 0xFF004F9B),
success = Color(color = 0xFF194E2C),
onSuccess = Color(color = 0xFFFFFFFF),
successContainer = Color(color = 0xFFF4F9F4),
onSuccessContainer = Color(color = 0xFF194E2C),
warning = Color(color = 0xFF713F12),
onWarning = Color(color = 0xFFFEFAE8),
warningContainer = Color(color = 0xFFFEFAE8),
onWarningContainer = Color(color = 0xFF713F12),
)
internal val darkThemeColorScheme = ThemeColorScheme(
primary = Color(color = 0xFFBEE6FF),
onPrimary = Color(color = 0xFF003549),
primaryContainer = Color(color = 0xFF50C2F8),
onPrimaryContainer = Color(color = 0xFF002E41),
secondary = Color(color = 0xFF96CDFF),
onSecondary = Color(color = 0xFF003352),
secondaryContainer = Color(color = 0xFF24A7F7),
onSecondaryContainer = Color(color = 0xFF001423),
tertiary = Color(color = 0xFFFFFFFF),
onTertiary = Color(color = 0xFF352D3E),
tertiaryContainer = Color(color = 0xFFDCD0E6),
onTertiaryContainer = Color(color = 0xFF443C4E),
error = Color(color = 0xFFFCA5A5),
onError = Color(color = 0xFF450A0A),
errorContainer = Color(color = 0xFF7F1D1D),
onErrorContainer = Color(color = 0xFFFEF2F2),
surfaceDim = Color(color = 0xFF131314),
surface = Color(color = 0xFF131314),
surfaceBright = Color(color = 0xFF39393A),
onSurface = Color(color = 0xFFE5E2E3),
onSurfaceVariant = Color(color = 0xFFC5C6CC),
surfaceContainerLowest = Color(color = 0xFF0E0E0F),
surfaceContainerLow = Color(color = 0xFF1B1B1C),
surfaceContainer = Color(color = 0xFF201F20),
surfaceContainerHigh = Color(color = 0xFF2A2A2B),
surfaceContainerHighest = Color(color = 0xFF353436),
inverseSurface = Color(color = 0xFFE5E2E3),
inverseOnSurface = Color(color = 0xFF313031),
inversePrimary = Color(color = 0xFF006689),
outline = Color(color = 0xFF8F9096),
outlineVariant = Color(color = 0xFF44474C),
scrim = Color.Black,
info = Color(color = 0xFFBEE6FF),
onInfo = Color(color = 0xFF002E41),
infoContainer = Color(color = 0xFF262C40),
onInfoContainer = Color(color = 0xFFBEE6FF),
success = Color(color = 0xFF8EE7AA),
onSuccess = Color(color = 0xFF082B16),
successContainer = Color(color = 0xFF082B16),
onSuccessContainer = Color(color = 0xFF8EE7AA),
warning = Color(color = 0xFFFEE78A),
onWarning = Color(color = 0xFF411107),
warningContainer = Color(color = 0xFF423606),
onWarningContainer = Color(color = 0xFFFEE78A),
)

View file

@ -0,0 +1,48 @@
package app.k9mail.core.ui.compose.theme2.thunderbird
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 ThunderbirdTheme2(
darkTheme: Boolean = isSystemInDarkTheme(),
dynamicColor: Boolean = false,
content: @Composable () -> Unit,
) {
val images = ThemeImages(
logo = R.drawable.core_ui_theme2_thunderbird_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,252 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="72dp"
android:height="72dp"
android:viewportWidth="1024"
android:viewportHeight="1024"
>
<path android:pathData="M424.4,189.7L424.5,189.7C456.7,77 597.2,22 740.4,22C839.3,22 928.1,53.3 989,103C951.3,104.9 915.4,112.3 882.6,124.2C931.8,142.5 974,170.6 1005.3,205.4C984.6,201.8 963,199.9 940.9,199.9C938.5,199.9 936.1,200 933.8,200C990.7,282.5 1024,382.5 1024,490.4C1024,773.1 794.8,1002.3 512,1002.3C233.6,1002.3 0,769.2 0,490.4C0,446.3 5.9,400.8 17.2,358.2C20.2,349.2 24.4,340.6 29.9,337.5C36.8,333.6 43.1,345.3 44.1,349.1C51.6,377.3 61.7,404.5 74.2,430.6C73.1,372.2 98,318.9 132.4,272.9C155.3,242.2 176.5,213.7 186.3,131.6C187,126.1 192.2,122.1 197.5,123.8C272,148.2 311.9,272.4 305.7,376.2C346.9,382.1 346.7,339 346.7,339C333.5,298.6 342.3,223.4 424.2,189.7L424.4,189.7Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="899.5"
android:endY="864"
android:startX="177.7"
android:startY="190.8"
android:type="linear"
>
<item
android:color="#FF1B91F3"
android:offset="0"
/>
<item
android:color="#FF0B68CB"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.9"
android:pathData="M1007.3,360C1019.7,641.6 788.2,884.4 505.9,884.4C241.6,884.4 25.1,680.1 5.5,420.9C2.1,444.8 0.2,469.3 0,494.1C2,771.6 235,1002.3 512,1002.3C794.8,1002.3 1024,773.1 1024,490.4C1024,445.3 1018.2,401.6 1007.3,360Z"
android:strokeAlpha="0.9"
>
<aapt:attr name="android:fillColor">
<gradient
android:centerX="176.4"
android:centerY="422.4"
android:gradientRadius="432.9"
android:type="radial"
>
<item
android:color="#000B4186"
android:offset="0.5"
/>
<item
android:color="#720B4186"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M499.5,227.1C494,217.3 468.5,202.9 457.4,200.3C499.5,65.4 714.2,24 845.5,47.8C900.2,57.8 968.3,87.6 989,103C928.1,53.3 839.3,22 740.4,22C597.2,22 456.7,77 424.5,189.7L424.4,189.7L424.2,189.7C342.3,223.4 333.5,298.6 346.7,339.1C359.3,290.8 419.5,231.5 499.5,227.1Z">
<aapt:attr name="android:fillColor">
<gradient
android:centerX="525.2"
android:centerY="244.6"
android:gradientRadius="92.6"
android:type="radial"
>
<item
android:color="#00A29CF6"
android:offset="0"
/>
<item
android:color="#FFA39BF6"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M648.3,133.9C533.3,156.5 495.7,163.9 457.2,200.5C500.5,86 610.8,62.8 742.3,115C706.1,122.5 675.1,128.6 648.3,133.9Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="638.3"
android:endY="74"
android:startX="378.5"
android:startY="363.1"
android:type="linear"
>
<item
android:color="#FF0F5DB0"
android:offset="0"
/>
<item
android:color="#000F5DB0"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M27.8,342.5C-3.6,471.1 20.7,622.3 163.4,749.2C120.9,702.8 69,531.2 183.5,408.6C191.2,400.3 204.5,406.4 204.9,417.7C214.3,672.5 419.9,828.1 656.9,799C583.5,794.8 340.6,709.8 521.3,676.1C615.7,658.5 763.8,630.9 763.8,498.1C763.8,282.7 597.3,219.8 496.3,229.1C427.2,235.5 365.7,279.4 346.7,339C354,362.5 325,379 305.7,376.2C311.9,272.4 272,148.2 197.5,123.8C192.2,122.1 187,126.1 186.3,131.6C176.5,213.7 155.3,242.2 132.4,272.9C98,318.9 73.1,372.2 74.2,430.6C61.7,404.5 51.6,377.3 44.1,349.1C43.2,345.9 38.7,337.1 33.1,336.7C30.1,336.5 28.5,339.4 27.8,342.5Z">
<aapt:attr name="android:fillColor">
<gradient
android:centerX="318.9"
android:centerY="769.3"
android:gradientRadius="675.4"
android:type="radial"
>
<item
android:color="#FF094188"
android:offset="0"
/>
<item
android:color="#000B4186"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M457.9,689.2C596.9,802 876.5,717.4 876.5,442.9C763.6,614 619.8,732 457.9,689.2Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="750.4"
android:endY="805.6"
android:startX="833.7"
android:startY="572.4"
android:type="linear"
>
<item
android:color="#007B8BE9"
android:offset="0"
/>
<item
android:color="#FF7B8BE9"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M183.5,408.6C186.4,405.4 190.2,404.4 193.7,404.8C91.2,529.8 173.9,749.4 230.6,803.3C233.8,812.3 176.8,765.6 169,754.6C125.8,718 64,536.6 183.5,408.6Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="184.2"
android:endY="737.4"
android:startX="114.1"
android:startY="404"
android:type="linear"
>
<item
android:color="#FFC59FF9"
android:offset="0.1"
/>
<item
android:color="#00C59FF9"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="M512,699.5C651.1,699.5 763.8,607.5 763.8,494C763.8,380.6 651.1,288.6 512,288.6C393.4,288.6 260.2,365.8 260.2,497C260.3,699.9 474.6,816.6 657.2,798.9C643.5,797.3 557.9,792.8 500.1,727.3C494.8,721.4 485.8,711.2 489.9,704.5C494,697.8 505.3,699.5 512,699.5Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="512"
android:endY="796.8"
android:startX="512"
android:startY="363.8"
android:type="linear"
>
<item
android:color="#FFFFFFFF"
android:offset="0"
/>
<item
android:color="#FFBEE1FE"
android:offset="0.9"
/>
<item
android:color="#FF96CEFD"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.7"
android:pathData="M512,699.5C651.1,699.5 763.8,607.5 763.8,494C763.8,459.4 753.3,426.7 734.7,398.1L534.9,579.6C520.9,592.3 497.4,592.3 483.5,579.6L287.3,401.5C270.2,428.9 260.2,460.9 260.2,497C260.3,699.9 474.6,816.6 657.2,798.9C656.4,798.8 655.3,798.7 654,798.6L654,798.6C633.3,796.6 554.4,788.8 500.1,727.3C494.8,721.4 485.8,711.2 489.9,704.5C493.3,698.8 501.9,699.2 508.5,699.4C509.7,699.5 510.9,699.5 512,699.5Z"
android:strokeAlpha="0.7"
>
<aapt:attr name="android:fillColor">
<gradient
android:endX="520.1"
android:endY="790.2"
android:startX="520.1"
android:startY="608.8"
android:type="linear"
>
<item
android:color="#FFBCE0FD"
android:offset="0"
/>
<item
android:color="#FF88CCFC"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#B5DBF9"
android:fillType="evenOdd"
android:pathData="M433,604C386.9,554.2 287.7,401.1 287.7,401.1L288.9,398.6L482.9,562.5C495.9,571.9 514.5,571.8 527.4,562.2L715.8,401.3H735.7C735.7,401.3 633.2,546.9 580.5,604C527.9,661 479.1,653.7 433,604Z"
/>
<path
android:fillColor="#A8D3F6"
android:fillType="evenOdd"
android:pathData="M453.9,598.8C416.8,560.2 287.5,401.1 287.5,401.1L294,397.5L488.2,562.2C501.2,571.7 519.8,571.6 532.7,562L721.2,401.1H735.8C735.8,401.1 604.8,557 563.7,598.3C522.5,639.5 491,637.4 453.9,598.8Z"
/>
<path
android:fillColor="#93C5ED"
android:fillType="evenOdd"
android:pathData="M453.9,593C416.8,554.4 299.2,412.8 299.2,412.8L314.3,426.5L488.2,556.4C501.2,565.9 519.8,565.8 532.7,556.2L703.2,426.7L718.3,417.9C718.3,417.9 604.8,551.2 563.7,592.4C522.5,633.6 491,631.6 453.9,593Z"
/>
<path
android:fillColor="#7DB6E4"
android:fillType="evenOdd"
android:pathData="M453.5,580.8C416.5,542.2 305.4,414 305.4,414L314,414.4L487.9,544.3C500.9,553.7 519.5,553.6 532.4,544L702.9,414.6L711.9,413.9C711.9,413.9 604.5,539 563.3,580.3C522.2,621.5 490.6,619.4 453.5,580.8Z"
/>
<path android:pathData="M536.7,591.4L736.2,400.9C693.9,335.8 616,288.6 512.1,288.6C426.1,288.6 332.4,329.1 287.3,401.5L480.5,591.4C494.5,604 522.8,604 536.7,591.4Z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="511.8"
android:endY="807.9"
android:startX="511.2"
android:startY="332.7"
android:type="linear"
>
<item
android:color="#FFFFFFFF"
android:offset="0"
/>
<item
android:color="#FFBEE1FE"
android:offset="0.9"
/>
<item
android:color="#FF96CEFD"
android:offset="1"
/>
</gradient>
</aapt:attr>
</path>
<path
android:fillAlpha="0.6"
android:fillColor="#ffffff"
android:pathData="M736.4,400.7L537.4,591.1C519.7,603.6 500.9,604.6 482.4,593.2L287.2,401.4C292.7,392.5 299,384 305.9,376C312.9,382.5 319.7,388.9 326.4,395.1C377.7,443.2 419.1,482 477.5,531.8C503.9,554.3 512.1,553.9 537.9,531.8C604.8,474.8 653.6,431.6 717.2,374.9C724.3,383.1 730.7,391.7 736.4,400.7Z"
android:strokeAlpha="0.6"
/>
<path
android:fillColor="#ffffff"
android:pathData="M547.3,185.8C574.3,177.3 571.9,150.6 571.9,150.6C571.9,150.6 558.4,134.8 531.7,143.6C506.7,151.8 502.9,169.6 502.9,169.6C502.9,169.6 516.5,195.5 547.3,185.8Z"
/>
</vector>