public class InsertQueue<T> extends Object
.AnimateAdditionAdapter.Insertable#add
(int, Object) method will be called directly if there are no active index-item pairs.
Otherwise, pairs will be queued until the active list is empty.| Constructor and Description |
|---|
InsertQueue(com.nhaarman.listviewanimations.util.Insertable<T> insertable) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearActive()
Clears the active states and inserts any pending pairs if applicable.
|
Collection<Integer> |
getActiveIndexes()
Returns a collection of currently active indexes.
|
List<Pair<Integer,T>> |
getPendingItemsToInsert()
Returns a
List of Pairs with the index and items that are pending to be inserted, in the order they were requested. |
void |
insert(Collection<Pair<Integer,T>> indexItemPairs) |
void |
insert(int index,
T item)
Insert an item into the queue at given index.
|
void |
insert(Pair<Integer,T>... indexItemPair) |
void |
removeActiveIndex(int index)
Clear the active state for given index.
|
public InsertQueue(com.nhaarman.listviewanimations.util.Insertable<T> insertable)
public void insert(int index,
T item)
Insertable.add(int,
Object) if there are no active index-item pairs. Otherwise, the pair will be queued.index - the index at which the item should be inserted.item - the item to insert.public void insert(Collection<Pair<Integer,T>> indexItemPairs)
public void clearActive()
public void removeActiveIndex(int index)
index - the index to remove.public Collection<Integer> getActiveIndexes()