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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
If I want to use menu groups with id to change visibility of items between activity state changes I cannot use android annotations because I need the Menu instance to call method setGroupVisibile. There is a way to get the menu via android annotations like:
@EActivity
@OptionsMenu(R.menu.my_menu)
public class MyActivity extends Activity {
@OptionMenu
protected Menu menu;
....
private void toggleState() {
menu.setGroupVisibile(R.id.mnu_my_menu_grp_my_group1, false);
menu.setGroupVisibile(R.id.mnu_my_menu_grp_my_group2, true);
}
}
My current work arround is to override the onCreateOptionsMenu method:
Activity
WonderCsabo commentedon May 10, 2015
So actually you want to inject the
Menuwith@InjectMenu(or sg) just likeMenuItemwith@OptionsMenuItem?KleinerHacker commentedon May 10, 2015
Yes, but an annotation with this functionality does not exists.
WonderCsabo commentedon May 10, 2015
I know. 😉
I think this should be a useful feature. @yDelouis @dodgex WDYT?
[-]Support for Menu Groups[/-][+]Inject a Menu[/+]dodgex commentedon May 10, 2015
this could indeed be usefull.
WonderCsabo commentedon May 10, 2015
Thanks!
@KleinerHacker i am marking this as an enhancement, but this is the end of our queue now. Contributions are welcome.
WonderCsabo commentedon Jun 9, 2015
Implemented.