本文整理了Java中android.widget.ExpandableListView.getPackedPositionForGroup()
方法的一些代码示例,展示了ExpandableListView.getPackedPositionForGroup()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExpandableListView.getPackedPositionForGroup()
方法的具体详情如下:
包路径:android.widget.ExpandableListView
类名称: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!