public class RecyclerViewSwipeDecorator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RecyclerViewSwipeDecorator.Builder
A Builder for the RecyclerViewSwipeDecorator class
|
| Constructor and Description |
|---|
RecyclerViewSwipeDecorator(android.graphics.Canvas canvas,
RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder,
float dX,
float dY,
int actionState,
boolean isCurrentlyActive)
Create a @RecyclerViewSwipeDecorator
|
RecyclerViewSwipeDecorator(android.content.Context context,
android.graphics.Canvas canvas,
RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder,
float dX,
float dY,
int actionState,
boolean isCurrentlyActive)
Deprecated.
in RecyclerViewSwipeDecorator 1.2.2
|
| Modifier and Type | Method and Description |
|---|---|
void |
decorate()
Decorate the RecyclerView item with the chosen backgrounds and icons
|
void |
setActionIconId(int actionIconId)
Set the action icon for either (left/right) swipe directions
|
void |
setActionIconTint(int color)
Set the tint color for either (left/right) action icons
|
void |
setBackgroundColor(int backgroundColor)
Set the background color for either (left/right) swipe directions
|
void |
setIconHorizontalMargin(int iconHorizontalMargin)
Deprecated.
in RecyclerViewSwipeDecorator 1.2, use
setIconHorizontalMargin(int, int) instead. |
void |
setIconHorizontalMargin(int unit,
int iconHorizontalMargin)
Set the horizontal margin of the icon in the given unit (default is 16dp)
|
void |
setSwipeLeftActionIconId(int swipeLeftActionIconId)
Set the action icon for left swipe direction
|
void |
setSwipeLeftActionIconTint(int color)
Set the tint color for action icon drawn while swiping left
|
void |
setSwipeLeftBackgroundColor(int swipeLeftBackgroundColor)
Set the background color for left swipe direction
|
void |
setSwipeLeftLabel(java.lang.String label)
Set the label shown when swiping left
|
void |
setSwipeLeftTextColor(int color)
Set the color of the text shown when swiping left
|
void |
setSwipeLeftTextSize(int unit,
float size)
Set the size of the text shown when swiping left
|
void |
setSwipeLeftTypeface(android.graphics.Typeface typeface)
Set the Typeface of the text shown when swiping left
|
void |
setSwipeRightActionIconId(int swipeRightActionIconId)
Set the action icon for right swipe direction
|
void |
setSwipeRightActionIconTint(int color)
Set the tint color for action icon drawn while swiping right
|
void |
setSwipeRightBackgroundColor(int swipeRightBackgroundColor)
Set the background color for right swipe direction
|
void |
setSwipeRightLabel(java.lang.String label)
Set the label shown when swiping right
|
void |
setSwipeRightTextColor(int color)
Set the color of the text shown when swiping right
|
void |
setSwipeRightTextSize(int unit,
float size)
Set the size of the text shown when swiping right
|
void |
setSwipeRightTypeface(android.graphics.Typeface typeface)
Set the Typeface of the text shown when swiping right
|
@Deprecated
public RecyclerViewSwipeDecorator(android.content.Context context,
android.graphics.Canvas canvas,
RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder,
float dX,
float dY,
int actionState,
boolean isCurrentlyActive)
context - A valid Context object for the RecyclerViewcanvas - The canvas which RecyclerView is drawing its childrenrecyclerView - The RecyclerView to which ItemTouchHelper is attached toviewHolder - The ViewHolder which is being interacted by the User or it was interacted and simply animating to its original positiondX - The amount of horizontal displacement caused by user's actiondY - The amount of vertical displacement caused by user's actionactionState - The type of interaction on the View. Is either ACTION_STATE_DRAG or ACTION_STATE_SWIPE.isCurrentlyActive - True if this view is currently being controlled by the user or false it is simply animating back to its original statepublic RecyclerViewSwipeDecorator(android.graphics.Canvas canvas,
RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder,
float dX,
float dY,
int actionState,
boolean isCurrentlyActive)
canvas - The canvas which RecyclerView is drawing its childrenrecyclerView - The RecyclerView to which ItemTouchHelper is attached toviewHolder - The ViewHolder which is being interacted by the User or it was interacted and simply animating to its original positiondX - The amount of horizontal displacement caused by user's actiondY - The amount of vertical displacement caused by user's actionactionState - The type of interaction on the View. Is either ACTION_STATE_DRAG or ACTION_STATE_SWIPE.isCurrentlyActive - True if this view is currently being controlled by the user or false it is simply animating back to its original statepublic void setBackgroundColor(int backgroundColor)
backgroundColor - The resource id of the background color to be setpublic void setActionIconId(int actionIconId)
actionIconId - The resource id of the icon to be setpublic void setActionIconTint(int color)
color - a color in ARGB format (e.g. 0xFF0000FF for blue)public void setSwipeLeftBackgroundColor(int swipeLeftBackgroundColor)
swipeLeftBackgroundColor - The resource id of the background color to be setpublic void setSwipeLeftActionIconId(int swipeLeftActionIconId)
swipeLeftActionIconId - The resource id of the icon to be setpublic void setSwipeLeftActionIconTint(int color)
color - a color in ARGB format (e.g. 0xFF0000FF for blue)public void setSwipeRightBackgroundColor(int swipeRightBackgroundColor)
swipeRightBackgroundColor - The resource id of the background color to be setpublic void setSwipeRightActionIconId(int swipeRightActionIconId)
swipeRightActionIconId - The resource id of the icon to be setpublic void setSwipeRightActionIconTint(int color)
color - a color in ARGB format (e.g. 0xFF0000FF for blue)public void setSwipeRightLabel(java.lang.String label)
label - a Stringpublic void setSwipeRightTextSize(int unit,
float size)
unit - TypedValue (default is COMPLEX_UNIT_SP)size - the size valuepublic void setSwipeRightTextColor(int color)
color - the color to be setpublic void setSwipeRightTypeface(android.graphics.Typeface typeface)
typeface - the Typeface to be set@Deprecated public void setIconHorizontalMargin(int iconHorizontalMargin)
setIconHorizontalMargin(int, int) instead.iconHorizontalMargin - the margin in pixelspublic void setIconHorizontalMargin(int unit,
int iconHorizontalMargin)
unit - TypedValueiconHorizontalMargin - the margin in the given unitpublic void setSwipeLeftLabel(java.lang.String label)
label - a Stringpublic void setSwipeLeftTextSize(int unit,
float size)
unit - TypedValue (default is COMPLEX_UNIT_SP)size - the size valuepublic void setSwipeLeftTextColor(int color)
color - the color to be setpublic void setSwipeLeftTypeface(android.graphics.Typeface typeface)
typeface - the Typeface to be setpublic void decorate()