-
Notifications
You must be signed in to change notification settings - Fork 105
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
Crash when using MDC Compose Theme Adapter #167
Comments
This assumption appears to have been correct - the offending context is from I realize that working around this limitation might be out of scope for this library, but I think it might be possible to work around the issue by 'forwarding' the theme of the parent context to the newly created context by |
Come to think of it - what is the reason that a configuration-context is created in this case? 🤔 Looking at the code, the following line: Showkase/showkase/src/main/java/com/airbnb/android/showkase/ui/ShowkaseComponentDetailScreen.kt Line 182 in 645af2e
Context in the RTLComponentCard -composable, and there was no observable difference.
Could the configuration-context be redundant in this case? |
@hedvigoscar I think you might be right. Afair, |
That's thoughtful of you, thanks! I'll have it up shortly. |
Done, check out #168 @vinaygaba 🙂 |
Fixed by #168 |
When using MDC Compose Theme Adapter (https://material-components.github.io/material-components-android-compose-theme-adapter/), and using
MdcTheme
in a@Preview
,ShowkaseBrowserActivity
crashes as the activity theme does not extendTheme.MaterialComponents
(crash occurs on the following line: https://github.com/material-components/material-components-android-compose-theme-adapter/blob/774fe521be155b3a4c342394462965bb7aa3a9d8/lib/src/main/java/com/google/android/material/composethemeadapter/MdcTheme.kt#L168).I attempted to work around the issue by overriding the theme declaration for
ShowkaseBrowserActivity
s theme:which partially solved the issue -
ShowkaseBrowserActivity
no longer crashes on rendering a@Composable
in theShowkaseComponentsInAGroupScreen
. The crash still happens onShowkaseComponentDetailScreen
, however, for reasons that are not entirely clear to me. I can only assume that it has to do with theContext
-manipulation used for the different preview-flavors has something to do with it.The text was updated successfully, but these errors were encountered: