Is there a way to setup Run Preview so it doesn't ...
# compose-android
b
Is there a way to setup Run Preview so it doesn't show a default action bar/ Top App Bar? I'm not sure Compose Run Previews go off of the Android Manifest at all or what, but it kinda makes it hard to test insets and stuff in Run Preview. I mean it looks great in the static IDE preview.
a
You can utilize manifest merging to change things like the theme: https://github.com/alexvanyo/composelife/blob/27bfca7619ed52f69e0da2fcd3890da355bf3c2b/ui-tooling-preview/src/androidMain/AndroidManifest.xml#L20 The
PreviewActivity
is just a normal Activity, that gets launched to preview UI
Specifically by changing the theme to something that extends from
NoActionBar
you can avoid the app bar
b
Interesting. Yeah my AndroidManifest uses a theme we have defined which references a lot of Material/2 stuff since most of our app is M2, but now we're adding M3, and it's these M3 components that are showing the NoActionBar. I haven't done anything inside styles.xml regarding M3, trying to figure out how to go about doing that
t
FINALLY A SOLUTION FOR THIS! Thanks a lot @Alex Vanyo! I've asked here before exactly about that but got no solution. Is this fix something new or was it always possible?
Still it doesn't hide it from the Preview inside the AS 😕 We can't use the preview to check if the content is respecting the statusbar padding for example
a
Preview in AS uses the application theme, if you have the application theme extend from a
NoActionBar
theme you should be able to avoid the bar
today i learned 1