style: extend edge-to-edge on all versions
Extend edge-to-edge to versions below Android Oreo. This is done through tinting the navigation bar colors on those versions, circumventing the coloring issue.
This commit is contained in:
@@ -54,11 +54,7 @@ class MainActivity : AppCompatActivity() {
|
||||
this, R.layout.activity_main
|
||||
)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||
applyEdgeToEdgeWindow(binding)
|
||||
} else {
|
||||
binding.root.fitsSystemWindows = true
|
||||
}
|
||||
applyEdgeToEdgeWindow(binding)
|
||||
|
||||
logD("Activity created.")
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ val WindowInsets.systemBarsCompat: Rect get() {
|
||||
}
|
||||
}
|
||||
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> {
|
||||
else -> {
|
||||
@Suppress("DEPRECATION")
|
||||
Rect(
|
||||
systemWindowInsetLeft,
|
||||
@@ -139,8 +139,6 @@ val WindowInsets.systemBarsCompat: Rect get() {
|
||||
systemWindowInsetBottom
|
||||
)
|
||||
}
|
||||
|
||||
else -> Rect(0, 0, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,13 +153,11 @@ fun WindowInsets.replaceInsetsCompat(left: Int, top: Int, right: Int, bottom: In
|
||||
.build()
|
||||
}
|
||||
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> {
|
||||
else -> {
|
||||
@Suppress("DEPRECATION")
|
||||
replaceSystemWindowInsets(
|
||||
left, top, right, bottom
|
||||
)
|
||||
}
|
||||
|
||||
else -> this
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user