Merge pull request #7788 from thunderbird/remove-material2-theme

Remove Material 2 theme
This commit is contained in:
Wolf-Martell Montwé 2024-04-25 17:41:40 +00:00 committed by GitHub
commit 6b54e8b65b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 60 additions and 1234 deletions

View file

@ -25,14 +25,12 @@ androidx.compose.foundation:foundation-layout:1.6.5
androidx.compose.foundation:foundation:1.6.5 androidx.compose.foundation:foundation:1.6.5
androidx.compose.material3:material3-android:1.2.1 androidx.compose.material3:material3-android:1.2.1
androidx.compose.material3:material3: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-android:1.6.5
androidx.compose.material:material-icons-core: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-android:1.6.5
androidx.compose.material:material-icons-extended: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-android:1.6.5
androidx.compose.material:material-ripple: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-android:1.6.5
androidx.compose.runtime:runtime-saveable-android:1.6.5 androidx.compose.runtime:runtime-saveable-android:1.6.5
androidx.compose.runtime:runtime-saveable:1.6.5 androidx.compose.runtime:runtime-saveable:1.6.5

View file

@ -25,14 +25,12 @@ androidx.compose.foundation:foundation-layout:1.6.5
androidx.compose.foundation:foundation:1.6.5 androidx.compose.foundation:foundation:1.6.5
androidx.compose.material3:material3-android:1.2.1 androidx.compose.material3:material3-android:1.2.1
androidx.compose.material3:material3: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-android:1.6.5
androidx.compose.material:material-icons-core: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-android:1.6.5
androidx.compose.material:material-icons-extended: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-android:1.6.5
androidx.compose.material:material-ripple: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-android:1.6.5
androidx.compose.runtime:runtime-saveable-android:1.6.5 androidx.compose.runtime:runtime-saveable-android:1.6.5
androidx.compose.runtime:runtime-saveable:1.6.5 androidx.compose.runtime:runtime-saveable:1.6.5

View file

@ -8,10 +8,10 @@ android {
} }
dependencies { dependencies {
api(projects.core.ui.compose.theme)
api(projects.core.ui.compose.theme2.common) api(projects.core.ui.compose.theme2.common)
debugApi(projects.core.ui.compose.theme2.k9mail) debugApi(projects.core.ui.compose.theme2.k9mail)
debugApi(projects.core.ui.compose.theme2.thunderbird)
implementation(libs.androidx.compose.material3) implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.extended) implementation(libs.androidx.compose.material.icons.extended)

View file

@ -7,10 +7,9 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.core.ui.compose.theme2.MainTheme import app.k9mail.core.ui.compose.theme2.MainTheme
import app.k9mail.core.ui.compose.theme2.k9mail.K9MailTheme2 import app.k9mail.core.ui.compose.theme2.k9mail.K9MailTheme2
import app.k9mail.core.ui.compose.theme2.thunderbird.ThunderbirdTheme2
@Composable @Composable
fun PreviewWithThemes( fun PreviewWithThemes(
@ -21,8 +20,6 @@ fun PreviewWithThemes(
modifier = modifier, modifier = modifier,
) { ) {
K9MailTheme2 { K9MailTheme2 {
// TODO remove once design system is migrated to theme2
K9Theme {
PreviewSurface { PreviewSurface {
Column { Column {
PreviewHeader(themeName = "K9Theme Light") PreviewHeader(themeName = "K9Theme Light")
@ -30,10 +27,7 @@ fun PreviewWithThemes(
} }
} }
} }
}
K9MailTheme2(darkTheme = true) { K9MailTheme2(darkTheme = true) {
// TODO remove once design system is migrated to theme2
K9Theme {
PreviewSurface { PreviewSurface {
Column { Column {
PreviewHeader(themeName = "K9Theme Dark") PreviewHeader(themeName = "K9Theme Dark")
@ -41,6 +35,21 @@ fun PreviewWithThemes(
} }
} }
} }
ThunderbirdTheme2 {
PreviewSurface {
Column {
PreviewHeader(themeName = "ThunderbirdTheme Light")
content()
}
}
}
ThunderbirdTheme2(darkTheme = true) {
PreviewSurface {
Column {
PreviewHeader(themeName = "ThunderbirdTheme Dark")
content()
}
}
} }
} }
} }
@ -60,6 +69,7 @@ fun PreviewWithTheme(
PreviewThemeType.K9MAIL -> { PreviewThemeType.K9MAIL -> {
PreviewWithK9MailTheme(isDarkTheme, content) PreviewWithK9MailTheme(isDarkTheme, content)
} }
PreviewThemeType.THUNDERBIRD -> { PreviewThemeType.THUNDERBIRD -> {
PreviewWithThunderbirdTheme(isDarkTheme, content) PreviewWithThunderbirdTheme(isDarkTheme, content)
} }
@ -71,12 +81,10 @@ private fun PreviewWithK9MailTheme(
isDarkTheme: Boolean, isDarkTheme: Boolean,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
K9MailTheme2(darkTheme = isDarkTheme) { K9MailTheme2(
// TODO remove once design system is migrated to theme2 darkTheme = isDarkTheme,
K9Theme(darkTheme = isDarkTheme) { content = content,
content() )
}
}
} }
@Composable @Composable
@ -84,13 +92,10 @@ private fun PreviewWithThunderbirdTheme(
isDarkTheme: Boolean, isDarkTheme: Boolean,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
// TODO replace with Thunderbird theme2 once available ThunderbirdTheme2(
K9MailTheme2(darkTheme = isDarkTheme) { darkTheme = isDarkTheme,
// TODO remove once design system is migrated to theme2 content = content,
ThunderbirdTheme(darkTheme = isDarkTheme) { )
content()
}
}
} }
@Composable @Composable

