Fixed bottom sheet not dragging when bottom navigation was invisible

This commit is contained in:
Prathamesh More 2021-10-22 21:22:57 +05:30
parent f3ebd34531
commit e247e56aee
2 changed files with 6 additions and 1 deletions

View file

@ -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())
}
}

View file

@ -191,7 +191,7 @@
<style name="BottomSheetStyle" parent="Widget.Material3.BottomSheet">
<item name="android:maxWidth">@empty</item>
<item name="android:backgroundTint">?attr/bottomSheetTint</item>
<item name="enableEdgeToEdge">true</item>
<item name="gestureInsetBottomIgnored">true</item>
</style>
<style name="MaterialCardViewStroke">