Interface ChannelListView.SwipeListener

    • Constructor Detail

    • Method Detail

      • onSwipeStarted

         abstract Unit onSwipeStarted(SwipeViewHolder viewHolder, Integer adapterPosition, Float x, Float y)

        Invoked when a swipe is detected.

        Parameters:
        viewHolder - The view holder that is being swiped.
        adapterPosition - The internal adapter position of the item being bound.
        x - The raw X of the swipe origin; null may indicate the call isn't from user interaction.
        y - The raw Y of the swipe origin; null may indicate the call isn't from user interaction.
      • onSwipeChanged

         abstract Unit onSwipeChanged(SwipeViewHolder viewHolder, Integer adapterPosition, Float dX, Float totalDeltaX)

        Invoked after a swipe has been detected, and movement is occurring.

        Parameters:
        viewHolder - The view holder that is being swiped.
        adapterPosition - The internal adapter position of the item being bound.
        dX - The change from the previous swipe touch event to the current.
        totalDeltaX - The change from the first touch event to the current.
      • onSwipeCompleted

         abstract Unit onSwipeCompleted(SwipeViewHolder viewHolder, Integer adapterPosition, Float x, Float y)

        Invoked when a swipe is successfully completed naturally, without cancellation.

        Parameters:
        viewHolder - The view holder that is being swiped.
        adapterPosition - The internal adapter position of the item being bound.
        x - The raw X of the swipe origin; null may indicate the call isn't from user interaction.
        y - The raw Y of the swipe origin; null may indicate the call isn't from user interaction.
      • onSwipeCanceled

         abstract Unit onSwipeCanceled(SwipeViewHolder viewHolder, Integer adapterPosition, Float x, Float y)

        Invoked when a swipe is canceled.

        Parameters:
        viewHolder - The view holder that is being swiped.
        adapterPosition - The internal adapter position of the item being bound.
        x - The raw X of the swipe origin; null may indicate the call isn't from user interaction.
        y - The raw Y of the swipe origin; null may indicate the call isn't from user interaction.
      • onRestoreSwipePosition

         abstract Unit onRestoreSwipePosition(SwipeViewHolder viewHolder, Integer adapterPosition)

        Invoked in order to set the viewHolder's initial state when bound. This supports view holder reuse. When items are scrolled off-screen and the view holder is reused, it becomes important to track the swiped state and determine if the view holder should appear as swiped for the item being bound.

        Parameters:
        viewHolder - The view holder being bound.
        adapterPosition - The internal adapter position of the item being bound.