Giter VIP home page Giter VIP logo

Comments (7)

Jaydipnathani avatar Jaydipnathani commented on July 4, 2024 2

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

from zoomlayout.

pinguo-zhouwei avatar pinguo-zhouwei commented on July 4, 2024

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

from zoomlayout.

guvencan avatar guvencan commented on July 4, 2024

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#L161

from zoomlayout.

pinguo-zhouwei avatar pinguo-zhouwei commented on July 4, 2024

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.

from zoomlayout.

pinguo-zhouwei avatar pinguo-zhouwei commented on July 4, 2024

@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

from zoomlayout.

guvencan avatar guvencan commented on July 4, 2024

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.

from zoomlayout.

androidDev8 avatar androidDev8 commented on July 4, 2024

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'.

from zoomlayout.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.