Fix bottom bar judder when hiding UI.
This commit is contained in:
parent
2b4c01c106
commit
529211c3a5
1 changed files with 3 additions and 5 deletions
|
@ -280,13 +280,11 @@ class MediaPreviewV2Fragment : Fragment(R.layout.fragment_media_preview_v2), Med
|
||||||
private fun anchorMarginsToBottomInsets(viewToAnchor: View) {
|
private fun anchorMarginsToBottomInsets(viewToAnchor: View) {
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(viewToAnchor) { view: View, windowInsetsCompat: WindowInsetsCompat ->
|
ViewCompat.setOnApplyWindowInsetsListener(viewToAnchor) { view: View, windowInsetsCompat: WindowInsetsCompat ->
|
||||||
val layoutParams = view.layoutParams as MarginLayoutParams
|
val layoutParams = view.layoutParams as MarginLayoutParams
|
||||||
val systemBarInsets = windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
||||||
layoutParams.setMargins(
|
layoutParams.setMargins(
|
||||||
systemBarInsets.left,
|
windowInsetsCompat.getSystemWindowInsetLeft(),
|
||||||
layoutParams.topMargin,
|
layoutParams.topMargin,
|
||||||
systemBarInsets.right,
|
windowInsetsCompat.getSystemWindowInsetRight(),
|
||||||
systemBarInsets.bottom
|
windowInsetsCompat.getSystemWindowInsetBottom())
|
||||||
)
|
|
||||||
view.layoutParams = layoutParams
|
view.layoutParams = layoutParams
|
||||||
windowInsetsCompat
|
windowInsetsCompat
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue