TrinityTuts Tips

Zoom effect on ImageView Android

Last updated on January 21st, 2019 at 10:53 am

In this tip i will explain how to implement zoom effect on ImageView Android. To get this thing done we can use this library you can find on GitHub this library is very simple and useful. You can use this library on both activity or fragment.

Implementation of Zoom effect on ImageView

Step 1. Add dependencies on your app build.gradle

implementation 'com.github.chrisbanes:PhotoView:2.0.0'

Step 2. Now we can Dynamically add image in our activity class

import uk.co.senab.photoview.<wbr>PhotoView;

LinearLayout layout = (LinearLayout) findViewById(R.id.view);
PhotoView photoView = new PhotoView(getApplicationContext());
Picasso.with(getApplication()).load("<URL>").into(photoView);
layout.addView(photoView);

This is just for help for beginners to implement zoom on ImageView you can follow this link to get complete info.

Done 🙂