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);
}
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;
}
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);
}
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);
}
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);
}
Aggregations