public abstract class

AbstractSwipeableItemViewHolder

extends RecyclerView.ViewHolder
implements SwipeableItemViewHolder
java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.ViewHolder
     ↳ com.h6ah4i.android.widget.advrecyclerview.utils.AbstractSwipeableItemViewHolder
Known Direct Subclasses

Summary

[Expand]
Inherited Fields
From class android.support.v7.widget.RecyclerView.ViewHolder
Public Constructors
AbstractSwipeableItemViewHolder(View itemView)
Public Methods
int getAfterSwipeReaction()
Gets the reaction type of after swiping item.
float getMaxDownSwipeAmount()
Gets the maximum item down swipe amount.
float getMaxLeftSwipeAmount()
Gets the maximum item left swipe amount.
float getMaxRightSwipeAmount()
Gets the maximum item right swipe amount.
float getMaxUpSwipeAmount()
Gets the maximum item up swipe amount.
float getSwipeItemHorizontalSlideAmount()
Gets the amount of horizontal swipe.
float getSwipeItemVerticalSlideAmount()
Gets the amount of vertical swipe.
int getSwipeResult()
Gets the result code of swiping item.
int getSwipeStateFlags()
Gets the state flags value for swiping item
abstract View getSwipeableContainerView()
Gets the container view for the swipeable area.
boolean isProportionalSwipeAmountModeEnabled()
Gets whether the proportional swipe amount mode enabled.
void onSlideAmountUpdated(float horizontalAmount, float verticalAmount, boolean isSwiping)
Called when sets background of the swiping item.
void setAfterSwipeReaction(int reaction)
Sets the reaction type of after swiping item.
void setMaxDownSwipeAmount(float amount)
Sets the maximum item down swipe amount.
void setMaxLeftSwipeAmount(float amount)
Sets the maximum item left swipe amount.
void setMaxRightSwipeAmount(float amount)
Sets the maximum item right swipe amount.
void setMaxUpSwipeAmount(float amount)
Sets the maximum item up swipe amount.
void setProportionalSwipeAmountModeEnabled(boolean enabled)
Sets proportional swipe amount mode enabled.
void setSwipeItemHorizontalSlideAmount(float amount)
Sets the amount of horizontal swipe.
void setSwipeItemVerticalSlideAmount(float amount)
Sets the amount of vertical swipe.
void setSwipeResult(int result)
Sets the result code of swiping item.
void setSwipeStateFlags(int flags)
Sets the state flags value for swiping item
[Expand]
Inherited Methods
From class android.support.v7.widget.RecyclerView.ViewHolder
From class java.lang.Object
From interface com.h6ah4i.android.widget.advrecyclerview.swipeable.SwipeableItemViewHolder

Public Constructors

public AbstractSwipeableItemViewHolder (View itemView)

Public Methods

public int getAfterSwipeReaction ()

public float getMaxDownSwipeAmount ()

Gets the maximum item down swipe amount.

Returns
  • Item swipe amount. If the item is configured as proportional amount mode, generally the range is [-1.0 .. 1.0], otherwise the value is specified in pixels.

public float getMaxLeftSwipeAmount ()

Gets the maximum item left swipe amount.

Returns
  • Item swipe amount. If the item is configured as proportional amount mode, generally the range is [-1.0 .. 1.0], otherwise the value is specified in pixels.

public float getMaxRightSwipeAmount ()

Gets the maximum item right swipe amount.

Returns
  • Item swipe amount. If the item is configured as proportional amount mode, generally the range is [-1.0 .. 1.0], otherwise the value is specified in pixels.

public float getMaxUpSwipeAmount ()

Gets the maximum item up swipe amount.

Returns
  • Item swipe amount. If the item is configured as proportional amount mode, generally the range is [-1.0 .. 1.0], otherwise the value is specified in pixels.

public float getSwipeItemHorizontalSlideAmount ()

Gets the amount of horizontal swipe.

Returns

public float getSwipeItemVerticalSlideAmount ()

