java.lang.Object | |
↳ | com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager |
Provides item drag & drop operation for android.support.v7.widget.RecyclerView
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
@interface | RecyclerViewDragDropManager.ItemMoveMode | ||||||||||
interface | RecyclerViewDragDropManager.OnItemDragEventListener | Used for listening item drag events |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ITEM_MOVE_MODE_DEFAULT | Default item move mode | |||||||||
int | ITEM_MOVE_MODE_SWAP | Swap two items between dragging item and the item under a finger (or mouse pointer) |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.h6ah4i.android.widget.advrecyclerview.draggable.DraggableItemConstants
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final Interpolator | DEFAULT_ITEM_SETTLE_BACK_INTO_PLACE_ANIMATION_INTERPOLATOR | Default interpolator used for "item settle back into place" animation | |||||||||
public static final Interpolator | DEFAULT_SWAP_TARGET_TRANSITION_INTERPOLATOR | Default interpolator used for "swap target transition" |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecyclerViewDragDropManager()
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
attachRecyclerView(RecyclerView rv)
Attaches android.support.v7.widget.RecyclerView instance. | ||||||||||
void |
cancelDrag()
Cancel dragging.
| ||||||||||
Adapter |
createWrappedAdapter(Adapter adapter)
Create wrapped adapter.
| ||||||||||
float |
getDragEdgeScrollSpeed()
Gets drag edge scroll speed.
| ||||||||||
Interpolator |
getDragStartItemAlphaAnimationInterpolator()
Gets the interpolator which ise used for "drag start alpha" animation.
| ||||||||||
int |
getDragStartItemAnimationDuration()
Gets the duration of "drag start" animation.
| ||||||||||
Interpolator |
getDragStartItemRotationAnimationInterpolator()
Gets the interpolator which ise used for "drag start rotation" animation.
| ||||||||||
Interpolator |
getDragStartItemScaleAnimationInterpolator()
Gets the interpolator which ise used for "drag start scaling" animation.
| ||||||||||
float |
getDraggingItemAlpha()
Gets dragging item alpha.
| ||||||||||
float |
getDraggingItemRotation()
Gets dragging item rotation.
| ||||||||||
float |
getDraggingItemScale()
Gets dragging item scaling factor.
| ||||||||||
int |
getItemMoveMode()
Gets item move mode
| ||||||||||
int |
getItemSettleBackIntoPlaceAnimationDuration()
Gets the duration of "settle back into place" animation.
| ||||||||||
Interpolator |
getItemSettleBackIntoPlaceAnimationInterpolator()
Gets the interpolator which ise used for "settle back into place" animation.
| ||||||||||
RecyclerViewDragDropManager.OnItemDragEventListener |
getOnItemDragEventListener()
Gets OnItemDragEventListener listener
| ||||||||||
boolean |
isCheckCanDropEnabled()
Gets whether to use
onCheckCanDrop(int, int) . | ||||||||||
boolean |
isDragging()
Indicates whether currently performing item dragging.
| ||||||||||
boolean |
isInitiateOnLongPressEnabled()
Returns whether dragging starts on a long press or not.
| ||||||||||
boolean |
isInitiateOnMoveEnabled()
Returns whether dragging starts on move motions.
| ||||||||||
boolean |
isInitiateOnTouchEnabled()
Returns whether dragging starts on touch the handle immediately.
| ||||||||||
boolean |
isReleased()
Indicates this manager instance has released or not.
| ||||||||||
void |
release()
Detach the android.support.v7.widget.RecyclerView instance and release internal field references. | ||||||||||
void |
setCheckCanDropEnabled(boolean enabled)
Sets whether to use
onCheckCanDrop(int, int) . | ||||||||||
void |
setDragEdgeScrollSpeed(float speed)
Sets drag edge scroll speed.
| ||||||||||
void |
setDragStartItemAlphaAnimationInterpolator(Interpolator interpolator)
Sets the interpolator which is used for "drag start alpha" item animation.
| ||||||||||
void |
setDragStartItemAnimationDuration(int duration)
Sets duration of "drag start" item animation.
| ||||||||||
void |
setDragStartItemRotationAnimationInterpolator(Interpolator interpolator)
Sets the interpolator which is used for "drag start rotation" item animation.
| ||||||||||
void |
setDragStartItemScaleAnimationInterpolator(Interpolator interpolator)
Sets the interpolator which is used for "drag start scaling" item animation.
| ||||||||||
void |
setDraggingItemAlpha(float alpha)
Sets dragging item alpha.
| ||||||||||
void |
setDraggingItemRotation(float rotation)
Sets dragging item rotation.
| ||||||||||
void |
setDraggingItemScale(float scale)
Sets dragging item scaling factor.
| ||||||||||
void |
setDraggingItemShadowDrawable(NinePatchDrawable drawable)
Sets 9-patch image which is used for the actively dragging item
| ||||||||||
void |
setInitiateOnLongPress(boolean initiateOnLongPress)
Sets whether dragging starts on a long press.
| ||||||||||
void |
setInitiateOnMove(boolean initiateOnMove)
Sets whether dragging starts on move motions.
| ||||||||||
void |
setInitiateOnTouch(boolean initiateOnTouch)
Sets whether dragging starts on touch the handle immediately.
| ||||||||||
void |
setItemMoveMode(int mode)
Sets item move
| ||||||||||
void |
setItemSettleBackIntoPlaceAnimationDuration(int duration)
Sets the duration of "settle back into place" animation.
| ||||||||||
void |
setItemSettleBackIntoPlaceAnimationInterpolator(Interpolator interpolator)
Sets the interpolator which is used for "settle back into place" animation.
| ||||||||||
void |
setLongPressTimeout(int longPressTimeout)
Sets the time required to consider press as long press.
| ||||||||||
void |
setOnItemDragEventListener(RecyclerViewDragDropManager.OnItemDragEventListener listener)
Sets OnItemDragEventListener listener
| ||||||||||
Interpolator |
setSwapTargetTranslationInterpolator()
Gets the interpolator which ise used for determining the position of the swapping item.
| ||||||||||
void |
setSwapTargetTranslationInterpolator(Interpolator interpolator)
Sets the interpolator which is used for determining the position of the swapping item.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Default item move mode
Swap two items between dragging item and the item under a finger (or mouse pointer)
Default interpolator used for "item settle back into place" animation
Default interpolator used for "swap target transition"
Constructor.
Attaches android.support.v7.widget.RecyclerView instance.
Before calling this method, the target android.support.v7.widget.RecyclerView must set
the wrapped adapter instance which is returned by the
createWrappedAdapter(android.support.v7.widget.RecyclerView.Adapter)
method.
rv | The android.support.v7.widget.RecyclerView instance |
---|
Cancel dragging.
Create wrapped adapter.
adapter | The target adapter. |
---|
RecyclerViewDragDropManager
instance.
Gets drag edge scroll speed.
Gets the interpolator which ise used for "drag start alpha" animation.
Gets the duration of "drag start" animation.
Gets the interpolator which ise used for "drag start rotation" animation.
Gets the interpolator which ise used for "drag start scaling" animation.
Gets dragging item alpha.
Gets dragging item rotation.
Gets dragging item scaling factor.
Gets item move mode
Gets the duration of "settle back into place" animation.
Gets the interpolator which ise used for "settle back into place" animation.
Gets OnItemDragEventListener listener
Gets whether to use onCheckCanDrop(int, int)
.
onCheckCanDrop(int, int)
is used, false otherwise.
Indicates whether currently performing item dragging.
Returns whether dragging starts on a long press or not.
Returns whether dragging starts on move motions.
Returns whether dragging starts on touch the handle immediately.
Indicates this manager instance has released or not.
Detach the android.support.v7.widget.RecyclerView instance and release internal field references.
This method should be called in order to avoid memory leaks.
Sets whether to use onCheckCanDrop(int, int)
.
enabled | True if use onCheckCanDrop(int, int) .
|
---|
Sets drag edge scroll speed.
speed | The coefficient value of drag edge scrolling speed. (valid range: 0.0f .. 2.0) |
---|
Sets the interpolator which is used for "drag start alpha" item animation.
interpolator | Interpolator to set or null to clear |
---|
Sets duration of "drag start" item animation.
duration | Specify the animation duration in milliseconds |
---|
Sets the interpolator which is used for "drag start rotation" item animation.
interpolator | Interpolator to set or null to clear |
---|
Sets the interpolator which is used for "drag start scaling" item animation.
interpolator | Interpolator to set or null to clear |
---|
Sets dragging item alpha.
alpha | Alpha (e.g. 1.0: fully opaque, 0.0: fully transparent) |
---|
Sets dragging item rotation.
rotation | Rotation in degrees |
---|
Sets dragging item scaling factor.
scale | Scaling factor (e.g. 1.0: no scaling, 2.0: 2x scaling) |
---|
Sets 9-patch image which is used for the actively dragging item
drawable | The 9-patch drawable |
---|
Sets whether dragging starts on a long press. (default: false)
initiateOnLongPress | True to initiate dragging on long press. |
---|
Sets whether dragging starts on move motions. (default: true)
initiateOnMove | True to initiate dragging on move motions. |
---|
Sets whether dragging starts on touch the handle immediately. (default: false)
initiateOnTouch | True to initiate dragging on touch the handle immediately. |
---|
Sets item move
mode | item move mode |
---|
Sets the duration of "settle back into place" animation.
duration | Specify the animation duration in milliseconds |
---|
Sets the interpolator which is used for "settle back into place" animation.
interpolator | Interpolator to set or null to clear |
---|
Sets the time required to consider press as long press. (default: 500ms)
longPressTimeout | Integer in milli seconds. |
---|
Sets OnItemDragEventListener listener
listener | The listener object |
---|
Gets the interpolator which ise used for determining the position of the swapping item.
Sets the interpolator which is used for determining the position of the swapping item.
interpolator | Interpolator to set or null to clear |
---|