Android Question How implement a ScrollView that has Panels that can be swiped horizontally?

Inman

Well-Known Member
Licensed User
Longtime User
I am trying to implement a Google Now like card view where the user can remove a card by swiping it left or right. A scrollview holds my cards. How can I swipe it left or right? The scrollview should not scroll at that time.

There is a requestDisallowInterceptTouchEvent method that can prevent touches from registering on a view. But somehow it doesn't work on ScrollView. If it had worked, I could have at least stopped the scrollview from scrolling and then worry about the left/right swipe.
 

Inman

Well-Known Member
Licensed User
Longtime User
Just a thought: use a HorizontalScrollView for each card?

Hmm. Not a bad idea. I hope the vertical and horizontal scrolls don't conflict with each other.

If you have ULV, then you might as well implement the cards in there.
If not, consider using the GestureDetector library.

I do have ULV but there are going to be only 3 cards at a time, that too each one with a different layout. So implementing ULV will be a bit of overkill.
 
Upvote 0
Top