Skip to content

Commit 7434f57

Browse files
committed
Fix android lint issue
1 parent 874d6b2 commit 7434f57

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

WordPress/src/main/java/org/wordpress/android/util/extensions/WindowExtensions.kt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,20 @@ fun Window.setLightNavigationBar(showInLightMode: Boolean, applyDefaultColors: B
4545
}
4646

4747
fun Window.setTransparentSystemBars(isTransparent: Boolean) {
48-
if (isTransparent) {
49-
when (VERSION.SDK_INT >= VERSION_CODES.R) {
50-
true -> setDecorFitsSystemWindows(false)
51-
false -> addFlags(LayoutParams.FLAG_LAYOUT_NO_LIMITS)
48+
when (isTransparent) {
49+
true -> {
50+
if (VERSION.SDK_INT >= VERSION_CODES.R) {
51+
setDecorFitsSystemWindows(false)
52+
} else {
53+
addFlags(LayoutParams.FLAG_LAYOUT_NO_LIMITS)
54+
}
5255
}
53-
} else {
54-
when (VERSION.SDK_INT >= VERSION_CODES.R) {
55-
true -> setDecorFitsSystemWindows(true)
56-
false -> clearFlags(LayoutParams.FLAG_LAYOUT_NO_LIMITS)
56+
false -> {
57+
if (VERSION.SDK_INT >= VERSION_CODES.R) {
58+
setDecorFitsSystemWindows(true)
59+
} else {
60+
clearFlags(LayoutParams.FLAG_LAYOUT_NO_LIMITS)
61+
}
5762
}
5863
}
5964
}

0 commit comments

Comments
 (0)