Kyle Szalai
08/21/2023, 2:18 PMjava.lang.IllegalArgumentException: createMdcTheme requires the host context's theme to extend Theme.MaterialComponents at com.google.accompanist.themeadapter.material.MdcTheme.createMdcTheme(MdcTheme.kt:173) at com.google.accompanist.themeadapter.material.MdcTheme.createMdcTheme$default(MdcTheme.kt:162) at com.designlib.common.ThemeKt.AppTheme(Theme.kt:18)
Anyone know of a way around this? I know AS just uses the IDE to render previews, which wouldn't have a theme to pull from for createMdcTheme
Severiano Jaramillo
08/21/2023, 6:22 PM@Preview
@Composable
private fun YourComposablePreview() {
MdcTheme(context = ContextThemeWrapper(LocalContext.current, R.style.Your_Theme)) {
YourComposable(
...
)
}
}