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