public class

ObjectCellSwipeControl

extends ItemTouchHelper.SimpleCallback
java.lang.Object
   ↳ androidx.recyclerview.widget.ItemTouchHelper.Callback
     ↳ androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback
       ↳ com.sap.cloud.mobile.fiori.object.ObjectCellSwipeControl

Summary

Nested Classes
interface ObjectCellSwipeControl.ObjectCellSwipeControlListener the listener interface which user should implement in his/her own activity for the actual action corresponding to the swiping gesture. 
[Expand]
Inherited Constants
From class androidx.recyclerview.widget.ItemTouchHelper.Callback
Public Constructors
ObjectCellSwipeControl(Context context, ObjectCellSwipeControl.ObjectCellSwipeControlListener listener)
Public Methods
boolean isLongPressDragEnabled()
void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive)
boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)
void onSwiped(RecyclerView.ViewHolder viewHolder, int direction)
Call back function for Swipe gesture, which calls on the listener's onSwiped() which user should implement in his/her own Activity.
void setBackground(int resId)
Set the background color when Object Cell is being swiped off the screen.
void setIcon(int resId)
Set the icon displayed on the background when Object Cell is being swiped off the screen.
[Expand]
Inherited Methods
From class androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback
From class androidx.recyclerview.widget.ItemTouchHelper.Callback
From class java.lang.Object

Public Constructors

public ObjectCellSwipeControl (Context context, ObjectCellSwipeControl.ObjectCellSwipeControlListener listener)

Public Methods

public boolean isLongPressDragEnabled ()

public void onChildDraw (Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive)

public boolean onMove (RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target)

public void onSwiped (RecyclerView.ViewHolder viewHolder, int direction)

Call back function for Swipe gesture, which calls on the listener's onSwiped() which user should implement in his/her own Activity.

Parameters
viewHolder the view holder of the recycler view
direction the swiping direction: LEFT or RIGHT

public void setBackground (int resId)

Set the background color when Object Cell is being swiped off the screen.

Parameters
resId the resource ID for the color

public void setIcon (int resId)

Set the icon displayed on the background when Object Cell is being swiped off the screen.

Parameters
resId the resource ID for icon drawable.