Renaud
05/19/2023, 11:38 AMval rubikFamily = FontFamily(
fonts = listOf(
Font(
resId = "font/rubik_italic.ttf", // Need R.
weight = FontWeight.W400,
)
)
)
andrew
05/19/2023, 7:37 PMAlejandro Rios
05/19/2023, 8:12 PMandrew
05/19/2023, 8:50 PMagrosner
05/20/2023, 1:30 AMJoel Denke
05/20/2023, 9:22 AMRenaud
05/22/2023, 12:35 PMdefaultFontFamily
is not visible for material3 (material only) 😞Joel Denke
05/22/2023, 12:38 PMUli Niggemann
05/23/2023, 1:41 PMJoel Denke
05/23/2023, 1:56 PMRenaud
05/24/2023, 9:23 AMUli Niggemann
05/24/2023, 9:29 AMRenaud
05/24/2023, 9:50 AMJoel Denke
05/24/2023, 11:11 AMUli Niggemann
05/24/2023, 12:39 PM@Composable
fun CustomMaterialTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
val colors = if (darkTheme) {
DarkColors
} else {
LightColors
}
MaterialTheme(
colorScheme = colors.copy(
primary = colorResource(MR.colors.sdBaseButtonFirstActiveBackground),
onPrimary = LightColors.onPrimary
),
typography = typography.copy(
headlineMedium = TextStyle.Default.copy(fontFamily = fontFamilyResource(MR.fonts.cormorant.italic), fontSize = 30.em)
),
shapes = shapes,
content = content
)
}
This updates the primary-color and the headline-font with some MR-Resources…
I am not sure if we could use it this way, but at least it works for ios & android, which is kinda cool.Renaud
05/24/2023, 1:48 PMUli Niggemann
05/24/2023, 1:52 PMRenaud
05/24/2023, 1:56 PM@OptIn(ExperimentalResourceApi::class)
to Moko, I have removed commonMain/resources/compose-multiplatform.xml
and delete the dependency and now iOS (and CocoaPods) is complaining that the resources does not exist anymoreUli Niggemann
05/24/2023, 2:00 PMJoel Denke
05/24/2023, 4:26 PM