当前位置: 首页>>代码示例>>Java>>正文


Java ExpandableListAdapter.getGroupId方法代码示例

本文整理汇总了Java中android.widget.ExpandableListAdapter.getGroupId方法的典型用法代码示例。如果您正苦于以下问题:Java ExpandableListAdapter.getGroupId方法的具体用法?Java ExpandableListAdapter.getGroupId怎么用?Java ExpandableListAdapter.getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ExpandableListAdapter的用法示例。


在下文中一共展示了ExpandableListAdapter.getGroupId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expandGroups

import android.widget.ExpandableListAdapter; //导入方法依赖的package包/类
public void expandGroups(long[] groupsToExpand)
{
    // this.expandedIds = expandedIds;
    if (groupsToExpand != null && groupsToExpand.length > 0)
    {
        ExpandableListAdapter adapter = getExpandableListAdapter();
        if (adapter != null)
        {
            for (int i = 0; i < adapter.getGroupCount(); i++)
            {
                long id = adapter.getGroupId(i);
                if (inArray(groupsToExpand, id))
                {
                    expandGroup(i);
                }
            }
        }
    }
}
 
开发者ID:dmfs,项目名称:opentasks,代码行数:20,代码来源:RetainExpandableListView.java

示例2: restoreExpandedState

import android.widget.ExpandableListAdapter; //导入方法依赖的package包/类
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);
            }
        }
    }
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:14,代码来源:RootsFragment.java

示例3: findGroupPosition

import android.widget.ExpandableListAdapter; //导入方法依赖的package包/类
int findGroupPosition(long groupIdToMatch, int seedGroupPosition) {
    int count = mExpandableListAdapter.getGroupCount();
    if (count == 0) {
        return AdapterView.INVALID_POSITION;
    }
    if (groupIdToMatch == AdapterView.INVALID_ROW_ID) {
        return AdapterView.INVALID_POSITION;
    }
    seedGroupPosition = Math.max(0, seedGroupPosition);
    seedGroupPosition = Math.min(count - 1, seedGroupPosition);
    long endTime = SystemClock.uptimeMillis() + AdapterView.SYNC_MAX_DURATION_MILLIS;
    long rowId;
    int first = seedGroupPosition;
    int last = seedGroupPosition;
    boolean next = false;
    boolean hitFirst;
    boolean hitLast;
    ExpandableListAdapter adapter = getAdapter();
    if (adapter == null) {
        return AdapterView.INVALID_POSITION;
    }
    while (SystemClock.uptimeMillis() <= endTime) {
        rowId = adapter.getGroupId(seedGroupPosition);
        if (rowId == groupIdToMatch) {
            return seedGroupPosition;
        }
        hitLast = last == count - 1;
        hitFirst = first == 0;
        if (hitLast && hitFirst) {
            break;
        }
        if (hitFirst || next && !hitLast) {
            last++;
            seedGroupPosition = last;
            next = false;
        } else if (hitLast || !next && !hitFirst) {
            first--;
            seedGroupPosition = first;
            next = true;
        }
    }
    return AdapterView.INVALID_POSITION;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:44,代码来源:ExpandableListConnector.java


注:本文中的android.widget.ExpandableListAdapter.getGroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。