natario1 / ZoomLayout

2D zoom and pan behavior for View hierarchies, images, video streams, and much more, written in Kotlin for Android.
https://natario1.github.io/ZoomLayout
Apache License 2.0
1.03k stars 148 forks source link

Change child container size while do zooming #197

Closed Yahor10 closed 3 years ago

Yahor10 commented 3 years ago

How do I?

I want to change size of the child view when zoom in event applied. How it can be done properly?

void onChangedSize(){ // function must be called
}

Version used

Latest

markusressel commented 3 years ago

You can add a ZoomEngine.Listener to the ZoomEngine to get updates when the internal matrix is updated (due to pan or zoom) and then maybe use setContentSize on the engine to change the dimensions? Not sure what your goal with this is though. Also note that this might cause an infinite loop.

Yahor10 commented 3 years ago

I did it , its goes to infinite. Could you show working example?

markusressel commented 3 years ago

What is your goal with this? Why do you need this? Are you sure you need to do this?

I cannot think of a use case that requires what you are describing.

I think it is more helpful if you could provide an example of what you are trying to achieve first :smile:

Yahor10 commented 3 years ago

Goal is to change surfaceview inside zoomlayout. I am using textures mipmapping or just HD images and i want to change glViewPort with zoom for showing images with better quality.

markusressel commented 3 years ago

Are you using ZoomSurfaceView?

Yahor10 commented 3 years ago

I am using ZoomContainer (ZoomLayout)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in the last 20 days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.