From 8331b226321a4269bdee9c08ffa0a27d416c7ecd Mon Sep 17 00:00:00 2001 From: Prathamesh More Date: Thu, 14 Oct 2021 13:41:01 +0530 Subject: [PATCH] Code Cleanup --- .../activities/base/AbsSlidingMusicPanelActivity.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt index 3493563c..168a7e96 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt @@ -276,12 +276,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { } fun setBottomBarVisibility(visible: Boolean) { - bottomNavAnimator?.end() - if (!(visible && binding.bottomNavigationView.isVisible)) { - bottomNavAnimator = if (visible) { - binding.bottomNavigationView.translateYAnimate(0F) - } else null - } binding.bottomNavigationView.isVisible = visible hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty()) } @@ -299,21 +293,23 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { libraryViewModel.setFabMargin(if (isVisible) dip(R.dimen.bottom_nav_height) else 0) ViewCompat.setElevation(binding.slidingPanel, 0f) ViewCompat.setElevation(binding.bottomNavigationView, 10f) - collapsePanel() } else { if (MusicPlayerRemote.playingQueue.isNotEmpty()) { bottomSheetBehavior.isHideable = false + if (bottomSheetBehavior.state == STATE_HIDDEN) + bottomSheetBehavior.state = STATE_EXPANDED ViewCompat.setElevation(binding.slidingPanel, 10f) ViewCompat.setElevation(binding.bottomNavigationView, 10f) if (isVisible) { println("List") bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs) + bottomNavAnimator?.end() + bottomNavAnimator = binding.bottomNavigationView.translateYAnimate(0F) libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets()) } else { println("Details") bottomSheetBehavior.peekHeightAnimate(heightOfBar) bottomNavAnimator?.end() - getBottomNavigationView().isVisible = true bottomNavAnimator = getBottomNavigationView().translateYAnimate(dip(R.dimen.bottom_nav_height).toFloat()) libraryViewModel.setFabMargin(heightOfBar - windowInsets.safeGetBottomInsets())