ListHeterogeneouspublic class ListHeterogeneous extends android.util.ListScenario List that has different view types |
Methods Summary |
---|
public android.view.View | convertView(int position, android.view.View convertView, android.view.ViewGroup parent)
switch (position % 3) {
case 0:
return ListItemFactory.convertText(convertView, getValueAtPosition(position), position);
case 1:
return ListItemFactory.convertButton(convertView, getValueAtPosition(position),
position);
case 2:
return ListItemFactory.convertDoubleText(convertView, getValueAtPosition(position),
position);
}
return null;
| protected android.view.View | createView(int position, android.view.ViewGroup parent, int desiredHeight)
switch (position % 3) {
case 0:
return ListItemFactory.text(
position, parent.getContext(), getValueAtPosition(position), desiredHeight);
case 1:
return ListItemFactory.button(
position, parent.getContext(), getValueAtPosition(position), desiredHeight);
case 2:
return ListItemFactory.doubleText(
position, parent.getContext(), getValueAtPosition(position), desiredHeight);
}
return null;
| public int | getItemViewType(int position)
return position % 3;
| public int | getViewTypeCount()
return 3;
| protected void | init(Params params)
params.setNumItems(50)
.setItemScreenSizeFactor(1.0 / 8)
.setItemsFocusable(true)
.setHeaderViewCount(3)
.setFooterViewCount(2);
|
|