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:
OxygenCobalt
2022-01-15 20:12:23 -07:00
parent 4dcc3c3b69
commit 95e8b06f19
11 changed files with 29 additions and 36 deletions
@@ -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
}
}