Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card with scrollview #136

Closed
franrc opened this issue Feb 18, 2016 · 5 comments
Closed

Card with scrollview #136

franrc opened this issue Feb 18, 2016 · 5 comments

Comments

@franrc
Copy link

franrc commented Feb 18, 2016

Hi!

I must use an scrollview into the card to show all the information, but the drag action is not possible.

Do you know how can I achieve this?

Thanks!

@alexwalterbos
Copy link

This happens because the card view consumes all the touch events, which thus never reach the scroll view. To be honest, it sounds like a pretty bad UX to have a scrollview in your cards exactly because of the conflict; when will the user mean to scroll, and when to fling the card?

If you still want to do this, you'll have to dive into the OnTouchListeners by forking this library, and attaching a custom one that decides whether to fling the card or whether to delegate it to the scroll view that's nested in the card.

@franrc
Copy link
Author

franrc commented Feb 19, 2016

I agree with you, but the client wants to show the entire text in the card.

Thanks for your answer!

@martinothamar
Copy link

I currently have a use-case for this. Inside the card there is a vertical ListView. I want the card to capture horizontal scrolling but the ListView keeps grabbing it. I have been trying to detect horizontal swiping on the card layout and then returning false on the intercept touch method, but its clearly not the right way. How would I go about this?

@alexwalterbos
Copy link

alexwalterbos commented May 10, 2016

I can't really help you here:

  1. because I think you can never implement this in a way that works for everyone, e.g. everyone swipes differently and a horizontal swipe often has a vertical offset too; you can't possibly handle all cases.
  2. because I'm convinced these gestures (scrolling vs swiping the same view) is just not going to give you a UX that's clear and understandable for all your users.

If you're really keen on doing this, the answer lies in that OnTouchListener and handling the event or passing it along based on thresholds (how far has the user swiped, ratio of vertical to horizontal movement, speed of the swipe/scroll). I can't help you with the exact parameters.

@mwshubham
Copy link

Does the feature still in wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants