Fixed bottom insets in Gradient theme
This commit is contained in:
parent
ef1d24d7f9
commit
76fc04cc99
2 changed files with 7 additions and 1 deletions
|
@ -81,6 +81,7 @@ class GradientPlayerFragment : AbsPlayerFragment(R.layout.fragment_gradient_play
|
||||||
private var recyclerViewTouchActionGuardManager: RecyclerViewTouchActionGuardManager? = null
|
private var recyclerViewTouchActionGuardManager: RecyclerViewTouchActionGuardManager? = null
|
||||||
private var playingQueueAdapter: PlayingQueueAdapter? = null
|
private var playingQueueAdapter: PlayingQueueAdapter? = null
|
||||||
private lateinit var linearLayoutManager: LinearLayoutManager
|
private lateinit var linearLayoutManager: LinearLayoutManager
|
||||||
|
private var bottomInsets = 0
|
||||||
|
|
||||||
private var _binding: FragmentGradientPlayerBinding? = null
|
private var _binding: FragmentGradientPlayerBinding? = null
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
@ -91,6 +92,9 @@ class GradientPlayerFragment : AbsPlayerFragment(R.layout.fragment_gradient_play
|
||||||
binding.playerQueueSheet.updatePadding(
|
binding.playerQueueSheet.updatePadding(
|
||||||
top = (slideOffset * binding.statusBarLayout.statusBar.height).toInt()
|
top = (slideOffset * binding.statusBarLayout.statusBar.height).toInt()
|
||||||
)
|
)
|
||||||
|
binding.container.updatePadding(
|
||||||
|
bottom = ((1 - slideOffset) * bottomInsets).toInt()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
||||||
|
@ -157,7 +161,8 @@ class GradientPlayerFragment : AbsPlayerFragment(R.layout.fragment_gradient_play
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(
|
ViewCompat.setOnApplyWindowInsetsListener(
|
||||||
(binding.container)
|
(binding.container)
|
||||||
) { v: View, insets: WindowInsetsCompat ->
|
) { v: View, insets: WindowInsetsCompat ->
|
||||||
v.updatePadding(bottom = insets.safeGetBottomInsets())
|
bottomInsets = insets.safeGetBottomInsets()
|
||||||
|
v.updatePadding(bottom = bottomInsets)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
binding.playbackControlsFragment.root.drawAboveSystemBars()
|
binding.playbackControlsFragment.root.drawAboveSystemBars()
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:behavior_hideable="false"
|
app:behavior_hideable="false"
|
||||||
|
app:gestureInsetBottomIgnored="true"
|
||||||
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
|
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
Loading…
Reference in a new issue