Skip to content

Instantly share code, notes, and snippets.

View mw-intive's full-sized avatar

Maksymilian Wójcik mw-intive

View GitHub Profile
@mw-intive
mw-intive / StyleByComposableVariants.kt
Last active September 16, 2023 15:52
Jetpack Compose style be composables variants
@Preview(
group = "Theming",
name = "Secondary Card",
device = PreviewConstants.PHONE_DEVICE_SPEC,
)
@Composable
fun SecondaryCard() {
PhonePreviewAppTheme(previewBackgroundColor = Color.Black) {
Column(
modifier = Modifier
@mw-intive
mw-intive / StyleWithLocalComposition.kt
Last active September 16, 2023 15:50
Jetpack compose style by LocalComposition
data class ThemingDataClass(
val tertiaryTextStyle: TextStyle = TextStyle.Default,
val subTextStyle: TextStyle = TextStyle.Default,
val subsubTextStyle1: TextStyle = TextStyle.Default,
val subsubTextStyle2: TextStyle = TextStyle.Default,
val subsubBackgroundColor: Color = Color.Unspecified
)
private val LocalThemingExample = compositionLocalOf { ThemingDataClass() }
@mw-intive
mw-intive / StyleByMainComposable.kt
Last active September 16, 2023 15:52
Jetpack Compose styling composables main factory
@Preview(
group = "Theming",
name = "Secondary Card",
device = PreviewConstants.PHONE_DEVICE_SPEC,
)
@Composable
fun SecondaryCard() {
PhonePreviewAppTheme(previewBackgroundColor = Color.Black) {
Column(
modifier = Modifier
@mw-intive
mw-intive / StyleByArgsExample.kt
Last active September 16, 2023 15:50
Jetpack Compose styling composable by args
@Preview(
group = "Theming",
name = "Secondary Card",
device = PreviewConstants.PHONE_DEVICE_SPEC,
)
@Composable
fun SecondaryCard() {
PhonePreviewAppTheme(previewBackgroundColor = Color.Black) {
Column(
modifier = Modifier