HorizontalScrollView inside Movable View

86 views Asked by At

I have a movableView(moves with finger touch movement) of 400*400, it has a horizontal view at bottom (400*100). When I want to scroll horintalScrollView to see the list, my movableView is moving, but horintalSrollView is not taking any touchEvent.

I want it like, when I am touching horizontalScrollView, only it should scroll. And when not touching it and want to move my movableView it should move.

Any suggestions would be helpful. Thanks

1

There are 1 answers

1
Sritam Jagadev On BEST ANSWER

Try this logic...

scrollView.setOnTouchListener(new OnTouchListener() {
// Setting on Touch Listener for handling the touch inside movableView
@Override
public boolean onTouch(View v, MotionEvent event) {
// Disallow the touch request for parent move on touch of child view
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});