0

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.

Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111

1 Answers1

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