android.widget.ExpandableListAdapter.getChildId()方法的使用及代码示例

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

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

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 ) );
  }
}

相关文章