Search in sources :

Example 91 with MenuItem

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));
}
Also used : MediaRouteActionProvider(android.support.v7.app.MediaRouteActionProvider) MenuItem(android.view.MenuItem)

Example 92 with MenuItem

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);
}
Also used : MenuItem(android.view.MenuItem) SuppressLint(android.annotation.SuppressLint)

Example 93 with MenuItem

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);
}
Also used : MenuItem(android.view.MenuItem) SuppressLint(android.annotation.SuppressLint)

Example 94 with MenuItem

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);
    }
}
Also used : MenuItem(android.view.MenuItem)

Example 95 with MenuItem

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));
}
Also used : MenuItem(android.view.MenuItem)

Aggregations

MenuItem (android.view.MenuItem)761 View (android.view.View)140 Intent (android.content.Intent)86 TextView (android.widget.TextView)78 PopupMenu (android.widget.PopupMenu)62 ImageView (android.widget.ImageView)58 Menu (android.view.Menu)52 SearchView (android.support.v7.widget.SearchView)46 SmallTest (android.test.suitebuilder.annotation.SmallTest)42 RecyclerView (android.support.v7.widget.RecyclerView)36 MenuInflater (android.view.MenuInflater)35 AdapterView (android.widget.AdapterView)33 ListView (android.widget.ListView)32 SubMenu (android.view.SubMenu)30 ComponentName (android.content.ComponentName)25 PackageManager (android.content.pm.PackageManager)25 Parcelable (android.os.Parcelable)24 Toolbar (android.support.v7.widget.Toolbar)24 Bundle (android.os.Bundle)19 PopupMenu (android.support.v7.widget.PopupMenu)19