https://kotlinlang.org logo
#compose
Title
# compose
m

maciejciemiega

12/06/2021, 4:00 PM
Hey, I've just released AdvancedPreview - a library to customise system UI decoration of your Previews ✏️. Link to GitHub More info on Twitter or in 🧵 Here's an example comparison vs standard Preview annotation with enabled "showSystemUi" option.
❤️ 7
Currently it allows to customise: • Screen size with enabled system UI decoration • Background + icons colour for StatusBar and NavigationBar • Height of StatusBar and displayed time • Switching to Gesture navigation instead of "3 Buttons" • Edge-to-edge content, with built-in support for accompanist-insets
You can use it just to have nicer preview in Android Studio, but it's also useful if you: • Want to capture output of Preview and use it for documentation/marketing purposes. • Have automated capturing of Composables in code and would like to have system UI decoration there.
Some of the future plans are: • Predefined set of devices • Support for display cutouts • Manufacturer theming (different icons for e.g. Samsung)
c

Chris Sinco [G]

12/06/2021, 6:37 PM
Display cutouts would be awesome!
👍 1
Different icons from OEMs -> Squircles? 🤩
a

allan.conda

12/07/2021, 1:18 PM
Wow!
Save preview output for marketing or documentation purposes.
Have yet to check it out in detail, but any chance it can can be used for visual/screenshot testing? 🙂
m

maciejciemiega

12/07/2021, 8:16 PM
Well, I think it can, but it depends what exactly do you want to test with it. If you mean snapshot testing I think usually it's better to test Composables without system ui decoration. But maybe if you want to test e.g. if window insets support is not broken on the screen, then I guess it may help by delivering a "stable" decoration that you can control 🙂 Anyway, If you check it out I'm curious about your thoughts 😉
2 Views