Package 

Interface EpoxySwipeCallback

    • Method Summary

      Modifier and Type Method Description
      abstract void onSwipeStarted(T model, View itemView, int adapterPosition) Called when the view switches from an idle state to a swiped state, as the user begins a swipeinteraction with it.
      abstract void onSwipeProgressChanged(T model, View itemView, float swipeProgress, Canvas canvas) Once a view has begun swiping with onSwipeStarted it willreceive this callback as the swipe distance changes.
      abstract void onSwipeReleased(T model, View itemView) Called when the user has released their touch on the view.
      abstract void onSwipeCompleted(T model, View itemView, int position, int direction) Called after onSwipeReleased if the swipe surpassed the threshold tobe considered a full swipe.
      • Methods inherited from class com.airbnb.epoxy.BaseEpoxyTouchCallback

        clearView, getMovementFlagsForModel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onSwipeStarted

         abstract void onSwipeStarted(T model, View itemView, int adapterPosition)

        Called when the view switches from an idle state to a swiped state, as the user begins a swipeinteraction with it. You can use this callback to modify the view to indicate it is beingswiped.

        This is the first callback made in the lifecycle of a swipe event.

        Parameters:
        model - The model representing the view that is being swiped
        itemView - The view that is being swiped
        adapterPosition - The adapter position of the model
      • onSwipeProgressChanged

         abstract void onSwipeProgressChanged(T model, View itemView, float swipeProgress, Canvas canvas)

        Once a view has begun swiping with onSwipeStarted it willreceive this callback as the swipe distance changes. This can be called multiple times as theswipe interaction progresses.

        Parameters:
        model - The model representing the view that is being swiped
        itemView - The view that is being swiped
        swipeProgress - A float from -1 to 1 representing the percentage that the view has beenswiped relative to its width.
        canvas - The canvas on which RecyclerView is drawing its children.
      • onSwipeReleased

         abstract void onSwipeReleased(T model, View itemView)

        Called when the user has released their touch on the view. If the displacement passed the swipethreshold then onSwipeCompleted will be called after thisand the view will be animated off screen. Otherwise the view will animate back to its originalposition.

        Parameters:
        model - The model representing the view that was being swiped
        itemView - The view that was being swiped
      • onSwipeCompleted

         abstract void onSwipeCompleted(T model, View itemView, int position, int direction)

        Called after onSwipeReleased if the swipe surpassed the threshold tobe considered a full swipe. The view will now be animated off screen.

        You MUST use this callback to remove this item from your backing data and request a modelupdate.

        clearView will be called after this.

        Parameters:
        model - The model representing the view that was being swiped
        itemView - The view that was being swiped
        position - The adapter position of the model
        direction - The direction that the view was swiped.