本文整理汇总了Java中android.widget.ExpandableListView.getPackedPositionForChild方法的典型用法代码示例。如果您正苦于以下问题:Java ExpandableListView.getPackedPositionForChild方法的具体用法?Java ExpandableListView.getPackedPositionForChild怎么用?Java ExpandableListView.getPackedPositionForChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ExpandableListView
的用法示例。
在下文中一共展示了ExpandableListView.getPackedPositionForChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCurrentRootChanged
import android.widget.ExpandableListView; //导入方法依赖的package包/类
public void onCurrentRootChanged() {
if (mAdapter == null || mList == null) return;
final RootInfo root = ((BaseActivity) getActivity()).getCurrentRoot();
for (int i = 0; i < mAdapter.getGroupCount(); i++) {
for (int j = 0; j < mAdapter.getChildrenCount(i); j++) {
final Object item = mAdapter.getChild(i,j);
if (item instanceof RootItem) {
final RootInfo testRoot = ((RootItem) item).root;
if (Objects.equal(testRoot, root)) {
try {
long id = ExpandableListView.getPackedPositionForChild(i, j);
int index = mList.getFlatListPosition(id);
//mList.setSelection(index);
mList.setItemChecked(index, true);
} catch (Exception e){
CrashReportingManager.logException(e);
}
return;
}
}
}
}
}
示例2: getCheckedPositions
import android.widget.ExpandableListView; //导入方法依赖的package包/类
/**
* @return list of indexes of all checked child items
*/
public List<Integer> getCheckedPositions() {
List<Integer> selected = new ArrayList<>();
for (int i = 0; i < expandableList.groups.size(); i++) {
if (expandableList.groups.get(i) instanceof CheckedExpandableGroup) {
CheckedExpandableGroup group = (CheckedExpandableGroup) expandableList.groups.get(i);
for (int j = 0; j < group.getItemCount(); j++) {
if (group.isChildChecked(j)) {
long packedPosition = ExpandableListView.getPackedPositionForChild(i, j);
selected.add(expandableList.getFlattenedChildIndex(packedPosition));
}
}
}
}
return selected;
}
示例3: getPackedPosition
import android.widget.ExpandableListView; //导入方法依赖的package包/类
public long getPackedPosition() {
if (type == CHILD) {
return ExpandableListView.getPackedPositionForChild(groupPos, childPos);
} else {
return ExpandableListView.getPackedPositionForGroup(groupPos);
}
}
示例4: getPackedPosition
import android.widget.ExpandableListView; //导入方法依赖的package包/类
long getPackedPosition() {
if (type == CHILD) return ExpandableListView.getPackedPositionForChild( groupPos, childPos );
else return ExpandableListView.getPackedPositionForGroup(groupPos);
}