I've implemented a custom ActionProvider
, not unlike the ShareActionProvider
. It is however a bit wider because I included a text label that is not present in the ShareActionProvider
.
I've noticed that regular action items (with SHOW_AS_ACTION_IF_ROOM
and SHOW_AS_ACTION_WITH_TEXT
) are displayed as just icons when in portrait configuration, and as icons with a label in landscape configuration in the action bar of my Galaxy Nexus phone. I presume that on different configurations this situation may differ. The intention of my custom added label is the same.
How can I check in code if my ActionProvider
, more specifically my equivalent of the ActivityChooserView
, should display the label or not? What future-proof way is there to get to this knowledge that is probably mostly in ActionMenuPresenter
? Are there any safe shortcuts I can take, such as just checking portrait or landscape? Or can it be notified somehow?
As a bonus question, the SHOW_AS_ACTION_IF_ROOM
seems to base itself on the number of action items, rather than their widths. As any ActionProvider
view is already very wide, it leaves no room for a title, and yet the other action item (with SHOW_AS_ACTION_IF_ROOM
) is not moved to the overflow menu. My custom ActionProvider
will be slightly larger than 50% of the width even on some devices, yet I thought this was a rule in ActionMenuPresenter
? How can I get better, yet still dynamic, control over this (at a high level)?