mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
android: Use cutout insets on setup fragment
This commit is contained in:
parent
ee57aa83a4
commit
c930b2bad2
1 changed files with 6 additions and 5 deletions
|
@ -278,12 +278,13 @@ class SetupFragment : Fragment() {
|
||||||
|
|
||||||
private fun setInsets() =
|
private fun setInsets() =
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat ->
|
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view: View, windowInsets: WindowInsetsCompat ->
|
||||||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
|
||||||
view.setPadding(
|
view.setPadding(
|
||||||
insets.left,
|
barInsets.left + cutoutInsets.left,
|
||||||
insets.top,
|
barInsets.top + cutoutInsets.top,
|
||||||
insets.right,
|
barInsets.right + cutoutInsets.right,
|
||||||
insets.bottom
|
barInsets.bottom + cutoutInsets.bottom
|
||||||
)
|
)
|
||||||
windowInsets
|
windowInsets
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue