Tabnine Logo
PopupMenu.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
androidx.appcompat.widget.PopupMenu
constructor

Best Java code snippets using androidx.appcompat.widget.PopupMenu.<init> (Showing top 17 results out of 315)

origin: aurelhubert/ahbottomnavigation

/**
 * Constructor
 *
 * @param activity
 * @param menuRes
 */
public AHBottomNavigationAdapter(Activity activity, @MenuRes int menuRes) {
  PopupMenu popupMenu = new PopupMenu(activity, null);
  mMenu = popupMenu.getMenu();
  activity.getMenuInflater().inflate(menuRes, mMenu);
}
origin: mikepenz/MaterialDrawer

  @Override
  public void onClick(View view) {
    PopupMenu popup = new PopupMenu(view.getContext(), view);
    MenuInflater inflater = popup.getMenuInflater();
    inflater.inflate(mMenu, popup.getMenu());
    popup.setOnMenuItemClickListener(mOnMenuItemClickListener);
    popup.setOnDismissListener(mOnDismissListener);
    popup.show();
  }
});
origin: ankidroid/Anki-Android

Timber.i("NoteEditor:: Remap button pressed for new field %d", newFieldIndex);
PopupMenu popup = new PopupMenu(NoteEditor.this, v);
final String[][] items = mEditorNote.items();
for (int i = 0; i < items.length; i++) {
origin: bkhezry/ExtraWebView

@Override
public PopupMenu create(Context context, View anchor, int gravity) {
 mSupportPopupMenu = new androidx.appcompat.widget.PopupMenu(context, anchor, gravity);
  return this;
}
origin: proninyaroslav/libretorrent

public ViewHolder(View itemView, final ClickListener listener, final List<FeedItem> items)
{
  super(itemView);
  this.listener = listener;
  this.items = items;
  itemView.setOnClickListener(this);
  title = itemView.findViewById(R.id.item_title);
  pubDate = itemView.findViewById(R.id.item_pub_date);
  menu = itemView.findViewById(R.id.item_menu);
  menu.setOnClickListener((View v) -> {
    PopupMenu popup = new PopupMenu(v.getContext(), v);
    popup.inflate(R.menu.feed_item_popup);
    popup.setOnMenuItemClickListener((MenuItem menuItem) -> {
      int position = getAdapterPosition();
      if (listener != null && position >= 0) {
        FeedItem item = items.get(position);
        listener.onMenuItemClicked(menuItem.getItemId(), item);
      }
      return true;
    });
    popup.show();
  });
}
origin: 8enet/AppOpsX

private void showPopMenu(int groupPosition, View view) {
 PopupMenu popupMenu = new PopupMenu(this, view);
 getMenuInflater().inflate(R.menu.group_item_menu, popupMenu.getMenu());
 popupMenu.setOnDismissListener(this);
 popupMenu.setOnMenuItemClickListener(this);
 popupMenu.show();
}
origin: MCMrARM/revolution-irc

PopupMenu menu = new PopupMenu(view.getContext(), view, GravityCompat.END);
MenuInflater inflater = menu.getMenuInflater();
inflater.inflate(R.menu.menu_reconnect_rule, menu.getMenu());
origin: Gwokhov/Deadline

private void setupPopupMenu() {
  final PopupMenu popupMenu = new PopupMenu(getActivity(), mBinding.remindIntervalUnit, Gravity.CENTER, 0, android.R.style.Widget_Material_Light_PopupMenu_Overflow);
  popupMenu.inflate(R.menu.menu_reminder_units);
  mBinding.remindIntervalUnit.setOnClickListener(new View.OnClickListener() {
origin: sschueller/peertube-android

PopupMenu popup = new PopupMenu(context, v);
popup.setOnMenuItemClickListener(menuItem -> {
  switch (menuItem.getItemId()) {
origin: sschueller/peertube-android

PopupMenu popup = new PopupMenu(context, v);
popup.setOnMenuItemClickListener(menuItem -> {
  switch (menuItem.getItemId()) {
origin: morogoku/MTweaks-KernelAdiutorMOD

@Override
protected void refresh() {
  super.refresh();
  if (mTitle != null) {
    if (mTitleText != null) {
      mTitle.setText(mTitleText);
      mTitleParent.setVisibility(View.VISIBLE);
      if (mLayoutParent != null) {
        LinearLayout.LayoutParams layoutParams =
            (LinearLayout.LayoutParams) mLayout.getLayoutParams();
        layoutParams.topMargin = -mLayout.getPaddingLeft();
        mLayout.requestLayout();
        mLayout.setPadding(mLayout.getPaddingLeft(), 0,
            mLayout.getPaddingRight(), mLayout.getPaddingBottom());
      }
    } else {
      mTitleParent.setVisibility(View.GONE);
    }
  }
  if (mMenuButton != null && mOnMenuListener != null) {
    mMenuButton.setVisibility(View.VISIBLE);
    mPopupMenu = new PopupMenu(mMenuButton.getContext(), mMenuButton);
    mOnMenuListener.onMenuReady(this, mPopupMenu);
  }
  if (mRootView != null && getOnItemClickListener() != null) {
    mRootView.setOnClickListener(view
        -> getOnItemClickListener().onClick(CardView.this));
  }
}
origin: darkskygit/VirtualApp

private void initMenu() {
  mPopupMenu = new PopupMenu(new ContextThemeWrapper(this, R.style.Theme_AppCompat_Light), mMenuView);
  Menu menu = mPopupMenu.getMenu();
  setIconEnable(menu);
origin: jruesga/rview

private void performShowPageOptionsMenu(View view) {
  if (mCurrentPageFragment != null && mCurrentPageFragment.hasPageOptionsMenu()) {
    PopupMenu popup = new PopupMenu(this, view, Gravity.BOTTOM);
    popup.inflate(mCurrentPageFragment.getPageOptionsMenu());
    popup.setOnMenuItemClickListener(
        mCurrentPageFragment.getPageOptionsMenuOnItemClickListener());
    popup.show();
  }
}
origin: sschueller/peertube-android

PopupMenu popup = new PopupMenu(context, v);
popup.setOnMenuItemClickListener(menuItem -> {
  switch (menuItem.getItemId()) {
origin: LineageOS/android_packages_apps_Jelly

    R.style.AppTheme_PopupMenuOverlapAnchor);
PopupMenu popupMenu = new PopupMenu(wrapper, menu, Gravity.NO_GRAVITY,
    R.attr.actionOverflowMenuStyle, 0);
popupMenu.inflate(R.menu.menu_main);
origin: googlecast/CastVideos-android

PopupMenu popup = new PopupMenu(context, view);
popup.getMenuInflater().inflate(
    provider.isQueueDetached() || provider.getCount() == 0
origin: MCMrARM/revolution-irc

mTextFormatBar.setExtraButton(R.drawable.ic_add_circle_outline,
    getString(R.string.message_format_add_chip), (View v) -> {
      PopupMenu menu = new PopupMenu(v.getContext(), v, GravityCompat.END);
      MenuInflater inflater = menu.getMenuInflater();
      inflater.inflate(R.menu.menu_format_add_chip, menu.getMenu());
mDateFormatPresetButton = findViewById(R.id.date_format_preset);
mDateFormatPresetButton.setOnClickListener((View v) -> {
  PopupMenu menu = new PopupMenu(v.getContext(), mDateFormat, GravityCompat.START);
  String[] presets = getResources().getStringArray(R.array.time_format_presets);
  String[] presetsText = getResources().getStringArray(R.array.time_format_presets_desc);
androidx.appcompat.widgetPopupMenu<init>

Popular methods of PopupMenu

  • setOnMenuItemClickListener
  • show
  • getMenu
  • inflate
  • getMenuInflater
  • setOnDismissListener

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now