Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pknotfound committed Oct 24, 2020
2 parents 6d61ab0 + 1abea1a commit 8073a94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Use *addSwipeToDelete* as RecyclerView's extension function, to add this functio
This extension function has **two** optional parameter.
> The first parameter is the list of directions in which swipe should be allowed. The directions can be either **TOP**, **BOTTOM**, **RIGHT**, **LEFT**.
The list of directions can be made like this,
`val list = listOf(SwipeToDelete.DIRECTION.LEFT,SwipeToDelete.DIRECTION.RIGHT)`
`val list = listOf(DIRECTION.LEFT,DIRECTION.RIGHT)`
If no value is passed for the list, by default, **RIGHT** is the direction for swipe.

> The second parameter is the *listener* for the interface method. The by default value of this parameter is null. If passed, the activity/fragment should implement `SwipeToDelete.OnSwiped`. This method will be called when the RecyclerView item is swiped out, and it returns the position of the element that was swiped.
> The second parameter is the *listener* for the interface method. The by default value of this parameter is null. If passed, the activity/fragment should implement `OnSwiped`. This method will be called when the RecyclerView item is swiped out, and it returns the position of the element that was swiped.
**Implementation of interface method**
In a notes app, if you wish to delete the note from your database, after it is swiped, then you can used this method to perform the action. The note can be deleted by getting the *NOTE* using the adapter position inside the list passed to RecyclerView Adapter.
Expand Down Expand Up @@ -68,7 +68,7 @@ ___
Highlight, move and shift items of RecyclerView with just a single line of code.
Use *addDragToShift* as RecyclerView's extension function, to add this functionality to your RecyclerView. This extension has **one** optional parameter.

> The parameter is the listener for the interface method. The by default value for this parameter is null. If passed, the activity/fragment should implement `DragAndDrop.onDragged`. This method will be called when the RecyclerView item is dragged and dropped to some other position, and it returns the two positions that were swapped.
> The parameter is the listener for the interface method. The by default value for this parameter is null. If passed, the activity/fragment should implement `onDragged`. This method will be called when the RecyclerView item is dragged and dropped to some other position, and it returns the two positions that were swapped.
**Implementation of interface method** :-
In a notes app, if you wish to change positions of two notes in your database, after they are swapped, then you can used this method to perform the action. The notes can be swapped by getting the _NOTES_ using the adapter positions inside the list passed to RecyclerView Adapter.
Expand Down

0 comments on commit 8073a94

Please sign in to comment.