[BottomNavigation] Hide BottomNavigation when only one tab is selected in Library Categories
This commit is contained in:
parent
357275001e
commit
f7620ca640
1 changed files with 10 additions and 0 deletions
|
@ -87,6 +87,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
private val panelState: Int
|
private val panelState: Int
|
||||||
get() = bottomSheetBehavior.state
|
get() = bottomSheetBehavior.state
|
||||||
private lateinit var binding: SlidingMusicPanelLayoutBinding
|
private lateinit var binding: SlidingMusicPanelLayoutBinding
|
||||||
|
private var isInOneTabMode = false
|
||||||
|
|
||||||
private var navigationBarColorAnimator: ValueAnimator? = null
|
private var navigationBarColorAnimator: ValueAnimator? = null
|
||||||
private val argbEvaluator: ArgbEvaluator = ArgbEvaluator()
|
private val argbEvaluator: ArgbEvaluator = ArgbEvaluator()
|
||||||
|
@ -340,6 +341,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (binding.bottomNavigationView.menu.size() == 1) {
|
if (binding.bottomNavigationView.menu.size() == 1) {
|
||||||
|
isInOneTabMode = true
|
||||||
binding.bottomNavigationView.hide()
|
binding.bottomNavigationView.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -352,6 +354,14 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setBottomNavVisibility(visible: Boolean, animate: Boolean = false, hideBottomSheet: Boolean = MusicPlayerRemote.playingQueue.isEmpty()) {
|
fun setBottomNavVisibility(visible: Boolean, animate: Boolean = false, hideBottomSheet: Boolean = MusicPlayerRemote.playingQueue.isEmpty()) {
|
||||||
|
if (isInOneTabMode) {
|
||||||
|
hideBottomSheet(
|
||||||
|
hide = hideBottomSheet,
|
||||||
|
animate = animate,
|
||||||
|
isBottomNavVisible = false
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
val translationY =
|
val translationY =
|
||||||
if (visible) 0F else dip(R.dimen.bottom_nav_height).toFloat() + windowInsets.safeGetBottomInsets()
|
if (visible) 0F else dip(R.dimen.bottom_nav_height).toFloat() + windowInsets.safeGetBottomInsets()
|
||||||
val mAnimate = animate && bottomSheetBehavior.state == STATE_COLLAPSED
|
val mAnimate = animate && bottomSheetBehavior.state == STATE_COLLAPSED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue