Code Cleanup
This commit is contained in:
parent
2517220f1b
commit
8331b22632
1 changed files with 4 additions and 8 deletions
|
@ -276,12 +276,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBottomBarVisibility(visible: Boolean) {
|
fun setBottomBarVisibility(visible: Boolean) {
|
||||||
bottomNavAnimator?.end()
|
|
||||||
if (!(visible && binding.bottomNavigationView.isVisible)) {
|
|
||||||
bottomNavAnimator = if (visible) {
|
|
||||||
binding.bottomNavigationView.translateYAnimate(0F)
|
|
||||||
} else null
|
|
||||||
}
|
|
||||||
binding.bottomNavigationView.isVisible = visible
|
binding.bottomNavigationView.isVisible = visible
|
||||||
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
|
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
|
||||||
}
|
}
|
||||||
|
@ -299,21 +293,23 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
libraryViewModel.setFabMargin(if (isVisible) dip(R.dimen.bottom_nav_height) else 0)
|
libraryViewModel.setFabMargin(if (isVisible) dip(R.dimen.bottom_nav_height) else 0)
|
||||||
ViewCompat.setElevation(binding.slidingPanel, 0f)
|
ViewCompat.setElevation(binding.slidingPanel, 0f)
|
||||||
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
||||||
collapsePanel()
|
|
||||||
} else {
|
} else {
|
||||||
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
|
||||||
bottomSheetBehavior.isHideable = false
|
bottomSheetBehavior.isHideable = false
|
||||||
|
if (bottomSheetBehavior.state == STATE_HIDDEN)
|
||||||
|
bottomSheetBehavior.state = STATE_EXPANDED
|
||||||
ViewCompat.setElevation(binding.slidingPanel, 10f)
|
ViewCompat.setElevation(binding.slidingPanel, 10f)
|
||||||
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
ViewCompat.setElevation(binding.bottomNavigationView, 10f)
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
println("List")
|
println("List")
|
||||||
bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs)
|
bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs)
|
||||||
|
bottomNavAnimator?.end()
|
||||||
|
bottomNavAnimator = binding.bottomNavigationView.translateYAnimate(0F)
|
||||||
libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets())
|
libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets())
|
||||||
} else {
|
} else {
|
||||||
println("Details")
|
println("Details")
|
||||||
bottomSheetBehavior.peekHeightAnimate(heightOfBar)
|
bottomSheetBehavior.peekHeightAnimate(heightOfBar)
|
||||||
bottomNavAnimator?.end()
|
bottomNavAnimator?.end()
|
||||||
getBottomNavigationView().isVisible = true
|
|
||||||
bottomNavAnimator =
|
bottomNavAnimator =
|
||||||
getBottomNavigationView().translateYAnimate(dip(R.dimen.bottom_nav_height).toFloat())
|
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