android.widget.GridView.setChoiceMode()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(127)

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

GridView.setChoiceMode介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

mGridView.setChoiceMode(GridView.CHOICE_MODE_SINGLE);
mGridView.setAdapter(new BaseAdapter() {
  @Override public int getCount() {

代码示例来源:origin: googlecreativelab/lipswap

private void setupGridView() {
  mGridView.setOnItemClickListener(mOnItemClickListener);
  mGridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  mGridView.setMultiChoiceModeListener(
      new OnMultiChoiceListener(ChooserActivity.this, mGridView));
}

代码示例来源:origin: SimonMarquis/Android-PreferencesManager

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  loadingView = view.findViewById(R.id.loadingView);
  emptyView = view.findViewById(R.id.emptyView);
  emptyViewText = (TextView) view.findViewById(R.id.emptyViewText);
  gridView = (GridView) view.findViewById(R.id.gridView);
  gridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  updateFilter(null);
  if (preferenceFile == null) {
    launchTask();
  } else {
    updateListView(preferenceFile, false);
  }
}

代码示例来源:origin: gigabytedevelopers/FireFiles

@Override
public void onDestroyView() {
  super.onDestroyView();
  // Cancel any outstanding thumbnail requests
  final ViewGroup target = (mListView.getAdapter() != null) ? mListView : mGridView;
  final int count = target.getChildCount();
  for (int i = 0; i < count; i++) {
    final View view = target.getChildAt(i);
    mRecycleListener.onMovedToScrapHeap(view);
  }
  // Tear down any selection in progress
  mListView.setChoiceMode(AbsListView.CHOICE_MODE_NONE);
  mGridView.setChoiceMode(AbsListView.CHOICE_MODE_NONE);
}

代码示例来源:origin: THEONE10211024/ApiDemos

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  loadApps();
  setContentView(R.layout.grid_1);
  mGrid = (GridView) findViewById(R.id.myGrid);
  mGrid.setAdapter(new AppsAdapter());
  mGrid.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  mGrid.setMultiChoiceModeListener(new MultiChoiceModeListener());
}

代码示例来源:origin: Microsoft/Cognitive-Face-Android

private void initializeGridView() {
  GridView gridView = (GridView) findViewById(R.id.gridView_persons);
  gridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  gridView.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
    @Override

代码示例来源:origin: qiubiteme/android_api_demos

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  loadApps();
  setContentView(R.layout.grid_1);
  mGrid = (GridView) findViewById(R.id.myGrid);
  mGrid.setAdapter(new AppsAdapter());
  mGrid.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  mGrid.setMultiChoiceModeListener(new MultiChoiceModeListener());
}

代码示例来源:origin: fasteque/rgb-tool

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_rgbtool_gallery);
  ButterKnife.bind(this);
  if (getSupportActionBar() != null) {
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
  mAdapter = new RGBToolImagesCursorAdapter(this);
  mGridView.setAdapter(mAdapter);
  mGridView.setOnItemClickListener(this);
  mGridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  mGridView.setMultiChoiceModeListener(new MultiChoiceModeListener());
  getLoaderManager().initLoader(RGBToolImagesQuery.QUERY_ID, null, this);
}

代码示例来源:origin: Microsoft/Cognitive-Face-Android

private void initializeGridView() {
  GridView gridView = (GridView) findViewById(R.id.gridView_faces);
  gridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL);
  gridView.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
    @Override

代码示例来源:origin: gigabytedevelopers/FireFiles

mGridView.setColumnWidth(thumbSize);
  mGridView.setNumColumns(GridView.AUTO_FIT);
  mGridView.setChoiceMode(choiceMode);
  mCurrentView = mGridView;
} else if (state.derivedMode == MODE_LIST) {
  thumbSize = getResources().getDimensionPixelSize(R.dimen.icon_size);
  mGridView.setAdapter(null);
  mGridView.setChoiceMode(ListView.CHOICE_MODE_NONE);
  mListView.setAdapter(mAdapter);
  mListView.setChoiceMode(choiceMode);

相关文章

GridView类方法