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

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

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

ExpandableListView.setChoiceMode介绍

暂无

代码示例

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

lv = (ExpandableListView) getActivity().findViewById(R.id.explist);
lv.setItemsCanFocus(false);
lv.setChoiceMode(ExpandableListView.CHOICE_MODE_SINGLE);

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

@Override
public View onCreateView(
    LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  final View view = inflater.inflate(R.layout.fragment_roots, container, false);
  mList = (ExpandableListView) view.findViewById(android.R.id.list);
  mList.setOnChildClickListener(mItemListener);
  mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  DisplayMetrics metrics = new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
  int width = Utils.dpToPx(302);
  boolean rtl = Utils.isRTL();
  int leftPadding = rtl ? 10 : 50;
  int rightPadding = rtl ? 50 : 10;
  int leftWidth = width - Utils.dpToPx(leftPadding);
  int rightWidth = width - Utils.dpToPx(rightPadding);
  if(Utils.hasJellyBeanMR2()){
    mList.setIndicatorBoundsRelative(leftWidth, rightWidth);
  } else {
    mList.setIndicatorBounds(leftWidth, rightWidth);
  }
  return view;
}

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

list.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
list.setOnChildClickListener(this);
list.setOnGroupClickListener(this);

相关文章

ExpandableListView类方法