Search in sources :

Example 11 with MenuItem

use of android.view.MenuItem in project Android-PullToRefresh by chrisbanes.

the class PullToRefreshGridActivity method onPrepareOptionsMenu.

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem setModeItem = menu.findItem(MENU_SET_MODE);
    setModeItem.setTitle(mPullRefreshGridView.getMode() == Mode.BOTH ? "Change to MODE_PULL_FROM_START" : "Change to MODE_PULL_BOTH");
    return super.onPrepareOptionsMenu(menu);
}
Also used : MenuItem(android.view.MenuItem)

Example 12 with MenuItem

use of android.view.MenuItem in project AnimeTaste by daimajia.

the class PlayActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.play, menu);
    MenuItem item = menu.findItem(R.id.menu_item_share);
    mFavMenuItem = menu.findItem(R.id.action_fav);
    mAnimation.checkIsFavorite(new Animation.UpdateFinishCallback() {

        @Override
        public void onUpdateFinished(Animation.Method method, Message msg) {
            if (msg.arg1 == 1) {
                runOnUiThread(new Runnable() {

                    @Override
                    public void run() {
                        mFavMenuItem.setIcon(R.drawable.ic_action_action_favorite);
                    }
                });
            }
        }
    });
    return true;
}
Also used : Message(android.os.Message) Animation(com.zhan_dui.model.Animation) MenuItem(android.view.MenuItem)

Example 13 with MenuItem

use of android.view.MenuItem in project barcodescanner by dm77.

the class FullScannerActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuItem menuItem;
    if (mFlash) {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    if (mAutoFocus) {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_formats, 0, R.string.formats);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_camera_selector, 0, R.string.select_camera);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    return super.onCreateOptionsMenu(menu);
}
Also used : MenuItem(android.view.MenuItem)

Example 14 with MenuItem

use of android.view.MenuItem in project barcodescanner by dm77.

the class FullScannerActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuItem menuItem;
    if (mFlash) {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    if (mAutoFocus) {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_formats, 0, R.string.formats);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_camera_selector, 0, R.string.select_camera);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    return super.onCreateOptionsMenu(menu);
}
Also used : MenuItem(android.view.MenuItem)

Example 15 with MenuItem

use of android.view.MenuItem in project barcodescanner by dm77.

the class FullScannerFragment method onCreateOptionsMenu.

public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);
    MenuItem menuItem;
    if (mFlash) {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_flash, 0, R.string.flash_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    if (mAutoFocus) {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_on);
    } else {
        menuItem = menu.add(Menu.NONE, R.id.menu_auto_focus, 0, R.string.auto_focus_off);
    }
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_formats, 0, R.string.formats);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
    menuItem = menu.add(Menu.NONE, R.id.menu_camera_selector, 0, R.string.select_camera);
    MenuItemCompat.setShowAsAction(menuItem, MenuItem.SHOW_AS_ACTION_NEVER);
}
Also used : MenuItem(android.view.MenuItem)

Aggregations

MenuItem (android.view.MenuItem)713 View (android.view.View)125 Intent (android.content.Intent)75 TextView (android.widget.TextView)66 ImageView (android.widget.ImageView)55 PopupMenu (android.widget.PopupMenu)54 Menu (android.view.Menu)47 SmallTest (android.test.suitebuilder.annotation.SmallTest)42 SearchView (android.support.v7.widget.SearchView)41 RecyclerView (android.support.v7.widget.RecyclerView)32 MenuInflater (android.view.MenuInflater)29 AdapterView (android.widget.AdapterView)27 ListView (android.widget.ListView)27 SubMenu (android.view.SubMenu)26 ComponentName (android.content.ComponentName)25 PackageManager (android.content.pm.PackageManager)24 Parcelable (android.os.Parcelable)23 Toolbar (android.support.v7.widget.Toolbar)19 ResolveInfo (android.content.pm.ResolveInfo)18 Bundle (android.os.Bundle)18