0
0
mirror of https://github.com/thunderbird/thunderbird-android.git synced 2024-09-20 04:02:14 +02:00

Change code style

This commit is contained in:
Wolf Montwé 2023-02-17 22:37:41 +01:00
parent 762992c0eb
commit dfdc37980e
No known key found for this signature in database
GPG Key ID: 6D45B21512ACBF72
10 changed files with 34 additions and 34 deletions

View File

@ -17,7 +17,7 @@ import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
@Composable
fun MainView() {
Column(
modifier = Modifier.fillMaxSize()
modifier = Modifier.fillMaxSize(),
) {
K9Theme {
MainContent(name = "K-9")
@ -36,7 +36,7 @@ fun MainView() {
@Composable
fun MainContent(
name: String
name: String,
) {
Surface(modifier = Modifier.fillMaxWidth(), color = MainTheme.colors.background) {
Column {

View File

@ -9,20 +9,20 @@ private val k9LightColorPalette = lightColors(
primary = material_gray_800,
primaryVariant = material_gray_700,
secondary = material_pink_500,
secondaryVariant = material_pink_300
secondaryVariant = material_pink_300,
)
private val k9DarkColorPalette = darkColors(
primary = material_gray_100,
primaryVariant = material_gray_50,
secondary = material_pink_300,
secondaryVariant = material_pink_500
secondaryVariant = material_pink_500,
)
@Composable
fun K9Theme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
content: @Composable () -> Unit,
) {
val images = Images(logo = app.k9mail.core.ui.compose.demo.R.drawable.logo_orange)
@ -32,6 +32,6 @@ fun K9Theme(
lightImages = images,
darkImages = images,
darkTheme = darkTheme,
content = content
content = content,
)
}

View File

@ -9,20 +9,20 @@ private val thunderbirdLightColorPalette = lightColors(
primary = material_blue_600,
primaryVariant = material_light_blue_500,
secondary = material_pink_500,
secondaryVariant = material_pink_300
secondaryVariant = material_pink_300,
)
private val thunderbirdDarkColorPalette = darkColors(
primary = material_blue_100,
primaryVariant = material_blue_50,
secondary = material_pink_300,
secondaryVariant = material_pink_500
secondaryVariant = material_pink_500,
)
@Composable
fun ThunderbirdTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
content: @Composable () -> Unit,
) {
val images = Images(logo = app.k9mail.core.ui.compose.demo.R.drawable.logo_teal)
@ -32,6 +32,6 @@ fun ThunderbirdTheme(
lightImages = images,
darkImages = images,
darkTheme = darkTheme,
content = content
content = content,
)
}

View File

@ -7,7 +7,7 @@ import androidx.compose.ui.unit.dp
@Immutable
data class Elevations(
val card: Dp = 0.dp
val card: Dp = 0.dp,
)
internal val LocalElevations = staticCompositionLocalOf { Elevations() }

View File

@ -6,7 +6,7 @@ import androidx.compose.runtime.staticCompositionLocalOf
@Immutable
data class Images(
@DrawableRes val logo: Int
@DrawableRes val logo: Int,
)
internal val LocalImages = staticCompositionLocalOf<Images> {

View File

@ -15,7 +15,7 @@ fun MainTheme(
lightImages: Images,
darkImages: Images,
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
content: @Composable () -> Unit,
) {
val colors = if (darkTheme) {
darkColorPalette
@ -32,13 +32,13 @@ fun MainTheme(
LocalElevations provides Elevations(),
LocalImages provides images,
LocalSizes provides Sizes(),
LocalSpacings provides Spacings()
LocalSpacings provides Spacings(),
) {
MaterialTheme(
colors = colors,
typography = typography,
shapes = shapes,
content = content
content = content,
)
}
}

View File

@ -7,5 +7,5 @@ import androidx.compose.ui.unit.dp
val shapes = Shapes(
small = RoundedCornerShape(8.dp),
medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp)
large = RoundedCornerShape(0.dp),
)

View File

@ -9,7 +9,7 @@ data class Sizes(
val small: Dp = 16.dp,
val medium: Dp = 32.dp,
val large: Dp = 64.dp,
val larger: Dp = 128.dp
val larger: Dp = 128.dp,
)
internal val LocalSizes = staticCompositionLocalOf { Sizes() }

View File

@ -11,7 +11,7 @@ data class Spacings(
val oneHalf: Dp = 12.dp,
val double: Dp = 16.dp,
val triple: Dp = 24.dp,
val quadruple: Dp = 32.dp
val quadruple: Dp = 32.dp,
)
internal val LocalSpacings = staticCompositionLocalOf { Spacings() }

View File

@ -11,80 +11,80 @@ val typography = typographyFromDefaults(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Light,
fontSize = 96.sp,
letterSpacing = (-1.5).sp
letterSpacing = (-1.5).sp,
),
h2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Light,
fontSize = 60.sp,
letterSpacing = (-0.5).sp
letterSpacing = (-0.5).sp,
),
h3 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 48.sp,
letterSpacing = 0.sp
letterSpacing = 0.sp,
),
h4 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 34.sp,
letterSpacing = 0.25.sp
letterSpacing = 0.25.sp,
),
h5 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 24.sp,
letterSpacing = 0.sp
letterSpacing = 0.sp,
),
h6 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 20.sp,
letterSpacing = 0.15.sp
letterSpacing = 0.15.sp,
),
subtitle1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
letterSpacing = 0.15.sp
letterSpacing = 0.15.sp,
),
subtitle2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
letterSpacing = 0.1.sp
letterSpacing = 0.1.sp,
),
body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
letterSpacing = 0.5.sp
letterSpacing = 0.5.sp,
),
body2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
letterSpacing = 0.25.sp
letterSpacing = 0.25.sp,
),
button = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
letterSpacing = 1.25.sp
letterSpacing = 1.25.sp,
),
caption = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 12.sp,
letterSpacing = 0.4.sp
letterSpacing = 0.4.sp,
),
overline = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 10.sp,
letterSpacing = 1.5.sp
)
letterSpacing = 1.5.sp,
),
)
fun typographyFromDefaults(
@ -100,7 +100,7 @@ fun typographyFromDefaults(
body2: TextStyle,
button: TextStyle,
caption: TextStyle,
overline: TextStyle
overline: TextStyle,
): Typography {
val defaults = Typography()
return Typography(
@ -116,6 +116,6 @@ fun typographyFromDefaults(
body2 = defaults.body2.merge(body2),
button = defaults.button.merge(button),
caption = defaults.caption.merge(caption),
overline = defaults.overline.merge(overline)
overline = defaults.overline.merge(overline),
)
}