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

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

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

PopupMenu.show介绍

暂无

代码示例

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

private void onCaptionClicked() {
  if (DEBUG) Log.d(TAG, "onCaptionClicked() called");
  captionPopupMenu.show();
  isSomePopupMenuVisible = true;
  showControls(DEFAULT_CONTROLS_DURATION);
}

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

public void onPlaybackSpeedClicked() {
  if (DEBUG) Log.d(TAG, "onPlaybackSpeedClicked() called");
  playbackSpeedPopupMenu.show();
  isSomePopupMenuVisible = true;
  showControls(DEFAULT_CONTROLS_DURATION);
}

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

@SuppressLint("NewApi")
  @Override
  public void show() {
    popupMenu.show();
  }
};

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

popupMenu.show();

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

@Implementation
protected void show() {
 this.isShowing = true;
 setLatestPopupMenu(this);
 directlyOn(realPopupMenu, PopupMenu.class).show();
}

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

public void onQualitySelectorClicked() {
  if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called");
  qualityPopupMenu.show();
  isSomePopupMenuVisible = true;
  showControls(DEFAULT_CONTROLS_DURATION);
  final VideoStream videoStream = getSelectedVideoStream();
  if (videoStream != null) {
    final String qualityText = MediaFormat.getNameById(videoStream.getFormatId()) + " "
        + videoStream.resolution;
    qualityTextView.setText(qualityText);
  }
  wasPlaying = simpleExoPlayer.getPlayWhenReady();
}

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

menu.show();

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

menu.show();
if (isPlaylist)
  menu.getMenu().findItem(R.id.popup_song_remove_playlist).setVisible(true);

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

@Test
public void getLatestPopupMenu_returnsLastMenuShown() throws Exception {
 popupMenu.show();
 assertThat(ShadowPopupMenu.getLatestPopupMenu()).isEqualTo(popupMenu);
}

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

menu.show();

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

@Test
public void testIsShowing_returnsTrueIfShown() throws Exception {
 popupMenu.show();
 assertThat(shadowPopupMenu.isShowing()).isTrue();
}

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

menu.show();

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

menu.show();

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

menu.show();

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

@Test
public void testIsShowing_returnsFalseIfShownThenDismissed() throws Exception {
 popupMenu.show();
 popupMenu.dismiss();
 assertThat(shadowPopupMenu.isShowing()).isFalse();
}

代码示例来源: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: chrisk44/Hijacker

@Override
  public void onItemClick(AdapterView<?> adapterView, final View v, int i, long l){
    Tile.tiles.get(i).device.getPopupMenu((MainActivity)getActivity(), v).show();
  }
});

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

@Override
public void onListItemClick(ListView l, final View v, int position, long id){
  super.onListItemClick(l, v, position, id);
  Tile.tiles.get(position).device.getPopupMenu((MainActivity)getActivity(), v).show();
}
@Override

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

menu.show();

代码示例来源: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(){

相关文章