use of android.view.MenuItem in project cw-omnibus by commonsguy.
the class MainActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_actions, menu);
rc = (ReverseChronometer) menu.findItem(R.id.countdown).getActionView();
rc.setWarningDuration(5 * 60);
rc.setOnClickListener(this);
rc.setOnLongClickListener(this);
rc.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24);
rc.setTextColor(Color.WHITE);
if (durationInSeconds > 0) {
rc.setOverallDuration(durationInSeconds);
}
MenuItem item = menu.findItem(R.id.route_provider);
MediaRouteActionProvider provider = (MediaRouteActionProvider) MenuItemCompat.getActionProvider(item);
provider.setRouteSelector(selector);
return (super.onCreateOptionsMenu(menu));
}
use of android.view.MenuItem in project photo-picker-plus-android by chute.
the class FragmentSingle method onCreateOptionsMenu.
@SuppressLint("NewApi")
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuItem menuItemUse = menu.add(0, AssetActivity.USE_ITEM, 0, R.string.button_use_media);
menuItemUse.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
use of android.view.MenuItem in project photo-picker-plus-android by chute.
the class FragmentRoot method onCreateOptionsMenu.
@SuppressLint("NewApi")
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuItem menuItemUse = menu.add(0, AssetActivity.USE_ITEM, 0, R.string.button_use_media);
menuItemUse.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
use of android.view.MenuItem in project cw-omnibus by commonsguy.
the class QuestionsFragment method configureSearchView.
private void configureSearchView(Menu menu) {
MenuItem search = menu.findItem(R.id.search);
search.setOnActionExpandListener(this);
sv = (SearchView) search.getActionView();
sv.setOnQueryTextListener(this);
sv.setSubmitButtonEnabled(true);
sv.setIconifiedByDefault(true);
if (initialQuery != null) {
sv.setIconified(false);
search.expandActionView();
sv.setQuery(initialQuery, true);
}
}
use of android.view.MenuItem in project cw-omnibus by commonsguy.
the class MainActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.actions, menu);
MenuItem item = menu.findItem(R.id.share);
share = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
share.setOnShareTargetSelectedListener(this);
return (super.onCreateOptionsMenu(menu));
}
Aggregations