Methods Summary |
---|
public boolean | areAllItemsEnabled()
return true;
|
private void | createItems(java.lang.Iterable iterable, int itemCount, int repeatCount, java.util.List types, int depth)
// Need an array to count for each type.
// This is likely too big, but is the max it can be.
int[] typeCount = new int[itemCount];
// we put several repeating sets.
for (int r = 0 ; r < repeatCount ; r++) {
// loop on the type of list items, and add however many for each type.
for (DataBindingItem dataBindingItem : iterable) {
ResourceReference viewRef = dataBindingItem.getViewReference();
int typeIndex = types.indexOf(viewRef);
if (typeIndex == -1) {
typeIndex = types.size();
types.add(viewRef);
}
List<DataBindingItem> children = dataBindingItem.getChildren();
int count = dataBindingItem.getCount();
// if there are children, we use the count as a repeat count for the children.
if (children.size() > 0) {
count = 1;
}
int index = typeCount[typeIndex];
typeCount[typeIndex] += count;
for (int k = 0 ; k < count ; k++) {
AdapterItem item = new AdapterItem(dataBindingItem, typeIndex, mItems.size(),
index++);
mItems.add(item);
if (children.size() > 0) {
createItems(dataBindingItem, depth + 1);
}
}
}
}
|
private void | createItems(com.android.ide.common.rendering.api.DataBindingItem item, int depth)
if (depth == 2) {
createItems(item, item.getChildren().size(), item.getCount(), mChildrenTypes, depth);
}
|
public java.lang.Object | getChild(int groupPosition, int childPosition)
return getChildItem(groupPosition, childPosition);
|
public long | getChildId(int groupPosition, int childPosition)
return childPosition;
|
private AdapterItem | getChildItem(int groupPosition, int childPosition)
AdapterItem item = mItems.get(groupPosition);
List<AdapterItem> children = item.getChildren();
return children.get(childPosition);
|
public int | getChildType(int groupPosition, int childPosition)
return getChildItem(groupPosition, childPosition).getType();
|
public int | getChildTypeCount()
return mChildrenTypes.size();
|
public android.view.View | getChildView(int groupPosition, int childPosition, boolean isLastChild, android.view.View convertView, android.view.ViewGroup parent)
// we don't care about recycling here because we never scroll.
AdapterItem parentItem = mItems.get(groupPosition);
AdapterItem item = getChildItem(groupPosition, childPosition);
Pair<View, Boolean> pair = AdapterHelper.getView(item, parentItem, parent, mCallback,
mAdapterRef, mSkipCallbackParser);
mSkipCallbackParser = pair.getSecond();
return pair.getFirst();
|
public int | getChildrenCount(int groupPosition)
AdapterItem item = mItems.get(groupPosition);
return item.getChildren().size();
|
public long | getCombinedChildId(long groupId, long childId)
return groupId << 16 | childId;
|
public long | getCombinedGroupId(long groupId)
return groupId << 16 | 0x0000FFFF;
|
public java.lang.Object | getGroup(int groupPosition)
return mItems.get(groupPosition);
|
public int | getGroupCount()
return mItems.size();
|
public long | getGroupId(int groupPosition)
return groupPosition;
|
public int | getGroupType(int groupPosition)
return mItems.get(groupPosition).getType();
|
public int | getGroupTypeCount()
return mGroupTypes.size();
|
public android.view.View | getGroupView(int groupPosition, boolean isExpanded, android.view.View convertView, android.view.ViewGroup parent)
// we don't care about recycling here because we never scroll.
AdapterItem item = mItems.get(groupPosition);
Pair<View, Boolean> pair = AdapterHelper.getView(item, null /*parentItem*/, parent,
mCallback, mAdapterRef, mSkipCallbackParser);
mSkipCallbackParser = pair.getSecond();
return pair.getFirst();
|
public boolean | hasStableIds()
return true;
|
public boolean | isChildSelectable(int groupPosition, int childPosition)
return true;
|
public boolean | isEmpty()
return mItems.isEmpty();
|
public void | onGroupCollapsed(int groupPosition)
// pass
|
public void | onGroupExpanded(int groupPosition)
// pass
|
public void | registerDataSetObserver(android.database.DataSetObserver observer)
// pass
|
public void | unregisterDataSetObserver(android.database.DataSetObserver observer)
// pass
|