How to hide tooltips on menuItem's in BottomNavigationView ? Now i can't get how to control this behaviour. I'm already tried something like this:
for (item in vBottomNavigation.children) {
TooltipCompat.setTooltipText(item, null)
}
or
TooltipCompat.setTooltipText(vBottomNavigation, null)
or finally
vBottomNavigation.setOnLongClickListener {
true
}
But nothing worked, also i tried set tooltipText in menu resources to @null or empty string, but anyway i see tooltips on long press on bottom menu items.
I want to control visibility of tooltips on the bottomnavigation view. Any ideas ?
If you do not want to show this tooltip on long click, you can override BottomNavigationItemView's long click behavior by setting OnLongClickListener to the menu items, like the code below(I tried this solution with BottomNavigationView from material components with the following version: com.google.android.material:material:1.2.0-alpha04
)
:
bottomNavigation.menu.forEach {
val view = bottomNavigation.findViewById<View>(it.itemId)
view.setOnLongClickListener {
// your logic here
true
}
}
Note that this tooltip behavior is set to each BottomNavigationItemView that BottomNavigationView inflates on its constructor, so the tooltip behavior is not set to BottomNavigationView itself.