Пример #1
0
  public void showPopupOfLessonItem(View v, int position) {
    final int index = position;
    PopupMenu popup = new PopupMenu(Home.this, v);
    popup.getMenuInflater().inflate(R.menu.list_lesson_menu, popup.getMenu());
    popup.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {

          @Override
          public boolean onMenuItemClick(MenuItem item) {
            // TODO Auto-generated method stub
            switch (item.getItemId()) {
              case R.id.show_lesson_detail:
                {
                  createDialog(Home.this, index);
                  break;
                }
              case R.id.delete_lesson:
                {
                  break;
                }
            }
            return false;
          }
        });
    popup.show();
  }
Пример #2
0
  void popupNavi(View view) {
    PopupMenu popupMenu = new PopupMenu(getActivity(), view);
    popupMenu.inflate(R.menu.navi_menu);
    popupMenu.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {
          @Override
          public boolean onMenuItemClick(MenuItem item) {

            switch (item.getItemId()) {
              case R.id.action_autonavi:
                if (isAppInstalled(getActivity(), "com.autonavi.minimap")) {
                  shareToAutoNavi();
                } else {
                  showToast("高德地图未安装");
                }
                break;
              case R.id.action_baidunavi:
                if (isAppInstalled(getActivity(), "com.baidu.BaiduMap")) {
                  shareToBaidu();
                } else {
                  showToast("百度地图未安装");
                }
                break;
            }
            return true;
          }
        });
    popupMenu.show();
  }
Пример #3
0
  @Override
  public boolean onLongClick(View v) {
    switch (v.getId()) {
      case R.id.questionimage:
        if (null != bitmap) {
          PopupMenu popupMenu = new PopupMenu(this, image);
          popupMenu.getMenuInflater().inflate(R.menu.popupmenu_deleteimage, popupMenu.getMenu());
          popupMenu.setOnMenuItemClickListener(
              new PopupMenu.OnMenuItemClickListener() {
                @Override
                public boolean onMenuItemClick(MenuItem item) {
                  switch (item.getItemId()) {
                    case R.id.deleteimage:
                      bitmap.recycle();
                      bitmap = null;
                      image.setScaleType(ImageView.ScaleType.CENTER);
                      image.setImageDrawable(
                          getResources().getDrawable(R.mipmap.img_questionimage));
                      hint.setText(getString(R.string.question_addimage_hint));
                      return true;
                  }
                  return false;
                }
              });
          popupMenu.show();
        }

        break;
    }
    return false;
  }
 private void showPopupMenu(View view, PopupMenu.OnMenuItemClickListener listener) {
   PopupMenu popup = new PopupMenu(mActivity, view);
   popup.setOnMenuItemClickListener(listener);
   MenuInflater inflater = popup.getMenuInflater();
   inflater.inflate(R.menu.card_score_list, popup.getMenu());
   popup.show();
 }
Пример #5
0
  public void showPopupMenu(View v) {
    PopupMenu popup = new PopupMenu(Home.this, v);
    popup.getMenuInflater().inflate(R.menu.sms_menu, popup.getMenu());
    popup.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {

          @Override
          public boolean onMenuItemClick(MenuItem item) {
            // TODO Auto-generated method stub
            switch (item.getItemId()) {
              case R.id.edit_profile:
                {
                  viewFlipper.setInAnimation(Lesson.go_next_in);
                  viewFlipper.setOutAnimation(Lesson.go_next_out);
                  viewFlipper.showNext();
                  break;
                }
              case R.id.sign_out:
                {
                  SharePreUtils.setString(Home.this, SharePreUtils.EMAIL, "");
                  SharePreUtils.setString(Home.this, SharePreUtils.PASSWORD, "");
                  SharePreUtils.setString(Home.this, SharePreUtils.FULL_NAME, "");
                  SharePreUtils.setString(Home.this, SharePreUtils.USER_ID, "");

                  Intent intent = new Intent(Home.this, MainActivity.class);
                  startActivity(intent);
                  finish();
                  break;
                }
            }
            return false;
          }
        });
    popup.show();
  }
  @Override
  public void openUtilityPanel(final LinearLayout accessoryViewList) {
    mButton = (SwapButton) accessoryViewList.findViewById(R.id.applyEffect);
    mButton.setText(mContext.getString(R.string.vignette_main));

    if (useCompact(mContext)) {
      final PopupMenu popupMenu = new PopupMenu(mImageShow.getActivity(), mButton);

      popupMenu.getMenuInflater().inflate(R.menu.filtershow_menu_vignette, popupMenu.getMenu());

      popupMenu.setOnMenuItemClickListener(
          new PopupMenu.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
              selectMenuItem(item);
              return true;
            }
          });
      mButton.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View arg0) {
              popupMenu.show();
              ((FilterShowActivity) mContext).onShowMenu(popupMenu);
            }
          });
      mButton.setListener(this);

      FilterVignetteRepresentation csrep = getVignetteRep();
      String menuString = mContext.getString(mMenuStrings[0]);
      switchToMode(csrep, FilterVignetteRepresentation.MODE_VIGNETTE, menuString);
    } else {
      mButton.setText(mContext.getString(R.string.vignette_main));
    }
  }
 public void abrirPopupMenu(DetallePedido detalle) {
   detalle_seleccionado = detalle;
   PopupMenu popupMenu = new PopupMenu(activity, ibtnMas);
   popupMenu.setOnMenuItemClickListener(this);
   popupMenu.inflate(R.menu.popup_menu_detalle_venta);
   popupMenu.show();
 }
