public class SimpleSwipeUndoAdapter extends SwipeUndoAdapter implements UndoCallback
SwipeUndoAdapter which puts the primary and undo View in a FrameLayout,
and handles the undo click event.IGNORE_ITEM_VIEW_TYPE, NO_SELECTION| Constructor and Description |
|---|
SimpleSwipeUndoAdapter(BaseAdapter adapter,
Context context,
OnDismissCallback dismissCallback)
Create a new
SimpleSwipeUndoAdapterGen, decorating given BaseAdapter. |
| Modifier and Type | Method and Description |
|---|---|
View |
getPrimaryView(View view)
Returns the primary
View contained in given View. |
View |
getUndoView(View view)
Returns the undo
View contained in given View. |
View |
getView(int position,
View convertView,
ViewGroup parent) |
void |
onDismiss(ViewGroup listView,
int[] reverseSortedPositions)
Called when the user has indicated they she would like to dismiss one or
more list item positions.
|
void |
onDismiss(View view,
int position)
Called when the user has definitively dismissed an item.
Do NOT remove the item from the adapter here! Instead, do this in OnDismissCallback.onDismiss(android.view.ViewGroup, int[]). |
void |
onUndo(View view,
int position)
Called when the undo button is clicked for given position, and the primary
View is shown. |
void |
onUndoShown(View view,
int position)
Called when the undo
View is shown for given position. |
dismiss, getUndoCallback, setDismissableManager, setListViewWrapper, setSwipeUndoTouchListener, setUndoCallback, undoadd, areAllItemsEnabled, getCount, getDecoratedBaseAdapter, getDropDownView, getItem, getItemId, getItemViewType, getListViewWrapper, getPositionForSection, getRootAdapter, getSectionForPosition, getSections, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAbsListView, swapItems, unregisterDataSetObserverpublic SimpleSwipeUndoAdapter(BaseAdapter adapter, Context context, OnDismissCallback dismissCallback)
SimpleSwipeUndoAdapterGen, decorating given BaseAdapter.undoAdapter - the BaseAdapter that is decorated. Must implement
UndoAdapter.context - the Context.dismissCallback - the OnDismissCallback that is notified of dismissed items.public View getView(int position, View convertView, ViewGroup parent)
getView in interface AdaptergetView in class SwipeUndoAdapterpublic View getPrimaryView(View view)
UndoCallbackView contained in given View.getPrimaryView in interface UndoCallbackview - the parent View, which contains both the primary and the undo Views.public View getUndoView(View view)
UndoCallbackView contained in given View.getUndoView in interface UndoCallbackview - the parent View, which contains both the primary and the undo Views.public void onUndoShown(View view, int position)
UndoCallbackView is shown for given position.onUndoShown in interface UndoCallbackview - the parent View, which contains both the primary and the undo Views.position - the position for which the undo View is shown.public void onUndo(View view, int position)
UndoCallbackView is shown.onUndo in interface UndoCallbackview - the parent View, which contains both the primary and the undo Views.position - the position for which the button has been clicked.public void onDismiss(View view, int position)
UndoCallbackOnDismissCallback.onDismiss(android.view.ViewGroup, int[]).onDismiss in interface UndoCallbackview - the parent View, which contains both the primary and the undo Views.position - the position of the item that is dismissed.public void onDismiss(ViewGroup listView, int[] reverseSortedPositions)
OnDismissCallbackonDismiss in interface OnDismissCallbacklistView - The originating ListView implementationreverseSortedPositions - An array of positions to dismiss, sorted in descending order
for convenience.