Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
- Steps to reproduce the problem (including sample code if appropriate).
1. The task was to have customized action-views being spread in the Toolbar/BottomNavigationView so that these buttons will look simple, yet if there isn't enough space, use the overflow menu item for the remaining items
I tried to use both MaterialToolbar and BottomNavigationView , and both failed.
This is what I used for both kinds:
private fun fillMenuWithCustomizedItems(menu: Menu, parent: ViewGroup) {
for (i in 0..3) {
val title = "item $i"
val subtitle = if (i % 3 == 0) "Hi" else null
val itemBinding = ActionViewBinding.inflate(LayoutInflater.from(this), parent, false)
itemBinding.actionTitleTextView.setText(title)
itemBinding.actionImageView.setImageResource(R.drawable.do_not_disturb_rounded_sign)
itemBinding.actionSubtitleTextView.setTextOrHide(subtitle)
menu.add(title)
.setActionView(itemBinding.root)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM)
}
}
- What happened.
For MaterialToolbar , it presented only 2 items even though it has plenty of space, and I couldn't find a way to spread them
For BottomNavigationView it forces an item to be selected even though I chose not to, it colored it even though I chose not to, it has cut parts of the View (no icon), and visually I can see only one item.
Not only that, but it says I have a max number of items allowed...
- What you think the correct behavior should be.
Should be possible on both of these.
Also shouldn't have restrictions on number of items in a menu...
- Is this a security related issue? Yes/No
No.