public abstract class SectionedRecyclerViewAdapter.SectionedAdapterTouchHelperCallback
extends android.support.v7.widget.helper.ItemTouchHelper.Callback
Constructor and Description |
---|
SectionedAdapterTouchHelperCallback() |
Modifier and Type | Method and Description |
---|---|
void |
clearView(android.support.v7.widget.RecyclerView recyclerView,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
Allows to recognize a drop after a drag&drop operation, calling the implementation
onItemDropped(int, int, Section, Section)
to manage it |
abstract int |
getItemMovementFlags(int itemPosition,
android.support.v7.widget.RecyclerView recyclerView,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
Works just like
ItemTouchHelper.Callback.getMovementFlags(RecyclerView, RecyclerView.ViewHolder)
but directly provides the item position (do NOT use getAdapterPosition() on the ViewHolder) |
int |
getMovementFlags(android.support.v7.widget.RecyclerView recyclerView,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
Returns no allowed movement for section elements, calls the implementation
getItemMovementFlags(int, RecyclerView, RecyclerView.ViewHolder)
to the the allowed movement for the actual items |
abstract void |
onItemDropped(int itemPosition,
int targetItemPosition,
Section itemSection,
Section targetItemSection)
Similar to
ItemTouchHelper.Callback.onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
but fired only after the item is actually dropped after a drag&drop operation
NOTE: if itemPosition=targetItemPosition but itemSection!=targetItemSection the item has not been moved in the list
but its section changes (happens when the item is the last before a section and it gets moved to the first position of the next section) |
abstract boolean |
onItemMove(int itemPosition,
int targetItemPosition,
Section itemSection,
Section targetItemSection,
android.support.v7.widget.RecyclerView recyclerView,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder,
android.support.v7.widget.RecyclerView.ViewHolder target)
Works just like
ItemTouchHelper.Callback.onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
but directly provides the items positions (do NOT use getAdapterPosition() on the ViewHolders). |
abstract void |
onItemSwiped(int itemPosition,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder,
int direction)
Works just like
ItemTouchHelper.Callback.onSwiped(RecyclerView.ViewHolder, int)
but directly provides the item position (do NOT use getAdapterPosition() on the ViewHolder) |
boolean |
onMove(android.support.v7.widget.RecyclerView recyclerView,
android.support.v7.widget.RecyclerView.ViewHolder viewHolder,
android.support.v7.widget.RecyclerView.ViewHolder target)
Translates from the ELEMENTS LIST positions to the ITEMS LIST indices and then calls the implementation
onItemMove(int, int, Section, Section, RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
to manage the movement of the actual items |
void |
onSwiped(android.support.v7.widget.RecyclerView.ViewHolder viewHolder,
int direction)
Translates from the ELEMENTS LIST positions to the ITEMS LIST indices and then calls the implementation
onItemSwiped(int, RecyclerView.ViewHolder, int)
to manage the swiping of the actual items |
canDropOver, chooseDropTarget, convertToAbsoluteDirection, convertToRelativeDirection, getAnimationDuration, getBoundingBoxMargin, getDefaultUIUtil, getMoveThreshold, getSwipeEscapeVelocity, getSwipeThreshold, getSwipeVelocityThreshold, interpolateOutOfBoundsScroll, isItemViewSwipeEnabled, isLongPressDragEnabled, makeFlag, makeMovementFlags, onChildDraw, onChildDrawOver, onMoved, onSelectedChanged
public int getMovementFlags(android.support.v7.widget.RecyclerView recyclerView, android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
getItemMovementFlags(int, RecyclerView, RecyclerView.ViewHolder)
to the the allowed movement for the actual itemsgetMovementFlags
in class android.support.v7.widget.helper.ItemTouchHelper.Callback
public boolean onMove(android.support.v7.widget.RecyclerView recyclerView, android.support.v7.widget.RecyclerView.ViewHolder viewHolder, android.support.v7.widget.RecyclerView.ViewHolder target)
onItemMove(int, int, Section, Section, RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
to manage the movement of the actual itemsonMove
in class android.support.v7.widget.helper.ItemTouchHelper.Callback
public void onSwiped(android.support.v7.widget.RecyclerView.ViewHolder viewHolder, int direction)
onItemSwiped(int, RecyclerView.ViewHolder, int)
to manage the swiping of the actual itemsonSwiped
in class android.support.v7.widget.helper.ItemTouchHelper.Callback
public void clearView(android.support.v7.widget.RecyclerView recyclerView, android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
onItemDropped(int, int, Section, Section)
to manage itclearView
in class android.support.v7.widget.helper.ItemTouchHelper.Callback
public abstract int getItemMovementFlags(int itemPosition, android.support.v7.widget.RecyclerView recyclerView, android.support.v7.widget.RecyclerView.ViewHolder viewHolder)
ItemTouchHelper.Callback.getMovementFlags(RecyclerView, RecyclerView.ViewHolder)
but directly provides the item position (do NOT use getAdapterPosition() on the ViewHolder)public abstract void onItemSwiped(int itemPosition, android.support.v7.widget.RecyclerView.ViewHolder viewHolder, int direction)
ItemTouchHelper.Callback.onSwiped(RecyclerView.ViewHolder, int)
but directly provides the item position (do NOT use getAdapterPosition() on the ViewHolder)public abstract boolean onItemMove(int itemPosition, int targetItemPosition, Section itemSection, Section targetItemSection, android.support.v7.widget.RecyclerView recyclerView, android.support.v7.widget.RecyclerView.ViewHolder viewHolder, android.support.v7.widget.RecyclerView.ViewHolder target)
ItemTouchHelper.Callback.onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
but directly provides the items positions (do NOT use getAdapterPosition() on the ViewHolders).
It also provides the starting and ending sections
NOTE: if itemPosition=targetItemPosition but itemSection!=targetItemSection the item has not been moved in the list
but its section changes (happens when the item is the last before a section and it gets moved to the first position of the next section)public abstract void onItemDropped(int itemPosition, int targetItemPosition, Section itemSection, Section targetItemSection)
ItemTouchHelper.Callback.onMove(RecyclerView, RecyclerView.ViewHolder, RecyclerView.ViewHolder)
but fired only after the item is actually dropped after a drag&drop operation
NOTE: if itemPosition=targetItemPosition but itemSection!=targetItemSection the item has not been moved in the list
but its section changes (happens when the item is the last before a section and it gets moved to the first position of the next section)itemPosition
- starting positiontargetItemPosition
- ending positionitemSection
- starting sectiontargetItemSection
- ending section