public abstract class SwipeUndoAdapter
extends com.nhaarman.listviewanimations.BaseAdapterDecorator
AbsListView, using a SwipeUndoTouchListener.IGNORE_ITEM_VIEW_TYPE, NO_SELECTION| Modifier | Constructor and Description |
|---|---|
protected |
SwipeUndoAdapter(BaseAdapter baseAdapter,
UndoCallback undoCallback)
Create a new
SwipeUndoAdapter, decorating given BaseAdapter. |
| Modifier and Type | Method and Description |
|---|---|
void |
dismiss(int position)
Dismisses the
View corresponding to given position. |
UndoCallback |
getUndoCallback() |
View |
getView(int position,
View convertView,
ViewGroup parent) |
void |
setDismissableManager(DismissableManager dismissableManager)
Sets the
DismissableManager to specify which views can or cannot be swiped. |
void |
setListViewWrapper(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper) |
void |
setSwipeUndoTouchListener(SwipeUndoTouchListener swipeUndoTouchListener) |
void |
setUndoCallback(UndoCallback undoCallback)
Sets the
UndoCallback to use. |
void |
undo(View view)
Performs the undo animation and restores the original state for given
View. |
add, areAllItemsEnabled, getCount, getDecoratedBaseAdapter, getDropDownView, getItem, getItemId, getItemViewType, getListViewWrapper, getPositionForSection, getRootAdapter, getSectionForPosition, getSections, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAbsListView, swapItems, unregisterDataSetObserverprotected SwipeUndoAdapter(BaseAdapter baseAdapter, UndoCallback undoCallback)
SwipeUndoAdapter, decorating given BaseAdapter.baseAdapter - the BaseAdapter to decorate.undoCallback - the UndoCallback that is used.public void setListViewWrapper(com.nhaarman.listviewanimations.util.ListViewWrapper listViewWrapper)
setListViewWrapper in interface com.nhaarman.listviewanimations.util.ListViewWrapperSettersetListViewWrapper in class com.nhaarman.listviewanimations.BaseAdapterDecoratorpublic void setDismissableManager(DismissableManager dismissableManager)
DismissableManager to specify which views can or cannot be swiped.dismissableManager - null for no restrictions.public void setSwipeUndoTouchListener(SwipeUndoTouchListener swipeUndoTouchListener)
public void setUndoCallback(UndoCallback undoCallback)
UndoCallback to use.public UndoCallback getUndoCallback()
public void undo(View view)
View.view - the parent View which contains both primary and undo Views.public void dismiss(int position)
View corresponding to given position. Calling this method has the same effect as manually swiping an item off the screen.position - the position of the item in the ListAdapter. Must be visible.