Reputation: 970
I have a CustomeLinearlayout that allows to swipe from bottom to top or top to bottom to hide itself. In this layout, I have a custome image view that is zoomable, the problem is when I swipe top-down, bottom-up on the imageview, the layout get the touch event. I know why this happens but can not find a way to prevent it.
The code in the onInterceptTouchEvent() method of the custom linearlayout
....
case MotionEvent.ACTION_MOVE:
// check if user swipe top-bottom or bottom-top
// return true if it is, break otherwise
// The current implementation always return true if it detects user is swiping from top to bottom or bottom to top (doesnt care how its children feel)
....
My question is how to detect if user want to scroll the zoomed image rather than swipe the Linearlayout?. The Layout only handle its onTouch only if the zoom image is not zoomed (scale ratio is 1f)
Upvotes: 0
Views: 324
Reputation: 973
If your image is zoomed then you can call requestDisallowInterceptTouchEvent(true)
method
Upvotes: 1