material-theme-builder icon indicating copy to clipboard operation
material-theme-builder copied to clipboard

Jetpack Compose Theme Build problem

Open SURIart opened this issue 1 year ago • 0 comments

The problem is the new color theme updated from material Theme builder doesn't make changes to the app. the issue lie in theme building function ->

fun AppTheme( darkTheme: Boolean = isSystemInDarkTheme(), // Dynamic color is available on Android 12+ dynamicColor: Boolean = true, content: @Composable () -> Unit ) { val colorScheme = when { dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { val context = LocalContext.current if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) }

    darkTheme -> darkScheme
    else -> lightScheme
}

due to the darkTheme and dynamicColor the changes made in theme color doesn't apply to the app

if the darktheme and dynamic color is made false the applied colors comes

but since the functionality is quite important in some apps it would nice if u rectify this issue

Screenshot 2024-08-21 222815 see the above the set colors are different from the app colors

SURIart avatar Aug 21 '24 16:08 SURIart