View file

@ -11,9 +11,7 @@ dependencies {
api(libs.turbine) api(libs.turbine)
api(libs.assertk) api(libs.assertk)
implementation(projects.core.ui.compose.theme)
implementation(projects.core.ui.compose.theme2.k9mail) implementation(projects.core.ui.compose.theme2.k9mail)
implementation(libs.androidx.compose.material)
implementation(libs.bundles.shared.jvm.test.compose) implementation(libs.bundles.shared.jvm.test.compose)
} }

View file

@ -13,7 +13,6 @@ import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.onRoot import androidx.compose.ui.test.onRoot
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme2.k9mail.K9MailTheme2 import app.k9mail.core.ui.compose.theme2.k9mail.K9MailTheme2
import org.junit.Rule import org.junit.Rule
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -43,11 +42,9 @@ fun ComposeTest.setContent(content: @Composable () -> Unit) = composeTestRule.se
*/ */
fun ComposeTest.setContentWithTheme(content: @Composable () -> Unit) = composeTestRule.setContent { fun ComposeTest.setContentWithTheme(content: @Composable () -> Unit) = composeTestRule.setContent {
K9MailTheme2 { K9MailTheme2 {
K9Theme {
content() content()
} }
} }
}
fun ComposeTest.onNodeWithTag( fun ComposeTest.onNodeWithTag(
tag: String, tag: String,

View file

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

View file

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

View file

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

View file

@ -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<Images> {
error("No LocalImages defined")
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

@ -1,150 +0,0 @@
<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="#1e88e5"
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="#3D97E6"
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="#1A76C6"
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

@ -25,7 +25,7 @@ dependencies {
implementation(projects.feature.account.common) implementation(projects.feature.account.common)
implementation(libs.appauth) implementation(libs.appauth)
implementation(libs.androidx.compose.material) implementation(libs.androidx.compose.material3)
implementation(libs.timber) implementation(libs.timber)
testImplementation(projects.core.ui.compose.testing) testImplementation(projects.core.ui.compose.testing)

View file

@ -4,16 +4,16 @@ import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.LinearOutSlowInEasing import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.tween import androidx.compose.animation.core.tween
import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredWidth import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.material.ButtonDefaults import androidx.compose.material3.ButtonDefaults
import androidx.compose.material.Icon import androidx.compose.material3.Icon
import androidx.compose.material.MaterialTheme import androidx.compose.material3.Surface
import androidx.compose.material.Surface import androidx.compose.material3.Text
import androidx.compose.material.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -25,7 +25,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import app.k9mail.feature.account.oauth.R import app.k9mail.feature.account.oauth.R
import androidx.compose.material.Button as MaterialButton import androidx.compose.material3.Button as Material3Button
/** /**
* A sign in with Google button, following the Google Branding Guidelines. * A sign in with Google button, following the Google Branding Guidelines.
@ -38,18 +38,18 @@ fun SignInWithGoogleButton(
onClick: () -> Unit, onClick: () -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
enabled: Boolean = true, enabled: Boolean = true,
isLight: Boolean = MaterialTheme.colors.isLight, isDark: Boolean = isSystemInDarkTheme(),
) { ) {
MaterialButton( Material3Button(
onClick = onClick, onClick = onClick,
modifier = modifier, modifier = modifier,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
contentColor = getTextColor(isLight), contentColor = getTextColor(isDark),
backgroundColor = getSurfaceColor(isLight), containerColor = getSurfaceColor(isDark),
), ),
border = BorderStroke( border = BorderStroke(
width = 1.dp, width = 1.dp,
color = getBorderColor(isLight), color = getBorderColor(isDark),
), ),
contentPadding = PaddingValues(all = 0.dp), contentPadding = PaddingValues(all = 0.dp),
enabled = enabled, enabled = enabled,
@ -96,28 +96,28 @@ fun SignInWithGoogleButton(
} }
@Suppress("MagicNumber") @Suppress("MagicNumber")
private fun getBorderColor(isLight: Boolean): Color { private fun getBorderColor(isDark: Boolean): Color {
return if (isLight) { return if (isDark) {
Color(0x87000000)
} else {
Color(0xFF4285F4) Color(0xFF4285F4)
} else {
Color(0x87000000)
} }
} }
@Suppress("MagicNumber") @Suppress("MagicNumber")
private fun getSurfaceColor(isLight: Boolean): Color { private fun getSurfaceColor(isDark: Boolean): Color {
return if (isLight) { return if (isDark) {
Color(0xFFFFFFFF)
} else {
Color(0xFF4285F4) Color(0xFF4285F4)
} else {
Color(0xFFFFFFFF)
} }
} }
@Suppress("MagicNumber") @Suppress("MagicNumber")
private fun getTextColor(isLight: Boolean): Color { private fun getTextColor(isDark: Boolean): Color {
return if (isLight) { return if (isDark) {
Color(0x87000000)
} else {
Color(0xFFFFFFFF) Color(0xFFFFFFFF)
} else {
Color(0x87000000)
} }
} }

View file

@ -121,7 +121,6 @@ androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "a
androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "androidxBiometric" } androidx-biometric = { module = "androidx.biometric:biometric", version.ref = "androidxBiometric" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidxComposeBom" } androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidxComposeBom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" } 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-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" } androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-material3-windowSizeClass = { module = "androidx.compose.material3:material3-window-size-class" } androidx-compose-material3-windowSizeClass = { module = "androidx.compose.material3:material3-window-size-class" }

View file

@ -76,7 +76,6 @@ include(
":core:android:testing", ":core:android:testing",
":core:ui:compose:common", ":core:ui:compose:common",
":core:ui:compose:designsystem", ":core:ui:compose:designsystem",
":core:ui:compose:theme",
":core:ui:compose:theme2:common", ":core:ui:compose:theme2:common",
":core:ui:compose:theme2:k9mail", ":core:ui:compose:theme2:k9mail",
":core:ui:compose:theme2:thunderbird", ":core:ui:compose:theme2:thunderbird",