本文整理了Java中android.widget.ExpandableListAdapter.getGroupId()
方法的一些代码示例,展示了ExpandableListAdapter.getGroupId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExpandableListAdapter.getGroupId()
方法的具体详情如下:
包路径:android.widget.ExpandableListAdapter
类名称:ExpandableListAdapter
方法名:getGroupId
暂无
代码示例来源:origin: xiangzhihong/gpuImage
/**
* Gets the ID of the group or child at the given <code>position</code>.
* This is useful since there is no ListAdapter ID -> ExpandableListAdapter
* ID conversion mechanism (in some cases, it isn't possible).
*
* @param position The position of the child or group whose ID should be
* returned.
*/
private long getChildOrGroupId( ExpandableHListPosition position ) {
if( position.type == ExpandableHListPosition.CHILD ) {
return mAdapter.getChildId( position.groupPos, position.childPos );
}
else {
return mAdapter.getGroupId( position.groupPos );
}
}
代码示例来源:origin: gigabytedevelopers/FireFiles
private ArrayList<Long> getExpandedIds() {
ExpandableListView list = mList;
ExpandableListAdapter adapter = mAdapter;
if (adapter != null) {
int length = adapter.getGroupCount();
ArrayList<Long> expandedIds = new ArrayList<Long>();
for(int i=0; i < length; i++) {
if(list.isGroupExpanded(i)) {
expandedIds.add(adapter.getGroupId(i));
}
}
return expandedIds;
} else {
return null;
}
}
代码示例来源:origin: gigabytedevelopers/FireFiles
private void restoreExpandedState(ArrayList<Long> expandedIds) {
this.expandedIds = expandedIds;
if (expandedIds != null) {
ExpandableListView list = mList;
ExpandableListAdapter adapter = mAdapter;
if (adapter != null) {
for (int i=0; i<adapter.getGroupCount(); i++) {
long id = adapter.getGroupId(i);
if (expandedIds.contains(id)) list.expandGroup(i);
}
}
}
}
代码示例来源:origin: stackoverflow.com
final SparseBooleanArray checkedPositions = expList.getCheckedItemPositions();
final ExpandableListAdapter adapter = expList.getExpandableListAdapter();
List<Long> checkedIds = new ArrayList<Long>();
if (packedPositionType == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
for (int i = checkedPositions.size() - 1; i >= 0; i--) {
if (checkedPositions.valueAt(i)) {
checkedIds.add(adapter.getGroupId(checkedPositions.keyAt(i)));
}
}
}
代码示例来源:origin: stackoverflow.com
int gp = (int) adap.getGroupId(groupPosition);
int cp = (int) adap.getChildId(groupPosition, childPosition);
if (gp == 0) {
代码示例来源:origin: xiangzhihong/gpuImage
rowId = adapter.getGroupId( seedGroupPosition );
if( rowId == groupIdToMatch ) {
代码示例来源:origin: xiangzhihong/gpuImage
GroupMetadata.REFRESH,
posMetadata.position.groupPos,
mExpandableListAdapter.getGroupId( posMetadata.position.groupPos ) );
代码示例来源:origin: xiangzhihong/gpuImage
public long getItemId( int flatListPos ) {
final PositionMetadata posMetadata = getUnflattenedPos( flatListPos );
final long groupId = mExpandableListAdapter.getGroupId( posMetadata.position.groupPos );
long retValue;
if( posMetadata.position.type == ExpandableHListPosition.GROUP ) {
retValue = mExpandableListAdapter.getCombinedGroupId( groupId );
}
else if( posMetadata.position.type == ExpandableHListPosition.CHILD ) {
final long childId = mExpandableListAdapter.getChildId( posMetadata.position.groupPos, posMetadata.position.childPos );
retValue = mExpandableListAdapter.getCombinedChildId( groupId, childId );
}
else {
// TODO: clean exit
throw new RuntimeException( "Flat list position is of unknown type" );
}
posMetadata.recycle();
return retValue;
}
代码示例来源:origin: xiangzhihong/gpuImage
/**
* Gets the ID of the currently selected group or child. Can return -1 if no
* selection.
*
* @return The ID of the currently selected group or child. -1 if no
* selection.
*/
public long getSelectedId() {
long packedPos = getSelectedPosition();
if( packedPos == PACKED_POSITION_VALUE_NULL ) return - 1;
int groupPos = getPackedPositionGroup( packedPos );
if( getPackedPositionType( packedPos ) == PACKED_POSITION_TYPE_GROUP ) {
// It's a group
return mAdapter.getGroupId( groupPos );
}
else {
// It's a child
return mAdapter.getChildId( groupPos, getPackedPositionChild( packedPos ) );
}
}
内容来源于网络,如有侵权,请联系作者删除!