Пример #8
0
 @Override
 public void onClick(View v) {
   PopupMenu popup = new PopupMenu(v.getContext(), v);
   popup.inflate(R.menu.mnu);
   popup.setOnMenuItemClickListener(this);
   popup.show();
 }
  private void showSecurityMenu() {
    PopupMenu popup = new PopupMenu(getActivity(), securityButton);
    popup.inflate(R.menu.security);
    popup.setOnMenuItemClickListener(this);

    Menu menu = popup.getMenu();

    SecurityLevel securityLevel = OTRManager.getInstance().getSecurityLevel(account, user);

    if (securityLevel == SecurityLevel.plain) {
      menu.findItem(R.id.action_start_encryption)
          .setVisible(true)
          .setEnabled(
              SettingsManager.securityOtrMode() != SettingsManager.SecurityOtrMode.disabled);
    } else {
      menu.findItem(R.id.action_restart_encryption).setVisible(true);
    }

    boolean isEncrypted = securityLevel != SecurityLevel.plain;

    menu.findItem(R.id.action_stop_encryption).setEnabled(isEncrypted);
    menu.findItem(R.id.action_verify_with_fingerprint).setEnabled(isEncrypted);
    menu.findItem(R.id.action_verify_with_question).setEnabled(isEncrypted);
    menu.findItem(R.id.action_verify_with_shared_secret).setEnabled(isEncrypted);

    popup.show();
  }
Пример #10
0
  private void showPopupMenu(View v) {
    PopupMenu popupMenu = new PopupMenu(this, v);
    popupMenu.inflate(R.menu.popupmenu_currency);

    popupMenu.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {
          @Override
          public boolean onMenuItemClick(MenuItem item) {
            switch (item.getItemId()) {
              case R.id.$:
                editTextCurrency.setText("$");
                return true;
              case R.id.€:
                editTextCurrency.setText("€");
                return true;
              case R.id.₴:
                editTextCurrency.setText("₴");
                return true;
              default:
                return false;
            }
          }
        });
    popupMenu.show();
  }
  @Override
  public boolean onItemLongClick(
      final AdapterView<?> parent, final View view, final int position, final long id) {
    if (parent == mLvDebug) {
      final IITC_LogAdapter adapter = ((IITC_LogAdapter) parent.getAdapter());
      final Log.Message item = adapter.getItem(position);

      final PopupMenu popupMenu = new PopupMenu(this, view);
      popupMenu.getMenuInflater().inflate(R.menu.debug, popupMenu.getMenu());

      popupMenu.setOnMenuItemClickListener(
          new PopupMenu.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(final MenuItem menuitem) {
              switch (menuitem.getItemId()) {
                case R.id.menu_copy:
                  mIitcWebView.getJSInterface().copy(item.toString());
                  return true;
                case R.id.menu_delete:
                  adapter.remove(item);
                  return true;
              }
              return false;
            }
          });

      popupMenu.show();
    }
    return false;
  }
