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

Hi, can childView support click event ? #5

Open
pinguo-zhouwei opened this issue Apr 29, 2019 · 7 comments
Open

Hi, can childView support click event ? #5

pinguo-zhouwei opened this issue Apr 29, 2019 · 7 comments

Comments

@pinguo-zhouwei
Copy link

No description provided.

@pinguo-zhouwei
Copy link
Author

childView's click event is changed when i scaled ViewGroup by Override dispatchDraw

@guvencan
Copy link

@pinguo-zhouwei
Copy link
Author

it doesn't work for me ,in my case ,childView’s click event area is not change after scaled ,
For example, after the ViewGroup is zoomed in, the click event area of ​​the child View is still the area before the zoom, resulting in the click being unavailable.

@pinguo-zhouwei
Copy link
Author

@guvencan
The ViewGroup is scaled by dispatchDraw, which is equivalent to the actual position of the child View. The position of the click event after zooming in or out is incorrect. Is there any other solution? Thank you

@guvencan
Copy link

Because view translating in dispatchDraw function for save position on the screen but view position will be changed. For example your view position is (100, 100) in 1x scale, after scaled 2x position is (50,50) but object stay same place on the screen. You can use TapInfo class for the follow position.

@androidDev8
Copy link

Main issue it this, every ZoomLayout's 'onTouchEvent' handled. It should handle child view 'onTouchEvent' at first.
For example,
We have 3 CustomViews with touch to draw.
When we touch on screen, it should first handle top most view's 'onTouchEvent', if it fails (like view is disabled, or not active), then 2nd from top, and so on. If no view handles 'onTouchEvent' then it must be handles by 'ZoomLayout'.

@Jaydipnathani
Copy link

Jaydipnathani commented Aug 24, 2021

You need to remove this function for clickable to childview

https://github.com/shopgun/zoomlayout/blob/70e27a82750568f550f5f54567528cede59b0d28/library/src/main/java/com/shopgun/android/zoomlayout/ZoomLayout.java#L203

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

No branches or pull requests

4 participants