-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom theming #77
base: main
Are you sure you want to change the base?
Custom theming #77
Conversation
because that is what we are implementing here
Inspired by Hema implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice seeing some more theming added to the template app! i left a couple of comments 🪄
SideEffect { | ||
val window = (view.context as Activity).window | ||
window.statusBarColor = colorScheme.primary.toArgb() | ||
window.statusBarColor = colors.accent.toArgb() | ||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason we are using this instead of enableEdgeToEdge()
?
https://developer.android.com/develop/ui/views/layout/edge-to-edge#enable-edge-to-edge-display
core/ui/src/main/kotlin/nl/q42/template/ui/theme/AppColorTokens.kt
Outdated
Show resolved
Hide resolved
core/ui/src/main/kotlin/nl/q42/template/ui/compose/composables/widgets/TemplateButton.kt
Outdated
Show resolved
Hide resolved
Onboarding-Package-Structure-Fix
Onboarding Package Structure Fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of minor improvements but nice work!
override val textPrimary = Black | ||
override val surface = White | ||
override val surfaceSelected = Color(0xff1b1b1b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its a very small nitpic but if we already started making the type explciit for the others, i would expect it to have it for all
val view = LocalView.current | ||
if (!view.isInEditMode) { | ||
SideEffect { | ||
val window = (view.context as Activity).window | ||
window.statusBarColor = colors.accent.toArgb() | ||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for?
typography: AppTypography = AppTheme.typography, | ||
colors: AppColorScheme = AppTheme.colors, | ||
shapes: AppShapes = AppTheme.shapes, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there shouldn't be a new line here
import nl.q42.template.ui.theme.PreviewLightDark | ||
|
||
@Composable | ||
fun TemplateButton(text: String, enabled: Boolean = true, onClick: () -> Unit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the naming differentiation between AppXYZ
and TemplateXYZ
things?
val White = Color(0xFFFFFFFF) | ||
val Gray10 = Color(0xFF1b1b1b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have a EOF new line?
val componentSpacingVertical = 24.dp | ||
/** Spacing between 2 vertically stacked buttons */ | ||
val buttonSpacingVertical = 8.dp | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we have a EOF new line?
style = AppTheme.typography.body, | ||
color = AppTheme.colors.error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to have this as a showcase screen on how to do things, the style & color here should be abstracted into a themed text component that directly use as the regular material Text
(similar to the buttons)
@@ -40,10 +40,8 @@ fun HomeSecondScreen( | |||
verticalArrangement = Arrangement.Center, | |||
) { | |||
|
|||
Text(viewState.title, style = MaterialTheme.typography.titleMedium) | |||
Text(viewState.title, style = AppTheme.typography.h1, color = AppTheme.colors.textPrimary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Why is this important?
Notes