Reputation: 596
I am new to Android.
I have a problem with setting image from gallery or camera to ImageView. I want to do a implement a Zoom functionality in ImageView.
I used this for zoom in/out or pinch. It works good, but image do not fit to ImageView's space by default.
When I use ScaleType="CenterCrop"
it works, but Zoom functionality stops.
I want to :
1) Fit the picked image from gallery or Camera to ImageView by default.
2) Pinch gesture to zoom in/out.
3) Set minimum zoom to ImageView's height
How can I do this?
Upvotes: 0
Views: 351
Reputation: 2641
Achieve 1 using this library (https://github.com/jkwiecien/EasyImage)
Achieve 2 and 3 using PhotoView (https://github.com/chrisbanes/PhotoView).
It's an implementation of ImageView for Android that supports zooming, by various touch gestures.( 3 can be achieved by using setMinimumScale(float minimumScale)
).
Hope this helps.
Upvotes: 1