I want to allow user to Zoom In/Out Image
in full Screen Mode
. For that, I am opening new Activity for ImageView
by passing Image Value. So there, User can see Image.
Now, I want to allow user to Zoom Image using Two Finder Trip.
How to do this ?
I don't want Rotation image by Finger Touch, I want only Zoom In/Out.
I want it supportable from api 8.
Asked
Active
Viewed 870 times
0

Jeeten Parmar
- 5,568
- 15
- 62
- 111
1 Answers
0
For Zoom In and Zoom Out you have to add two xml file in your res/anim folder.
here is zoomin.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="3"
android:toYScale="3" >
</scale>
here is zoomout.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0.5"
android:toYScale="0.5" >
</scale>
Now you have to set in animation and out animation from java file
setInAnimation(AnimationUtils.loadAnimation(getActivity()
.getApplicationContext(), R.anim.right_in));
.setOutAnimation(AnimationUtils.loadAnimation(getActivity()
.getApplicationContext(), R.anim.left_out));

Devganiya Hitesh
- 1,207
- 2
- 17
- 31
-
where to give path of image ? – Jeeten Parmar May 17 '14 at 09:42
-
Use ViewFlipper and add Imageview in viewflipper. You can setInAnimation and setOutAnimation in ViewFlipper – Devganiya Hitesh May 17 '14 at 09:46
-
I dont have any idea. Give me example. – Jeeten Parmar May 17 '14 at 09:50
-
– Devganiya Hitesh May 17 '14 at 09:52
-
add Imageview in ViewFlipper – Devganiya Hitesh May 17 '14 at 09:52
-
I have tried it but It is not doing any zoom by finger touch. – Jeeten Parmar May 17 '14 at 10:11
-
Than there may be problem with your on touch event because above code work complete for me. – Devganiya Hitesh May 17 '14 at 10:19