You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a custom View with a Canvas that is made zoomable with help of this library and this works fine on Android 7 and higher.
Here are 2 reference images with the ZoomLayout unzoomed and not panned.
The Version running on Android API 27 is behaving as expected and draws the Canvas in the size of the screen. The view is zoomable and the coordinate transformation works so that the clicks on different Hexagons get detected.
This is the same View on Android API 23 or lower (shown is API Level 18) where the whole canvas seemed to have moved towards the top. When panning down there is a white part of the ZoomLayout area that should not be there and indicates that the canvas got moved towards the top becomes visible. Clicks on the canvas are also not getting the right x and y values and therefore don't hit any of my defined regions which makes the View useless with zoom.
This does not happen when I just put the View inside a LinearLayout or something similar.
You don't need to set width and height to the screen dimensions. ZoomLayout will scale it down.
Just use random big values in XML like layout_width=1000dp and layout_height=1000dp. And move the prepare logic after super.onMeasure, using getMeasuredWidth() and getMeasuredHeight() as inputs.
I don't know why you are having this issue, but this might fix.
I am using a custom View with a Canvas that is made zoomable with help of this library and this works fine on Android 7 and higher.
Here are 2 reference images with the ZoomLayout unzoomed and not panned.
The Version running on Android API 27 is behaving as expected and draws the Canvas in the size of the screen. The view is zoomable and the coordinate transformation works so that the clicks on different Hexagons get detected.
This is the same View on Android API 23 or lower (shown is API Level 18) where the whole canvas seemed to have moved towards the top. When panning down there is a white part of the ZoomLayout area that should not be there and indicates that the canvas got moved towards the top becomes visible. Clicks on the canvas are also not getting the right x and y values and therefore don't hit any of my defined regions which makes the View useless with zoom.
This does not happen when I just put the View inside a LinearLayout or something similar.
Here is the XML Code for the view:
The inner content of my ZoomLayout then gets set programmatically:
Where the HexView itself contains this code:
I'd really like to make this available for all Android version.
Help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: