Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -102,15 +104,15 @@ 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,
) {
val view = LocalView.current
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
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down