A quick way to ZOOM and Slide Image anywhere (possible with all kinds of layout)
Believe me, I know the pain to set up zoom in-out and moveable sliding view to images or for that matter to any of the layout views.
Here’s a quick demo that works with any layout that you pass such as ImageView, TextView, Button, all kinds of layouts, and views.
Setup XML (layout and views)
For demo purposes, I’m going to setup ImageView in layout. As per your need, set up your layout or view.
Setup class for layout zoom logic (Here the magic happens)
In class ZoomLayout, I have set up the onTouchListener on the view that you are going to pass through MainActivity.java
Don’t forget to play with it and do some customization if you need it.
Setup MainActivity
Call & just pass the view to setupZoom() Method by creating the object of ZoomLayout Class.
That’s all you need to do. Easy peasy right? I hope you find something useful.
I’m an Android Developer & Designer. Checkout My Apps on Google Play & GitHub
If you like this article then please clap for me…👏👏👏