Search in sources :

Example 66 with MenuInflater

use of android.view.MenuInflater in project Signal-Android by WhisperSystems.

the class NewConversationActivity method onPrepareOptionsPanel.

@Override
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
    MenuInflater inflater = this.getMenuInflater();
    menu.clear();
    inflater.inflate(R.menu.new_conversation_activity, menu);
    super.onPrepareOptionsMenu(menu);
    return true;
}
Also used : MenuInflater(android.view.MenuInflater)

Example 67 with MenuInflater

use of android.view.MenuInflater in project XPrivacy by M66B.

the class ActivityMain method onCreateOptionsMenu.

// Options
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    if (inflater != null && PrivacyService.checkClient()) {
        // Inflate menu
        inflater.inflate(R.menu.main, menu);
        // Searchable
        SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.menu_search));
        if (searchView != null) {
            searchView.setIconifiedByDefault(false);
            searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {

                @Override
                public boolean onQueryTextChange(String newText) {
                    searchQuery = newText;
                    applyFilter();
                    return true;
                }

                @Override
                public boolean onQueryTextSubmit(String query) {
                    searchQuery = query;
                    applyFilter();
                    return true;
                }
            });
            searchView.setOnCloseListener(new SearchView.OnCloseListener() {

                @Override
                public boolean onClose() {
                    searchQuery = "";
                    applyFilter();
                    return true;
                }
            });
        }
        return true;
    } else
        return false;
}
Also used : SearchView(android.widget.SearchView) MenuInflater(android.view.MenuInflater)

Example 68 with MenuInflater

use of android.view.MenuInflater in project MWM-for-Android-Gen1 by MetaWatchOpenProjects.

the class MetaWatch method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu, menu);
    return true;
}
Also used : MenuInflater(android.view.MenuInflater)

Example 69 with MenuInflater

use of android.view.MenuInflater in project Context-Menu.Android by Yalantis.

the class MainActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(final Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu_main, menu);
    return true;
}
Also used : MenuInflater(android.view.MenuInflater)

Example 70 with MenuInflater

use of android.view.MenuInflater in project Carbon by ZieIony.

the class FloatingActionMenu method setMenu.

public void setMenu(int resId) {
    Menu menu = new MenuBuilder(new CarbonContextWrapper(getContentView().getContext()));
    MenuInflater inflater = new MenuInflater(getContentView().getContext());
    inflater.inflate(resId, menu);
    setMenu(menu);
}
Also used : MenuInflater(android.view.MenuInflater) CarbonContextWrapper(carbon.CarbonContextWrapper) Menu(android.view.Menu) MenuBuilder(android.support.v7.view.menu.MenuBuilder)

Aggregations

MenuInflater (android.view.MenuInflater)304 MenuItem (android.view.MenuItem)32 View (android.view.View)16 Intent (android.content.Intent)12 AdapterView (android.widget.AdapterView)12 SearchView (android.support.v7.widget.SearchView)11 PopupMenu (android.widget.PopupMenu)10 TextView (android.widget.TextView)10 Menu (android.view.Menu)9 IconicsDrawable (com.mikepenz.iconics.IconicsDrawable)9 ListView (android.widget.ListView)8 SearchManager (android.app.SearchManager)6 Point (android.graphics.Point)5 AdapterContextMenuInfo (android.widget.AdapterView.AdapterContextMenuInfo)5 ImageView (android.widget.ImageView)5 MenuBuilder (com.android.internal.view.menu.MenuBuilder)5 ActionBar (android.app.ActionBar)4 Cursor (android.database.Cursor)4 MenuBuilder (android.support.v7.view.menu.MenuBuilder)4 SpannableString (android.text.SpannableString)4