Пример #12
0
  /**
   * Shows "call via" menu allowing user to selected from multiple providers.
   *
   * @param context the android context
   * @param v the View that will contain the popup menu.
   * @param destination target callee name.
   */
  private static void showCallViaMenu(final Context context, View v, final String destination) {
    PopupMenu popup = new PopupMenu(context, v);

    Menu menu = popup.getMenu();

    Iterator<ProtocolProviderService> registeredProviders =
        AccountUtils.getRegisteredProviders().iterator();

    while (registeredProviders.hasNext()) {
      final ProtocolProviderService provider = registeredProviders.next();
      String accountAddress = provider.getAccountID().getAccountAddress();

      MenuItem menuItem = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, accountAddress);

      menuItem.setOnMenuItemClickListener(
          new MenuItem.OnMenuItemClickListener() {
            public boolean onMenuItemClick(MenuItem item) {
              createCall(context, destination, provider);

              return false;
            }
          });
    }

    popup.show();
  }
Пример #13
0
        @Override
        public void onClick(final View v) {
          final ViewHolder viewHolder = (ViewHolder) v.getTag();

          final PlaylistType.Item playListItem = new PlaylistType.Item();
          playListItem.artistid = viewHolder.artistId;

          final PopupMenu popupMenu = new PopupMenu(getActivity(), v);
          popupMenu.getMenuInflater().inflate(R.menu.musiclist_item, popupMenu.getMenu());
          popupMenu.setOnMenuItemClickListener(
              new PopupMenu.OnMenuItemClickListener() {
                @Override
                public boolean onMenuItemClick(MenuItem item) {
                  switch (item.getItemId()) {
                    case R.id.action_play:
                      MediaPlayerUtils.play(ArtistListFragment.this, playListItem);
                      return true;
                    case R.id.action_queue:
                      MediaPlayerUtils.queueAudio(ArtistListFragment.this, playListItem);
                      return true;
                  }
                  return false;
                }
              });
          popupMenu.show();
        }
Пример #14
0
  private void showPopupMenu(View view) {
    // Create a PopupMenu, giving it the clicked view for an anchor
    PopupMenu popup = new PopupMenu(adapter.getFragment().getActivity(), view);

    // Inflate our menu resource into the PopupMenu's Menu
    popup.getMenuInflater().inflate(R.menu.chapter_single, popup.getMenu());

    // Set a listener so we are notified if a menu item is clicked
    popup.setOnMenuItemClickListener(
        menuItem -> {
          Observable<Chapter> chapter = Observable.just(item);

          switch (menuItem.getItemId()) {
            case R.id.action_mark_as_read:
              return adapter.getFragment().onMarkAsRead(chapter);
            case R.id.action_mark_as_unread:
              return adapter.getFragment().onMarkAsUnread(chapter);
            case R.id.action_download:
              return adapter.getFragment().onDownload(chapter);
            case R.id.action_delete:
              return adapter.getFragment().onDelete(chapter);
            case R.id.action_mark_previous_as_read:
              return adapter.getFragment().onMarkPreviousAsRead(item);
          }
          return false;
        });

    // Finally show the PopupMenu
    popup.show();
  }
Пример #15
0
 private void configurePopupWithTracks(
     PopupMenu popup,
     final OnMenuItemClickListener customActionClickListener,
     final int trackType) {
   if (player == null) {
     return;
   }
   int trackCount = player.getTrackCount(trackType);
   if (trackCount == 0) {
     return;
   }
   popup.setOnMenuItemClickListener(
       new OnMenuItemClickListener() {
         @Override
         public boolean onMenuItemClick(MenuItem item) {
           return (customActionClickListener != null
                   && customActionClickListener.onMenuItemClick(item))
               || onTrackItemClick(item, trackType);
         }
       });
   Menu menu = popup.getMenu();
   // ID_OFFSET ensures we avoid clashing with Menu.NONE (which equals 0)
   menu.add(MENU_GROUP_TRACKS, DemoPlayer.TRACK_DISABLED + ID_OFFSET, Menu.NONE, R.string.off);
   for (int i = 0; i < trackCount; i++) {
     menu.add(
         MENU_GROUP_TRACKS,
         i + ID_OFFSET,
         Menu.NONE,
         buildTrackName(player.getTrackFormat(trackType, i)));
   }
   menu.setGroupCheckable(MENU_GROUP_TRACKS, true, true);
   menu.findItem(player.getSelectedTrack(trackType) + ID_OFFSET).setChecked(true);
 }
