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

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

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

ExpandableListView.getPackedPositionForGroup介绍

暂无

代码示例

代码示例来源:origin: thoughtbot/expandable-recycler-view

public long getPackedPosition() {
 if (type == CHILD) {
  return ExpandableListView.getPackedPositionForChild(groupPos, childPos);
 } else {
  return ExpandableListView.getPackedPositionForGroup(groupPos);
 }
}

代码示例来源:origin: xiangzhihong/gpuImage

long getPackedPosition() {
  if (type == CHILD) return ExpandableListView.getPackedPositionForChild( groupPos, childPos );
  else return ExpandableListView.getPackedPositionForGroup(groupPos);
}

代码示例来源:origin: adafruit/Bluefruit_LE_Connect_Android

@Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
          if (fromUser) {
//                        pin.analogValue = progress;
            setPMWValue(pin, progress);

            // Update only the value in the parent group
            long parentPacketPosition = ExpandableListView.getPackedPositionForGroup(groupPosition);
            long parentFlatPosition = mPinListView.getFlatListPosition(parentPacketPosition);
            if (parentFlatPosition >= mPinListView.getFirstVisiblePosition() && parentFlatPosition <= mPinListView.getLastVisiblePosition()) {
              View view = mPinListView.getChildAt((int) parentFlatPosition);
              TextView valueTextView = (TextView) view.findViewById(R.id.stateTextView);
              valueTextView.setText(String.valueOf(progress));
            }
          }
        }

代码示例来源:origin: lucid-lynxz/BlogSamples

@Override
                    public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
                      if (expandGroupIndex == -1) {
                        mEl.expandGroup(groupPosition);
                        //设置被选中的group置于顶端
                        //mEl.setSelectedGroup(groupPosition);
                        expandGroupIndex = groupPosition;
                      } else if (expandGroupIndex == groupPosition) {
                        mEl.collapseGroup(expandGroupIndex);
                        expandGroupIndex = -1;
                      } else {
                        mEl.collapseGroup(expandGroupIndex);
                        //展开被选的group
                        mEl.expandGroup(groupPosition);
                        mEl.setSelectedGroup(groupPosition);
                        expandGroupIndex = groupPosition;
                      }
                      mAdapter.setExpandGroupIndex(expandGroupIndex);

                      long packedPositionForGroup = mEl.getPackedPositionForGroup(groupPosition);
//                                            int packedPositionGroup = mEl.getPackedPositionGroup(packedPositionForGroup);
                      int flatListPosition = mEl.getFlatListPosition(packedPositionForGroup);
                      Log.d(TAG, "Group- " + flatListPosition + " - " + packedPositionForGroup);
                      return true;
                    }
                  }

相关文章

ExpandableListView类方法