Gets the amount of vertical swipe.

Returns

public int getSwipeResult ()

Gets the result code of swiping item.

public int getSwipeStateFlags ()

Gets the state flags value for swiping item

Returns

public abstract View getSwipeableContainerView ()

Gets the container view for the swipeable area.

NOTE: Please DO NOT return itemView for this method. An IllegalArgumentException with massage "Tmp detached view should be removed from RecyclerView before it can be recycled" will be raised by RecyclerView.Recycler.

Returns
  • The container view instance.

public boolean isProportionalSwipeAmountModeEnabled ()

Gets whether the proportional swipe amount mode enabled.

Returns
  • True if swipe amount is specified in proportional value, otherwise false.

public void onSlideAmountUpdated (float horizontalAmount, float verticalAmount, boolean isSwiping)

Called when sets background of the swiping item.

Parameters
horizontalAmount Horizontal slide amount of the item view. (slide left: < 0, slide right: 0 >)
verticalAmount Vertical slide amount of the item view. (slide up: < 0, slide down: 0 >)
isSwiping Indicates whether the user is swiping the item or not

public void setAfterSwipeReaction (int reaction)

Sets the reaction type of after swiping item.

public void setMaxDownSwipeAmount (float amount)

Sets the maximum item down swipe amount.

Parameters
amount Item swipe amount. If the item is configured as proportional amount mode, specify limit amount in range of [-1.0 .. 1.0]. Otherwise, specify limit distance in pixels.

public void setMaxLeftSwipeAmount (float amount)

Sets the maximum item left swipe amount.

Parameters
amount Item swipe amount. If the item is configured as proportional amount mode, specify limit amount in range of [-1.0 .. 1.0]. Otherwise, specify limit distance in pixels.

public void setMaxRightSwipeAmount (float amount)

Sets the maximum item right swipe amount.

Parameters
amount Item swipe amount. If the item is configured as proportional amount mode, specify limit amount in range of [-1.0 .. 1.0]. Otherwise, specify limit distance in pixels.

public void setMaxUpSwipeAmount (float amount)

Sets the maximum item up swipe amount.

Parameters
amount Item swipe amount. If the item is configured as proportional amount mode, specify limit amount in range of [-1.0 .. 1.0]. Otherwise, specify limit distance in pixels.

public void setProportionalSwipeAmountModeEnabled (boolean enabled)

Sets proportional swipe amount mode enabled.

Parameters
enabled True if swipe amount is specified in proportional value, otherwise amount is specified in pixels.

public void setSwipeItemHorizontalSlideAmount (float amount)

Sets the amount of horizontal swipe.

Parameters
amount Item swipe amount. Generally the range is [-1.0 .. 1.0] if the proportional amount mode is enabled, otherwise distance in pixels. In additionally, these special values can also be accepted; - OUTSIDE_OF_THE_WINDOW_LEFT - OUTSIDE_OF_THE_WINDOW_RIGHT

public void setSwipeItemVerticalSlideAmount (float amount)

Sets the amount of vertical swipe.

Parameters
amount Item swipe amount. Generally the range is [-1.0 .. 1.0] if the proportional amount mode is enabled, otherwise distance in pixels. In additionally, these special values can also be accepted; - OUTSIDE_OF_THE_WINDOW_TOP - OUTSIDE_OF_THE_WINDOW_BOTTOM

public void setSwipeResult (int result)

Sets the result code of swiping item.

Parameters
result Result code. One of these values; - RESULT_NONE - RESULT_SWIPED_LEFT - RESULT_SWIPED_UP - RESULT_SWIPED_RIGHT - RESULT_SWIPED_DOWN - RESULT_CANCELED

public void setSwipeStateFlags (int flags)

Sets the state flags value for swiping item

Parameters
flags Bitwise OR of these flags; - STATE_FLAG_SWIPING - STATE_FLAG_IS_ACTIVE - STATE_FLAG_IS_UPDATED