Пример #16
0
  // Open menu for choosing adding new movie mode: manual or via internet
  // by click on Plus icon.
  public void imageViewPlusIcon_onClick(View view) {
    PopupMenu popupMenu = new PopupMenu(this, view);
    popupMenu.inflate(R.menu.menu_plus_button);
    popupMenu.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {
          public boolean onMenuItemClick(MenuItem item) {
            switch (item.getItemId()) {
              case R.id.action_plus_manual:
                Intent intent = new Intent(MainActivity.this, EditorActivity.class);
                intent.putExtra(Constants.KEY_ID, Constants.VALUE_NEW_MOVIE);
                startActivityForResult(intent, REQUEST_EDITOR);
                break;

              case R.id.action_plus_search:
                if (Helper.isNetworkAvailable(MainActivity.this)) {
                  Intent intentSearch = new Intent(MainActivity.this, SearchActivity.class);
                  startActivityForResult(intentSearch, REQUEST_SEARCH);
                } else {
                  Toast.makeText(
                          MainActivity.this,
                          R.string.no_internet_connection_warning,
                          Toast.LENGTH_LONG)
                      .show();
                }
                break;
            }
            return true;
          }
        });
    popupMenu.show();
  }
Пример #17
0
 public void showPopup(View v) {
   final PopupMenu popup = new PopupMenu(this, v);
   popup.setOnMenuItemClickListener(new PopupEventListener());
   final MenuInflater inflater = popup.getMenuInflater();
   inflater.inflate(R.menu.search_activity_menu, popup.getMenu());
   popup.show();
 }
Пример #18
0
  private void openMenu(View menu) {

    PopupMenu popup = new PopupMenu(getActivity(), menu);

    // Inflating the Popup using xml file
    popup.getMenuInflater().inflate(R.menu.example_menu, popup.getMenu());

    // registering popup with OnMenuItemClickListener
    popup.setOnMenuItemClickListener(
        new PopupMenu.OnMenuItemClickListener() {
          public boolean onMenuItemClick(MenuItem item) {

            switch (item.getItemId()) {
              case R.id.sort:
                break;
              case R.id.favourite:
                break;
              case R.id.refresh:
                break;
              default:
                break;
            }
            return true;
          }
        });
    popup.show(); // showing popup menu
  }
Пример #19
0
  private PopupMenu constructPopupMenu(View anchorView) {

    final PopupMenu popupMenu = new PopupMenu(this, anchorView);
    popupMenu.inflate(R.menu.main_activity);
    popupMenu.setOnMenuItemClickListener(listener);

    return popupMenu;
  }
 private void showPopupMenu(Context context, View view) {
   if (popupMenu == null) {
     popupMenu = new PopupMenu(context, view);
     popupMenu.inflate(R.menu.popup_menu);
     popupMenu.setOnMenuItemClickListener(HomeActivity.this);
   }
   popupMenu.show();
 }
Пример #21
0
 @TargetApi(Build.VERSION_CODES.HONEYCOMB)
 protected void inflateBaseMenu(Context context, PopupMenu menu) {
   String favApps =
       PreferenceManager.getDefaultSharedPreferences(context).getString("favorite-apps-list", "");
   if (!favApps.contains(this.pojo.id + ";")) {
     menu.getMenuInflater().inflate(R.menu.menu_item_favorite_add, menu.getMenu());
   }
 }
Пример #22
0
  /**
   * Default popup menu implementation, can be overridden by children class to display a more
   * specific menu
   *
   * @return an inflated, listener-free PopupMenu
   */
  @TargetApi(Build.VERSION_CODES.HONEYCOMB)
  PopupMenu buildPopupMenu(Context context, final RecordAdapter parent, View parentView) {
    PopupMenu menu = new PopupMenu(context, parentView);
    menu.getMenuInflater().inflate(R.menu.menu_item_default, menu.getMenu());

    inflateBaseMenu(context, menu);
    return menu;
  }
Пример #23
0
 @Override
 public boolean onRecyclerItemLongClick(
     RecyclerView recyclerView, View view, int position, long id, int viewHolderLayoutID) {
   switch (viewHolderLayoutID) {
     case R.layout.reportlist_item:
       PopupMenu popUpMenu = new PopupMenu(this, view);
       Menu menu = popUpMenu.getMenu();
       popUpMenu.getMenuInflater().inflate(R.menu.context_fragment_report_selection, menu);
       for (int i = 0; i < menu.size(); i++) {
         Intent intent = new Intent();
         intent.putExtra(ID, id);
         menu.getItem(i).setIntent(intent);
       }
       popUpMenu.setOnMenuItemClickListener(this);
       popUpMenu.show();
       return true;
     case R.layout.finanzuebersicht_item:
       DialogFragmentKontoEdit d =
           DialogFragmentKontoEdit.newInstance(DBDefinition.Account, id, MainAction.EDIT);
       d.show(getSupportFragmentManager(), null);
       return true;
     case R.layout.depotuebersicht_item:
       Intent intent = new Intent(this, ActivityWertpapiere.class);
       intent.putExtra(ACCOUNTID, (int) id);
       intent.putExtra(ACTION, (Parcelable) Action.ShowBuchungen);
       startActivity(intent);
       return true;
     case R.layout.hbcipassport_item:
       final long mID = id;
       AlertDialog.Builder builder = new AlertDialog.Builder(this);
       builder.setTitle(R.string.HBCIZugangDelete);
       builder.setMessage(R.string.HBCIZugangDeleteMsg);
       builder.setPositiveButton(
           getString(R.string.awlib_btnAccept),
           new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
               try {
                 MonMaPassport passport = new MonMaPassport(mID);
                 passport.delete(DBHelper.getInstance());
               } catch (GeschaeftsObjekt.LineNotFoundException e) {
                 // TODO Execption bearbeiten
                 e.printStackTrace();
               }
             }
           });
       builder.setNegativeButton(
           getString(R.string.awlib_btnCancel),
           new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {}
           });
       builder.create().show();
       return true;
     default:
       return false;
   }
 }
Пример #24
0
 protected void showAttachMenu(final View v) {
   if (this.attachment == null) {
     askChoosePicture();
   } else {
     final PopupMenu popupMenu = new PopupMenu(this, v);
     popupMenu.getMenuInflater().inflate(R.menu.attachmenu, popupMenu.getMenu());
     popupMenu.setOnMenuItemClickListener(this.attachMenuClickListener);
     popupMenu.show();
   }
 }
Пример #25
0
    @Override
    protected void onFinishInflate() {
      super.onFinishInflate();

      bChangeBook = V.get(this, R.id.bChangeBook);
      bChangeCode = V.get(this, R.id.bChangeCode);

      bOk = V.get(this, R.id.bOk);
      bDigitA = V.get(this, R.id.bDigitA);
      bDigitB = V.get(this, R.id.bDigitB);
      bDigitC = V.get(this, R.id.bDigitC);

      bChangeBook.setOnClickListener(
          v -> {
            final PopupMenu popupChangeBook =
                SongBookUtil.getSongBookPopupMenu(activity, false, true, bChangeBook);
            popupChangeBook.setOnMenuItemClickListener(
                SongBookUtil.getSongBookOnMenuItemClickListener(
                    new SongBookUtil.DefaultOnSongBookSelectedListener() {
                      @Override
                      public void onSongBookSelected(final String name) {
                        listener.songBookSelected(name);
                      }

                      @Override
                      public void onMoreSelected() {
                        listener.moreSelected();
                      }
                    }));

            popupChangeBook.show();
          });

      // all buttons
      for (int buttonId :
          new int[] {
            R.id.bDigit0,
            R.id.bDigit1,
            R.id.bDigit2,
            R.id.bDigit3,
            R.id.bDigit4,
            R.id.bDigit5,
            R.id.bDigit6,
            R.id.bDigit7,
            R.id.bDigit8,
            R.id.bDigit9,
            R.id.bDigitA,
            R.id.bDigitB,
            R.id.bDigitC,
            R.id.bOk,
            R.id.bBackspace,
          }) {
        V.get(this, buttonId).setOnClickListener(button_click);
      }
    }
  public boolean showPopupMenu(View view) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
      return false;
    }

    PopupMenu popup = new PopupMenu(this, view);
    MenuInflater inflater = popup.getMenuInflater();
    inflater.inflate(R.menu.popup_menu, popup.getMenu());
    popup.show();
    return true;
  }
  @Override
  public void onClick(View view) {
    if (!isMessageOpen()) {
      return; // Ignore.
    }
    switch (view.getId()) {
      case R.id.reply:
        mCallback.onReply();
        return;
      case R.id.reply_all:
        mCallback.onReplyAll();
        return;
      case R.id.forward:
        mCallback.onForward();
        return;

      case R.id.favorite:
        onClickFavorite();
        return;

      case R.id.invite_link:
        onInviteLinkClicked();
        return;

      case R.id.accept:
        onRespondToInvite(
            EmailServiceConstants.MEETING_REQUEST_ACCEPTED, R.string.message_view_invite_toast_yes);
        return;
      case R.id.maybe:
        onRespondToInvite(
            EmailServiceConstants.MEETING_REQUEST_TENTATIVE,
            R.string.message_view_invite_toast_maybe);
        return;
      case R.id.decline:
        onRespondToInvite(
            EmailServiceConstants.MEETING_REQUEST_DECLINED, R.string.message_view_invite_toast_no);
        return;

      case R.id.more:
        {
          PopupMenu popup = new PopupMenu(getActivity(), mMoreButton);
          Menu menu = popup.getMenu();
          popup.getMenuInflater().inflate(R.menu.message_header_overflow_menu, menu);

          // Remove Reply if ReplyAll icon is visible or vice versa
          menu.removeItem(mDefaultReplyAll ? R.id.reply_all : R.id.reply);
          popup.setOnMenuItemClickListener(this);
          popup.show();
          break;
        }
    }
    super.onClick(view);
  }
 @Override
 public void onClick(View view) {
   final PopupMenu popupMenu = new PopupMenu(DialtactsActivity.this, view);
   final Menu menu = popupMenu.getMenu();
   popupMenu.inflate(R.menu.dialtacts_search_options);
   final MenuItem filterOptionMenuItem = menu.findItem(R.id.filter_option);
   filterOptionMenuItem.setOnMenuItemClickListener(mFilterOptionsMenuItemClickListener);
   final MenuItem addContactOptionMenuItem = menu.findItem(R.id.add_contact);
   addContactOptionMenuItem.setIntent(
       new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI));
   popupMenu.show();
 }
Пример #29
0
 @Override
 public void onPopupMenuClick(View v, final int seasonTvdbId, final int seasonNumber) {
   PopupMenu popupMenu = new PopupMenu(v.getContext(), v);
   popupMenu.inflate(R.menu.seasons_popup_menu);
   popupMenu.setOnMenuItemClickListener(
       new PopupMenu.OnMenuItemClickListener() {
         @Override
         public boolean onMenuItemClick(MenuItem item) {
           switch (item.getItemId()) {
             case R.id.menu_action_seasons_watched_all:
               {
                 onFlagSeasonWatched(seasonTvdbId, seasonNumber, true);
                 fireTrackerEventContextMenu("Flag all watched");
                 return true;
               }
             case R.id.menu_action_seasons_watched_none:
               {
                 onFlagSeasonWatched(seasonTvdbId, seasonNumber, false);
                 fireTrackerEventContextMenu("Flag all unwatched");
                 return true;
               }
             case R.id.menu_action_seasons_collection_add:
               {
                 onFlagSeasonCollected(seasonTvdbId, seasonNumber, true);
                 fireTrackerEventContextMenu("Flag all collected");
                 return true;
               }
             case R.id.menu_action_seasons_collection_remove:
               {
                 onFlagSeasonCollected(seasonTvdbId, seasonNumber, false);
                 fireTrackerEventContextMenu("Flag all uncollected");
                 return true;
               }
             case R.id.menu_action_seasons_skip:
               {
                 onFlagSeasonSkipped(seasonTvdbId, seasonNumber);
                 fireTrackerEventContextMenu("Flag all skipped");
                 return true;
               }
             case R.id.menu_action_seasons_manage_lists:
               {
                 ManageListsDialogFragment.showListsDialog(
                     seasonTvdbId, ListItemTypes.SEASON, getFragmentManager());
                 fireTrackerEventContextMenu("Manage lists");
                 return true;
               }
           }
           return false;
         }
       });
   popupMenu.show();
 }
Пример #30
0
 @SuppressLint("NewApi")
 private void showProfilePopup(View view) {
   PopupMenu popupMenu = new PopupMenu(BaseActivity.this, view);
   popupMenu.inflate(R.menu.profile_popup);
   popupMenu.setOnMenuItemClickListener(
       new OnMenuItemClickListener() {
         @Override
         public boolean onMenuItemClick(MenuItem item) {
           return onProfilePopupItemClick(item);
         }
       });
   popupMenu.show();
 }