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

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

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

ExpandableListView.getHeaderViewsCount介绍

暂无

代码示例

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

groupList, laptopCollection);
  expListView.setAdapter(expListAdapter);
  expListView.getHeaderViewsCount();

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

, groupList, laptopCollection);
  expListView.setAdapter(expListAdapter);
  expListView.getHeaderViewsCount();

代码示例来源:origin: nailperry-zd/LazierTracker

private static String buildAdapterViewItemIndex(View child, ViewGroup group) {
  int index = ((AdapterView) group).getPositionForView(child);
  // ExpandableListView
  if (group instanceof ExpandableListView) {
    StringBuilder element = new StringBuilder();
    String exListIndicator = "";
    ExpandableListView _group = (ExpandableListView) group;
    long l = _group.getExpandableListPosition(index);
    int groupIndex;
    if (ExpandableListView.getPackedPositionType(l) == ExpandableListView.PACKED_POSITION_TYPE_NULL) {
      if (index < _group.getHeaderViewsCount()) {
        exListIndicator = "[header:" + index + "]";// header
      } else {
        groupIndex = index - (_group.getCount() - _group.getFooterViewsCount());
        exListIndicator = "[footer:" + groupIndex + "]";// footer
      }
    } else {
      groupIndex = ExpandableListView.getPackedPositionGroup(l);
      int childIndex = ExpandableListView.getPackedPositionChild(l);
      if (childIndex != -1) {
        exListIndicator = "[group:" + groupIndex + ",child:" + childIndex + "]";// group/child
      } else {
        exListIndicator = "[group:" + groupIndex + "]";// group
      }
    }
    Log.d("ExpandableListViewItem", "@index = " + index + ", @exListIndicator = " + exListIndicator);
    return exListIndicator;
  }
  return "[" + index + "]";
}

相关文章

ExpandableListView类方法