android.widget.PopupMenu.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中android.widget.PopupMenu.<init>()方法的一些代码示例,展示了PopupMenu.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupMenu.<init>()方法的具体详情如下:
包路径:android.widget.PopupMenu
类名称:PopupMenu
方法名:<init>

PopupMenu.<init>介绍

暂无

代码示例

代码示例来源:origin: TeamNewPipe/NewPipe

private PopupMenu buildPopup(final View button) {
    PopupMenu popup = new PopupMenu(mContext, button);
    popup.inflate(R.menu.mission);
    popup.setOnMenuItemClickListener(option -> handlePopupItem(this, option));
    return popup;
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

this.playbackSeekBar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY);
this.qualityPopupMenu = new PopupMenu(context, qualityTextView);
this.playbackSpeedPopupMenu = new PopupMenu(context, playbackSpeedTextView);
this.captionPopupMenu = new PopupMenu(context, captionTextView);

代码示例来源:origin: hidroh/materialistic

@SuppressLint("NewApi")
@Override
public PopupMenu create(Context context, View anchor, int gravity) {
  popupMenu = new android.widget.PopupMenu(context,
      anchor == null ? new View(context) : anchor, gravity);
  return this;
}

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    @Override

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    @Override

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    @Override

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    @Override

代码示例来源:origin: naman14/Timber

@Override
public void onClick(View v) {
  final PopupMenu menu = new PopupMenu(mContext, v);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    @Override

代码示例来源:origin: robolectric/robolectric

@Before
public void setUp() {
 View anchorView = new View(ApplicationProvider.getApplicationContext());
 popupMenu = new PopupMenu(ApplicationProvider.getApplicationContext(), anchorView);
 shadowPopupMenu = shadowOf(popupMenu);
}

代码示例来源:origin: TeamNewPipe/NewPipe

private void buildItemPopupMenu(final PlayQueueItem item, final View view) {
  final PopupMenu menu = new PopupMenu(this, view);
  final MenuItem remove = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, /*pos=*/0,
      Menu.NONE, R.string.play_queue_remove);
  remove.setOnMenuItemClickListener(menuItem -> {
    if (player == null) return false;
    final int index = player.getPlayQueue().indexOf(item);
    if (index != -1) player.getPlayQueue().remove(index);
    return true;
  });
  final MenuItem detail = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, /*pos=*/1,
      Menu.NONE, R.string.play_queue_stream_detail);
  detail.setOnMenuItemClickListener(menuItem -> {
    onOpenDetail(item.getServiceId(), item.getUrl(), item.getTitle());
    return true;
  });
  final MenuItem append = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, /*pos=*/2,
      Menu.NONE, R.string.append_playlist);
  append.setOnMenuItemClickListener(menuItem -> {
    openPlaylistAppendDialog(Collections.singletonList(item));
    return true;
  });
  final MenuItem share = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, /*pos=*/3,
      Menu.NONE, R.string.share);
  share.setOnMenuItemClickListener(menuItem -> {
    shareUrl(item.getTitle(), item.getUrl());
    return true;
  });
  menu.show();
}

代码示例来源:origin: julian-klode/dns66

@Override
public void onClick(View v) {
  PopupMenu menu = new PopupMenu(getContext(), rootView.findViewById(R.id.change_default));
  menu.inflate(R.menu.whitelist_popup);
  menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {

代码示例来源:origin: chrisk44/Hijacker

void showActionSelector(){
  PopupMenu popup = new PopupMenu(getActivity(), actionBtn);
  popup.getMenuInflater().inflate(R.menu.popup_menu, popup.getMenu());
  //add(groupId, itemId, order, title)
  int i;
  for(i=0;i<cmds.size();i++){
    popup.getMenu().add(cmds.get(i).getType(), i, i, cmds.get(i).getTitle());
  }
  popup.getMenu().add(-1, 0, i+1, getString(R.string.manage_actions));
  popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
    public boolean onMenuItemClick(android.view.MenuItem item){
      if(item.getGroupId()==-1){
        //Open actions manager
        FragmentTransaction ft = mFragmentManager.beginTransaction();
        ft.replace(R.id.fragment1, new CustomActionManagerFragment());
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.addToBackStack(null);
        ft.commitAllowingStateLoss();
      }else{
        onActionSelected(cmds.get(item.getItemId()));
      }
      return true;
    }
  });
  popup.show();
}
void showTargetSelector(){

代码示例来源:origin: chrisk44/Hijacker

void onSelectClick(View view){
  PopupMenu popup = new PopupMenu(getActivity(), view);

代码示例来源:origin: chrisk44/Hijacker

@Override
public void onItemClick(AdapterView<?> adapterView, View view, final int index, long l){
  PopupMenu popup = new PopupMenu(getActivity(), view);
  popup.getMenuInflater().inflate(R.menu.popup_menu, popup.getMenu());

代码示例来源:origin: chrisk44/Hijacker

void showTargetSelector(){
  PopupMenu popup = new PopupMenu(getActivity(), targetBtn);
  popup.getMenuInflater().inflate(R.menu.popup_menu, popup.getMenu());

代码示例来源:origin: chrisk44/Hijacker

@Override
public void onClick(View view){
  PopupMenu popup = new PopupMenu(getActivity(), view);

代码示例来源:origin: chrisk44/Hijacker

case 4:
  PopupMenu popup2 = new PopupMenu(activity, v);
  popup2.getMenuInflater().inflate(R.menu.popup_menu, popup2.getMenu());
        case 1:
          PopupMenu popup = new PopupMenu(activity, v);

代码示例来源:origin: Neamar/KISS

PopupMenu popupExcludeMenu = new PopupMenu(context, parentView);

代码示例来源:origin: chrisk44/Hijacker

PopupMenu getPopupMenu(final MainActivity activity, final View v){
  PopupMenu popup = new PopupMenu(activity, v);
  popup.getMenuInflater().inflate(R.menu.popup_menu, popup.getMenu());

相关文章