Added smooth bottom nav hide and show animation
This commit is contained in:
parent
9b376a2f4f
commit
2673a1f0d0
1 changed files with 6 additions and 6 deletions
|
@ -280,9 +280,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
if (!(visible && binding.bottomNavigationView.isVisible)) {
|
if (!(visible && binding.bottomNavigationView.isVisible)) {
|
||||||
bottomNavAnimator = if (visible) {
|
bottomNavAnimator = if (visible) {
|
||||||
binding.bottomNavigationView.translateYAnimate(0F)
|
binding.bottomNavigationView.translateYAnimate(0F)
|
||||||
} else {
|
} else null
|
||||||
binding.bottomNavigationView.translateYAnimate(dip(R.dimen.bottom_nav_height).toFloat())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
binding.bottomNavigationView.isVisible = visible
|
binding.bottomNavigationView.isVisible = visible
|
||||||
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
|
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
|
||||||
|
@ -309,13 +307,15 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
println("List")
|
println("List")
|
||||||
if (bottomSheetBehavior.state != STATE_EXPANDED)
|
|
||||||
getBottomNavigationView().translateYAnimate(0F)
|
|
||||||
bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs)
|
bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs)
|
||||||
libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets())
|
libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets())
|
||||||
} else {
|
} else {
|
||||||
println("Details")
|
println("Details")
|
||||||
bottomSheetBehavior.peekHeight = heightOfBar
|
bottomSheetBehavior.peekHeightAnimate(heightOfBar)
|
||||||
|
bottomNavAnimator?.end()
|
||||||
|
getBottomNavigationView().isVisible = true
|
||||||
|
bottomNavAnimator =
|
||||||
|
getBottomNavigationView().translateYAnimate(dip(R.dimen.bottom_nav_height).toFloat())
|
||||||
libraryViewModel.setFabMargin(heightOfBar - windowInsets.safeGetBottomInsets())
|
libraryViewModel.setFabMargin(heightOfBar - windowInsets.safeGetBottomInsets())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue