skip to Main Content

I have a list of items in list view, I want to display the item that user swipes left on, in a new fragment or activity as a textview. I want the entire list to animate and move a bit to left as if it has been pulled to left with the finger. I want to execute the same using custom views.

image reference

2

Answers


  1. You can either add Swipeable behavior to your RecyclerView like this :

    Add Swipeable Behavior

    or use an external library to do that for you :

    Use External Lib

    Login or Signup to reply.
  2. I think the following post gives the most detailed equation for this behaviour. It relates the finger position to the bubble position and can be customised easily.

    xb = min( xf, f * sqrt(W) * sqrt(xf) )
    
    xb = x-displacement of bubble from its initial position
    xf = x-displacement of finger from its initial position
    W  = screen width or maximum finger displacement possible
    f  = maximum bubble displacement fraction or xb(max)/xf(max)
    

    Here is the complete post
    https://medium.com/@duolop/swipe-to-reply-animation-a-physics-based-approach-5ef646c396e4

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search