Search in sources :

Example 1 with MenuBinder

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);
}
Also used : MenuBinder(org.robobinding.MenuBinder)

Example 2 with MenuBinder

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);
}
Also used : MenuBinder(org.robobinding.MenuBinder)

Example 3 with MenuBinder

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);
}
Also used : MenuBinder(org.robobinding.MenuBinder)

Example 4 with MenuBinder

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);
}
Also used : MenuBinder(org.robobinding.MenuBinder)

Example 5 with MenuBinder

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;
        }
    });
}
Also used : MemoryProductStore(org.robobinding.gallery.model.MemoryProductStore) MenuBinder(org.robobinding.MenuBinder) MenuItem(android.view.MenuItem) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) OnItemLongClickListener(android.widget.AdapterView.OnItemLongClickListener) ContextualActionModePresentationModel(org.robobinding.gallery.presentationmodel.ContextualActionModePresentationModel) ListView(android.widget.ListView) ActionMode(android.support.v7.view.ActionMode) Menu(android.view.Menu)

Aggregations

MenuBinder (org.robobinding.MenuBinder)5 ActionMode (android.support.v7.view.ActionMode)1 Menu (android.view.Menu)1 MenuItem (android.view.MenuItem)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OnItemLongClickListener (android.widget.AdapterView.OnItemLongClickListener)1 ListView (android.widget.ListView)1 MemoryProductStore (org.robobinding.gallery.model.MemoryProductStore)1 ContextualActionModePresentationModel (org.robobinding.gallery.presentationmodel.ContextualActionModePresentationModel)1