alorma
07/29/2021, 5:21 AMaccompanist system ui controller lib, following this:
https://google.github.io/accompanist/systemuicontroller/
But i found that on light theme icons are not show :SAlbert Chang
07/29/2021, 5:28 AMWindowCompat.setDecorFitsSystemWindows(window, false) to extend your UI and show something behind the status bar yourself, otherwise since the bar is transparent the default surface color is displayed and dark icons won't be recognizable.alorma
07/29/2021, 5:29 AMalorma
07/29/2021, 5:29 AMval systemUiController = rememberSystemUiController()
val useDarkIcons = MaterialTheme.colors.isLight
val colorPrimary = MaterialTheme.colors.primaryVariant
SideEffect {
systemUiController.setStatusBarColor(
color = colorPrimary,
darkIcons = useDarkIcons,
)
}alorma
07/29/2021, 5:30 AMalorma
07/29/2021, 5:30 AMandroid:theme="@android:style/Theme.NoTitleBar"
If I use a material theme, it shows correctAlbert Chang
07/29/2021, 5:33 AMAlbert Chang
07/29/2021, 5:35 AM@android:style/Theme.Material.NoActionBar and @android:style/Theme.Material.Light.NoActionBar.alorma
07/29/2021, 5:39 AMalorma
07/29/2021, 5:39 AMAlbert Chang
07/29/2021, 5:39 AMalorma
07/29/2021, 5:39 AMalorma
07/29/2021, 5:40 AM@android version of material themesalorma
07/29/2021, 5:40 AMAppCompat and Material libraries looks so... scary it has been so many years using themColton Idle
07/29/2021, 5:41 AMAlbert Chang
07/29/2021, 5:43 AM<style name="Theme.MyApp" parent="android:Theme.Material.Light.NoActionBar" />
values-night/themes.xml:
<style name="Theme.MyApp" parent="android:Theme.Material.NoActionBar" />alorma
07/29/2021, 5:50 AMColton Idle
07/29/2021, 5:59 AMAlbert Chang
07/29/2021, 6:01 AM