You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I encounter is, that I am trying to hide my bottom navigation bar, but it does not work 100%. When I click on an edittext, the bottomnav is hidden and everything is fine. But when I close the keyboard, the bottom nav blinks for a second above the keyboard and this looks hideous
fun Fragment.hideBottomNavWhenKeyboardClicked() {
KeyboardVisibilityEvent.setEventListener(
requireActivity(),
viewLifecycleOwner,
object : KeyboardVisibilityEventListener {
override fun onVisibilityChanged(isOpen: Boolean) {
if (isOpen) hideBottomNav() else showBottomNav()
}
}
)
}
fun Fragment.hideBottomNav() {
if ((requireActivity() as MainActivity).isBottomNavVisible()) (requireActivity() as MainActivity).hideBottomNav()
}
fun Fragment.showBottomNav() {
if (!(requireActivity() as MainActivity).isBottomNavVisible()) (requireActivity() as MainActivity).showBottomNav()
}
fun isBottomNavVisible(): Boolean {
return binding.bottomNavigationView.visibility == View.VISIBLE
}
The text was updated successfully, but these errors were encountered:
your Activity's
windowSoftInputMode
: AdjustresizeAndroid version: 10
Android device: Pixel 3 XL API 29
and other stuff you think might be helpful:
The problem I encounter is, that I am trying to hide my bottom navigation bar, but it does not work 100%. When I click on an edittext, the bottomnav is hidden and everything is fine. But when I close the keyboard, the bottom nav blinks for a second above the keyboard and this looks hideous
What am I doing wrong here?
Code:
The text was updated successfully, but these errors were encountered: