java.lang.Object | |
↳ | com.h6ah4i.android.widget.advrecyclerview.swipeable.RecyclerViewSwipeManager |
Provides item swipe operation for android.support.v7.widget.RecyclerView
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | RecyclerViewSwipeManager.OnItemSwipeEventListener | Used for listening item swipe events |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.h6ah4i.android.widget.advrecyclerview.swipeable.SwipeableItemConstants
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecyclerViewSwipeManager()
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
attachRecyclerView(RecyclerView rv)
Attaches android.support.v7.widget.RecyclerView instance. | ||||||||||
void | cancelSwipe() | ||||||||||
Adapter |
createWrappedAdapter(Adapter adapter)
Create wrapped adapter.
| ||||||||||
long |
getMoveToOutsideWindowAnimationDuration()
Gets the duration of the "move to outside of the window" animation
| ||||||||||
long |
getMoveToSpecifiedPositionAnimationDuration()
Gets the duration of the "move to specified position" animation
| ||||||||||
RecyclerViewSwipeManager.OnItemSwipeEventListener |
getOnItemSwipeEventListener()
Gets OnItemSwipeEventListener listener
| ||||||||||
long |
getReturnToDefaultPositionAnimationDuration()
Gets the duration of the "return to default position" animation
| ||||||||||
int |
getSwipeThresholdDistance()
Gets swipe threshold distance.
| ||||||||||
boolean |
isReleased()
Indicates this manager instance has released or not.
| ||||||||||
boolean |
isSwiping()
Indicates whether currently performing item swiping.
| ||||||||||
boolean |
performFakeSwipe(RecyclerView.ViewHolder holder, int result)
Perform fake swiping.
| ||||||||||
void |
release()
Detach the android.support.v7.widget.RecyclerView instance and release internal field references. | ||||||||||
void |
setLongPressTimeout(int longPressTimeout)
Sets the time required to consider press as long press.
| ||||||||||
void |
setMoveToOutsideWindowAnimationDuration(long duration)
Sets the duration of the "move to outside of the window" animation
| ||||||||||
void |
setMoveToSpecifiedPositionAnimationDuration(long duration)
Sets the duration of the "move to specified position" animation
| ||||||||||
void |
setOnItemSwipeEventListener(RecyclerViewSwipeManager.OnItemSwipeEventListener listener)
Sets OnItemSwipeEventListener listener
| ||||||||||
void |
setReturnToDefaultPositionAnimationDuration(long duration)
Sets the duration of the "return to default position" animation
| ||||||||||
void |
setSwipeThresholdDistance(int distanceInPixels)
Sets swipe threshold distance.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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 |
---|
Create wrapped adapter.
adapter | The target adapter. |
---|
RecyclerViewSwipeManager
instance.
Gets the duration of the "move to outside of the window" animation
Gets the duration of the "move to specified position" animation
Gets OnItemSwipeEventListener listener
Gets the duration of the "return to default position" animation
Gets swipe threshold distance.
Indicates this manager instance has released or not.
Indicates whether currently performing item swiping.
Perform fake swiping.
holder | Target ViewHolder. |
---|---|
result | swipe result code |
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 the time required to consider press as long press. (default: 500ms)
longPressTimeout | Integer in milli seconds. |
---|
Sets the duration of the "move to outside of the window" animation
duration | Duration of the "move to outside of the window" animation in milliseconds |
---|
Sets the duration of the "move to specified position" animation
duration | Duration of the "move to specified position" animation in milliseconds |
---|
Sets OnItemSwipeEventListener listener
listener | The listener object |
---|
Sets the duration of the "return to default position" animation
duration | Duration of the "return to default position" animation in milliseconds |
---|
Sets swipe threshold distance.
distanceInPixels | Integer specifies threshold distance in pixels. |
---|