use of org.robobinding.MenuBinder in project RoboBinding-gallery by RoboBinding.
the class OptionMenuFragment method onCreateOptionsMenu.
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuBinder menuBinder = createMenuBinder(menu, inflater);
menuBinder.inflateAndBind(R.menu.options_menu, presentationModel);
}
use of org.robobinding.MenuBinder in project RoboBinding by RoboBinding.
the class Binders method inflateAndBindMenu.
public static void inflateAndBindMenu(Menu menu, MenuInflater menuInflater, int menuRes, Object presentationModel, Context context) {
MenuBinder menuBinder = newBinderFactory().createMenuBinder(menu, menuInflater, context);
menuBinder.inflateAndBind(menuRes, presentationModel);
}
use of org.robobinding.MenuBinder in project RoboBinding by RoboBinding.
the class Binders method inflateAndBindMenuWithoutPreInitializingViews.
public static void inflateAndBindMenuWithoutPreInitializingViews(Menu menu, MenuInflater menuInflater, int menuRes, Object presentationModel, Context context) {
MenuBinder menuBinder = newBinderFactory().createMenuBinder(menu, menuInflater, context, false);
menuBinder.inflateAndBind(menuRes, presentationModel);
}
use of org.robobinding.MenuBinder in project RoboBinding-gallery by RoboBinding.
the class ContextMenuDemoActivity method onCreateContextMenu.
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
MenuBinder menuBinder = createMenuBinder(menu, getMenuInflater());
menuBinder.inflateAndBind(R.menu.context_menu, contextMenuPresentationModel);
}
use of org.robobinding.MenuBinder in project RoboBinding-gallery by RoboBinding.
the class ContextualActionModeActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MemoryProductStore productStore = MemoryProductStore.getInstance();
productStore.reset();
presentationModel = new ContextualActionModePresentationModel(productStore);
initializeContentView(R.layout.activity_contextual_action_mode, presentationModel);
ListView productListView = (ListView) findViewById(R.id.productList);
productListView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
startSupportActionMode(new ActionMode.Callback() {
@Override
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
return false;
}
@Override
public void onDestroyActionMode(ActionMode actionMode) {
}
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
MenuBinder menuBinder = createMenuBinder(menu, getMenuInflater());
menuBinder.inflateAndBind(R.menu.contextual_action_mode, presentationModel);
return true;
}
@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
return false;
}
});
return true;
}
});
}
Aggregations