From 2459979f13af3acbe470e39f1177cfd8d8a42569 Mon Sep 17 00:00:00 2001 From: ShiftHackZ Date: Wed, 20 Dec 2023 22:53:41 +0200 Subject: [PATCH 1/2] Expose statusBarColor in CatppuccinTheme.Custom --- .../com/shifthackz/catppuccin/compose/CatppuccinTheme.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compose/src/main/java/com/shifthackz/catppuccin/compose/CatppuccinTheme.kt b/compose/src/main/java/com/shifthackz/catppuccin/compose/CatppuccinTheme.kt index 051c898..39dda28 100644 --- a/compose/src/main/java/com/shifthackz/catppuccin/compose/CatppuccinTheme.kt +++ b/compose/src/main/java/com/shifthackz/catppuccin/compose/CatppuccinTheme.kt @@ -11,6 +11,7 @@ import androidx.compose.material3.Shapes import androidx.compose.material3.Typography 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.graphics.luminance @@ -90,6 +91,7 @@ object CatppuccinTheme { * @param colorScheme A complete definition of the Material Color theme for this hierarchy. * @param typography A set of text styles to be used as this hierarchy's typography system. * @param shapes A set of corner shapes to be used as this hierarchy's shape system. + * @param statusBarColor A color to paint status bar with, by default uses surface theme color. * @param isAppearanceLightStatusBars If true, changes the foreground color of the status bars * to light so that the items on the bar can be read clearly. * @param content Child composable UI to theme. @@ -102,6 +104,7 @@ object CatppuccinTheme { colorScheme: ColorScheme = Catppuccin.Latte.colorScheme(), typography: Typography = Catppuccin.Latte.typography(), shapes: Shapes = MaterialTheme.shapes, + statusBarColor: Color = colorScheme.surface, isAppearanceLightStatusBars: Boolean, content: @Composable () -> Unit, ) { @@ -109,8 +112,7 @@ object CatppuccinTheme { if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window - val statusBarColor = colorScheme.surface.toArgb() - window.statusBarColor = statusBarColor + window.statusBarColor = statusBarColor.toArgb() WindowCompat .getInsetsController(window, view) .isAppearanceLightStatusBars = isAppearanceLightStatusBars From 9effa74a291bb2c68c0619af7a2383f78f3517ea Mon Sep 17 00:00:00 2001 From: ShiftHackZ Date: Wed, 20 Dec 2023 22:55:04 +0200 Subject: [PATCH 2/2] Bump version 0.1.2 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5198365..bea25e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -catppuccin = "0.1.1" +catppuccin = "0.1.2" activityCompose = "1.8.2" androidGradlePlugin = "8.2.0" kotlin = "1.9.10"