0

I am trying to make something like in the image. I want to reuse the layout I created for TAB1. (The info on each swipe will be fetched from a server).

I am unable to find any correct way of doing this.

What kind of view/adapter/swipeListener should I use?

Edit: I am not talking about creating TabLayouts. I want to know about the layout recycling only.

enter image description here

Nimantha
  • 6,405
  • 6
  • 28
  • 69

1 Answers1

1

https://developer.android.com/training/gestures/detector

You'll want to make a gesture detector, get the start and end X,Y coordinates to determine if the swipe went down and then just change the image and text in the respective fields.

Dan Hartman
  • 194
  • 4
  • It will. You can intercept touch events at various levels, and you then can set a threshhold of a distance the user has to have swiped, at a certain speed to determine it was a "swipe down". – Dan Hartman Jul 19 '18 at 21:36