I have two scrollviews side by side, I want the user to be able to drag list items back and forth from left to right scrollviews. However, I can’t find a way to handle the touch events. I can’t set a touch listener for each scrollview seperately as the drag gesture gets dropped when passing from one to another. I tried creating an absolute layout over the top of both, which works from the drag and drop perspective, but it stops me from being able to scroll the scrollviews. Is there a simple solution to this? can anyone help me out?
Share
Generally,
onTouchListenerreturns abooleanthat indicates whether the touch has been handled. It’s up to you to decide whether the touch was handled or not. When the user touches aView, Android will call it’s touch listener. If the touch listener returnstrue, then it regards the touch as handled then moves on. If the touch listener returnsfalse, then it will go up one to the parent view (in this case whatever yourScrollViewis). Then the parent view’s touch listener is called and must decide how to handle the touch. It will keep cascading up the parent views until atrueis returned or until it reaches the end.In your case, you may have to decide what the user has to do in order to drag & drop vs. scrolling. Perhaps the user must do a long press on an item before he/she can drag it or something.