From e247e56aeed8af491d40f0fb8b2f13cdd544a578 Mon Sep 17 00:00:00 2001 From: Prathamesh More Date: Fri, 22 Oct 2021 21:22:57 +0530 Subject: [PATCH] Fixed bottom sheet not dragging when bottom navigation was invisible --- .../activities/base/AbsSlidingMusicPanelActivity.kt | 5 +++++ app/src/main/res/values/styles.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 e60d655c..e1cb26e4 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 @@ -20,6 +20,7 @@ import android.view.View import android.view.ViewGroup import android.view.ViewTreeObserver import android.widget.FrameLayout +import androidx.core.animation.doOnEnd import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.isVisible @@ -311,6 +312,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { bottomSheetBehavior.peekHeightAnimate(heightOfBarWithTabs) bottomNavAnimator?.end() bottomNavAnimator = binding.bottomNavigationView.translateYAnimate(0F) + binding.bottomNavigationView.bringToFront() libraryViewModel.setFabMargin(heightOfBarWithTabs - windowInsets.safeGetBottomInsets()) } else { println("Details") @@ -318,6 +320,9 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { bottomNavAnimator?.end() bottomNavAnimator = getBottomNavigationView().translateYAnimate(dip(R.dimen.bottom_nav_height).toFloat()) + bottomNavAnimator?.doOnEnd { + binding.slidingPanel.bringToFront() + } libraryViewModel.setFabMargin(heightOfBar - windowInsets.safeGetBottomInsets()) } } diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d28fc9c1..dadb45e8 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -191,7 +191,7 @@