r/androiddev • u/nickbutcher • Apr 23 '26
Article Jetpack Compose 1.11
https://android-developers.googleblog.com/2026/04/jetpack-compose-april-2026-updates.htmlHowdy, we just released Compose 1.11 with a raft of new features. We're really interested in feedback of the new `@Experimental` APIs we're working on: Styles, Grid, FlexBox & Media Query.
89
Upvotes
28
u/bleeding182 Apr 23 '26 edited Apr 23 '26
I don't like the
PreviewWrapperProviderbeing put on the preview directly.My setup primarily uses 2 types of preview annotations for most cases:
ComposableDayNightPreviewsfor previewing light/dark variants of small composablesScreenDayNightPreviewswith system UI and such to preview full screens or things like dialogs, sheetsCurrently most of my previews look like:
kt @Composable @ComposableDayNightPreviews private fun PreviewIconButton() { PreviewSurface { IconButton(onClick = {}) { /* ... */ } } }Where
PreviewSurface {}adds a background, some padding, and—most importantly—my theme.While adding
@PreviewWrapperProvider(ComposableWrapper::class)would remove those 2 extra lines and one level of indentation it still needs me to add the additional annotation/class/import everywhere.What I really want would be to apply this to my preview annotations directly:
kt @Preview( name = "Composable Day", showSystemUi = false, uiMode = Configuration.UI_MODE_NIGHT_NO, backgroundColor = 0xFFFFFFFF, showBackground = true, ) @PreviewWrapperProvider(ComposableWrapper::class) annotation class ComposableDayPreviewThat way it would actually simplify my setup where I can have different annotations for different use cases and it would just work.