Open jordenchang55 opened 8 years ago
The Bug is due to animations. mFab.hide() uses animation to hide the fab. But at the same time since bottomBar state changed it is trying to animate fab cancelling previous animation so hide animation is stopped. i will try to fix it in upcoming release. for now instead of
mFAB.hide()
try to call
mFAB.setVisibility
Yeah I have the same case and met this bug, longing for fixing it!
it work if you write it like this
override fun onTabSelected(position: Int) {
if (position == 2){
fab.visibility = View.GONE
}else{
fab.visibility = View.VISIBLE
}
}
I have 4 fragments and use BottomNavigation to switch between them. In some fragments, I don't want to use fab, so I try to call
mFAB.hide()
to hide it. No matter I call this method in activity or fragment, it just doesn't work, the button still there.But if I remove the line,
mBottomNavigationBar.setFab(mFAB)
, the button will show/hide as expected when switching between tabs.