Search in sources :

Example 26 with MenuInflater

use of android.view.MenuInflater in project android_frameworks_base by ParanoidAndroid.

the class TrackerActivity method onCreateOptionsMenu.

/**
     * Builds the menu
     *
     * @param menu - menu to add items to
     */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.menu, menu);
    return true;
}
Also used : MenuInflater(android.view.MenuInflater)

Example 27 with MenuInflater

use of android.view.MenuInflater in project NewPipe by TeamNewPipe.

the class DownloadActivity method onCreateOptionsMenu.

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

Example 28 with MenuInflater

use of android.view.MenuInflater in project NewPipe by TeamNewPipe.

the class MainActivity method onCreateOptionsMenu.

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

Example 29 with MenuInflater

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

the class ConversationActivity method onPrepareOptionsMenu.

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuInflater inflater = this.getMenuInflater();
    menu.clear();
    if (isSecureText) {
        if (recipients.getExpireMessages() > 0) {
            inflater.inflate(R.menu.conversation_expiring_on, menu);
            final MenuItem item = menu.findItem(R.id.menu_expiring_messages);
            final View actionView = MenuItemCompat.getActionView(item);
            final TextView badgeView = (TextView) actionView.findViewById(R.id.expiration_badge);
            badgeView.setText(ExpirationUtil.getExpirationAbbreviatedDisplayValue(this, recipients.getExpireMessages()));
            actionView.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {
                    onOptionsItemSelected(item);
                }
            });
        } else {
            inflater.inflate(R.menu.conversation_expiring_off, menu);
        }
    }
    if (isSingleConversation()) {
        if (isSecureText)
            inflater.inflate(R.menu.conversation_callable_secure, menu);
        else
            inflater.inflate(R.menu.conversation_callable_insecure, menu);
    } else if (isGroupConversation()) {
        inflater.inflate(R.menu.conversation_group_options, menu);
        if (!isPushGroupConversation()) {
            inflater.inflate(R.menu.conversation_mms_group_options, menu);
            if (distributionType == ThreadDatabase.DistributionTypes.BROADCAST) {
                menu.findItem(R.id.menu_distribution_broadcast).setChecked(true);
            } else {
                menu.findItem(R.id.menu_distribution_conversation).setChecked(true);
            }
        } else if (isActiveGroup()) {
            inflater.inflate(R.menu.conversation_push_group_options, menu);
        }
    }
    inflater.inflate(R.menu.conversation, menu);
    if (isSingleConversation() && isSecureText) {
        inflater.inflate(R.menu.conversation_secure, menu);
    } else if (isSingleConversation()) {
        inflater.inflate(R.menu.conversation_insecure, menu);
    }
    if (recipients != null && recipients.isMuted())
        inflater.inflate(R.menu.conversation_muted, menu);
    else
        inflater.inflate(R.menu.conversation_unmuted, menu);
    if (isSingleConversation() && getRecipients().getPrimaryRecipient().getContactUri() == null) {
        inflater.inflate(R.menu.conversation_add_to_contacts, menu);
    }
    super.onPrepareOptionsMenu(menu);
    return true;
}
Also used : MenuInflater(android.view.MenuInflater) OnClickListener(android.view.View.OnClickListener) MenuItem(android.view.MenuItem) TextView(android.widget.TextView) ReminderView(org.thoughtcrime.securesms.components.reminder.ReminderView) View(android.view.View) TextView(android.widget.TextView)

Example 30 with MenuInflater

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

the class ConversationListFragment method onCreateActionMode.

@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = getActivity().getMenuInflater();
    if (archive)
        inflater.inflate(R.menu.conversation_list_batch_unarchive, menu);
    else
        inflater.inflate(R.menu.conversation_list_batch_archive, menu);
    inflater.inflate(R.menu.conversation_list_batch, menu);
    mode.setTitle(R.string.conversation_fragment_cab__batch_selection_mode);
    mode.setSubtitle(getString(R.string.conversation_fragment_cab__batch_selection_amount, 1));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
    }
    return true;
}
Also used : MenuInflater(android.view.MenuInflater)

Aggregations

MenuInflater (android.view.MenuInflater)283 MenuItem (android.view.MenuItem)26 Intent (android.content.Intent)11 View (android.view.View)11 SearchView (android.support.v7.widget.SearchView)10 IconicsDrawable (com.mikepenz.iconics.IconicsDrawable)9 Menu (android.view.Menu)8 AdapterView (android.widget.AdapterView)8 SearchManager (android.app.SearchManager)5 Point (android.graphics.Point)5 TextView (android.widget.TextView)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 AdapterContextMenuInfo (android.widget.AdapterView.AdapterContextMenuInfo)4 EditText (android.widget.EditText)4 ImageView (android.widget.ImageView)4 ListView (android.widget.ListView)4