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

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

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

ExpandableListView.getCount介绍

暂无

代码示例

代码示例来源:origin: zulip/zulip-android

@Override
  public boolean onGroupClick(ExpandableListView expandableListView, View view, int position, long l) {
    resetStreamSearch();
    String streamName = ((TextView) view.findViewById(R.id.name)).getText().toString();
    doNarrowToLastRead(streamName);
    if (!isTablet())
      drawerLayout.openDrawer(GravityCompat.START);
    if (previousClick != -1 && expandableListView.getCount() > previousClick) {
      expandableListView.collapseGroup(previousClick);
    }
    expandableListView.expandGroup(position);
    previousClick = position;
    onNarrowFillSendBoxStream(streamName, "", false);
    return true;
  }
});

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

@Override
public void onBackPressed() {
  ExpandableListView elv;
  boolean groupsCollapsed = false;
  for (int i=0; i<elv.getCount(); ++i) {
    if (elv.isGroupExpanded(i)) {
      elv.collapseGroup(i);
      groupsCollapsed = true;
    }
  }

  // If no groups collapsed, call the default back button
  if (!groupsCollapsed) {
    super.onBackPressed();
  }
}

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

height += list.getDividerHeight() * (list.getCount() - 1);
Log.i("height", "" + height);
return height;

代码示例来源: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 + "]";
}

代码示例来源:origin: DickyQie/android-shoppingcart

private void showExpandData(){
  cartExpandAdapter=new CartExpandAdapter(this,cartExpandablelistview,cartInfo.getData());
  cartExpandablelistview.setAdapter(cartExpandAdapter);
  int intgroupCount = cartExpandablelistview.getCount();
  for (int i=0; i<intgroupCount; i++)

相关文章

ExpandableListView类方法