File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
commons/src/main/kotlin/org/fossify/commons/extensions Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ fun Window.setSystemBarsAppearance(backgroundColor: Int) {
1818 }
1919}
2020
21+ fun Window.setStatusBarAppearance (backgroundColor : Int ) {
22+ val isLightBackground = backgroundColor.getContrastColor() == DARK_GREY
23+ insetsController().isAppearanceLightStatusBars = isLightBackground
24+ }
25+
26+ fun Window.setNavigationBarAppearance (backgroundColor : Int ) {
27+ val isLightBackground = backgroundColor.getContrastColor() == DARK_GREY
28+ insetsController().isAppearanceLightNavigationBars = isLightBackground
29+ }
30+
2131fun Window.showBars () = insetsController().apply {
2232 systemBarsBehavior = WindowInsetsControllerCompat .BEHAVIOR_DEFAULT
2333 show(WindowInsetsCompat .Type .systemBars())
You can’t perform that action at this time.
0 commit comments