blazsolar / HorizontalPicker

Android widget allowing user to select one item from set of them by swiping left and right.
http://blaz.solar/HorizontalPicker
Apache License 2.0
227 stars 81 forks source link

Continue scroll/slide even with finger exits view bounds #41

Closed ArcherN9 closed 8 years ago

ArcherN9 commented 8 years ago

This is something similar to how a browser's bottom / up scroll works while using a mouse. Hovering over the actual scrollbar to slide up & down is not required. The scroll bar can be caught and dragged up & down even with the mouse diagonally. The control stays with the mouse until the button is released. Similarly, while the MotionEvent.ACTION_MOVE event is fired, & the user leaves the bounds of the view, the view should keep scrolling until MotionEvent.ACTION_UP is registered.

I hope I was clear enough in the explanation. I'll post a small GIF if you want me to elucidate further.

blazsolar commented 8 years ago

This should actually work. Are you using it inside ScrollView or something similar?

ArcherN9 commented 8 years ago

Okay, I tried it on a dummy project I made to test the library. The desired behavior is present when the control is not used inside a ScrollView. Meh.

blazsolar commented 8 years ago

Can you try 1.1.1-SNAPSHOT version. This should be already fixed there.

ArcherN9 commented 8 years ago

Okay, so I fiddled around with the library. Was a very minor thing to fix. Got the following on MotionEvent.ACTION_DOWN

getParent().requestDisallowInterceptTouchEvent(true);
blazsolar commented 8 years ago

It should actually be at the same part as mScrollingX = true. It is included in 1.1.1-SNAPSHOT like i sad. I also pushed release build that should be published in couple of hours.

ArcherN9 commented 8 years ago

Cool. I'll make do with the fix I've made for now. Will take the update sometime later. Thanks!!!