public class AdapterUtil
extends java.lang.Object
| Constructor and Description |
|---|
AdapterUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <Item extends IItem> |
addAllSubItems(Item item,
java.util.List<Item> items)
Gets all subItems from a given parent item
|
static java.util.Set<java.lang.Integer> |
adjustPosition(java.util.Set<java.lang.Integer> positions,
int startPosition,
int endPosition,
int adjustBy)
internal method to handle the selections if items are added / removed
|
static android.util.SparseIntArray |
adjustPosition(android.util.SparseIntArray positions,
int startPosition,
int endPosition,
int adjustBy)
internal method to handle the selections if items are added / removed
|
static <Item extends IItem> |
findSubItemSelections(Item item,
java.util.List<java.lang.String> selections)
internal method to find all selections from subItems and sub sub items so we can save those inside our savedInstanceState
|
static <Item extends IItem> |
getAllItems(FastAdapter<Item> fastAdapter)
Gets all items (including sub items) from the FastAdapter
|
static <Item extends IItem> |
handleStates(FastAdapter<Item> fastAdapter,
int startPosition,
int endPosition)
internal method which correctly set the selected state and expandable state on the newly added items
|
static <Item extends IItem> |
restoreSubItemSelectionStatesForAlternativeStateManagement(Item item,
java.util.List<java.lang.String> selectedItems)
internal method to restore the selection state of subItems
|
public static <Item extends IItem> void handleStates(FastAdapter<Item> fastAdapter, int startPosition, int endPosition)
fastAdapter - the fastAdapter which manages everythingstartPosition - the position of the first item to handleendPosition - the position of the last item to handlepublic static java.util.Set<java.lang.Integer> adjustPosition(java.util.Set<java.lang.Integer> positions,
int startPosition,
int endPosition,
int adjustBy)
positions - the positions map which should be adjustedstartPosition - the global index of the first element modifiedendPosition - the global index up to which the modification changed the indices (should be MAX_INT if we check til the end)adjustBy - the value by which the data was shiftedpublic static android.util.SparseIntArray adjustPosition(android.util.SparseIntArray positions,
int startPosition,
int endPosition,
int adjustBy)
positions - the positions map which should be adjustedstartPosition - the global index of the first element modifiedendPosition - the global index up to which the modification changed the indices (should be MAX_INT if we check til the end)adjustBy - the value by which the data was shiftedpublic static <Item extends IItem> void restoreSubItemSelectionStatesForAlternativeStateManagement(Item item, java.util.List<java.lang.String> selectedItems)
item - the parent itemselectedItems - the list of selectedItems from the savedInstanceStatepublic static <Item extends IItem> void findSubItemSelections(Item item, java.util.List<java.lang.String> selections)
item - the parent itemselections - the ArrayList which will be stored in the savedInstanceStatepublic static <Item extends IItem> java.util.List<Item> getAllItems(FastAdapter<Item> fastAdapter)
fastAdapter - the FastAdapterpublic static <Item extends IItem> void addAllSubItems(Item item, java.util.List<Item> items)
item - the parent from which we add all itemsitems - the list in which we add the subItems