Professional Documents
Culture Documents
1.0Rationale:
This is a simple application on animation to zoom the image in and out and also rotate the
image clockwise and anticlockwise in the mobile.
This report consists of a codes and applications interface.
P
i. User can easily zoom the image in and out also rotate the image clockwise and
anticlockwise in the mobile.
AP
ii. It reduces the efforts.
4.0Literature Review:
The Prepared Micro-Project is concerned with the installation and Configuration of Android
Studio IDE and java jdk for developing an Animation application.
SB
In this App we are going use of multiple Android UI components to design and step by step
Developing a Basic Animation application in Android Studio.
M
P
AP
n
tio
lu
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
TE
android:orientation="vertical"
tools:context=".MainActivity" >
<ImageView
SB
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="236dp"
M
app:srcCompat="@mipmap/ic_launcher" />
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="match_parent"
android:layout_height="71dp"
android:text="Zoom anticlockwise" />
<ToggleButton
android:id="@+id/toggleButton2"
android:layout_width="match_parent"
android:layout_height="64dp"
android:text="zoom in" />
</LinearLayout>
Zoomin.xml-
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="2"
android:fromYScale="2"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="4"
android:toYScale="4"/>
</set>
Zoomout.xml-
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:duration="2500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale=".2"
android:toYScale=".2"/>
</set>
P
Rotateanticlockwise.xml-
AP
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="@android:anim/cycle_interpolator">
<rotate android:fromDegrees="360"
android:toDegrees="0" n
android:pivotX="50%"
tio
android:pivotY="50%"
android:duration="5000"/>
lu
</set>
So
Rotateclockwise.xml-
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/cycle_interpolator">
TE
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
SB
android:pivotY="50%"
android:duration="5000"/>
</set>
M
MainActivity.java-
package com.example.micro_19;
import androidx.appcompat.app.AppCompatActivity;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
P
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.zoomout);
img.startAnimation(animZoomOut);
AP
}
});
tglbtn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v) { n
Animation animRotateAnticlockwise =
tio
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotateanticlockwise);
img.startAnimation(animRotateAnticlockwise);
}
lu
});
tglbtn.setOnClickListener(new View.OnClickListener()
So
{
public void onClick(View v) {
Animation animRotateClockwise =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotateclockwise);
TE
img.startAnimation(animRotateClockwise);
}
});
}
SB
Manifest code:
M
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</activity>
</application>
</manifest>
P
AP
n
tio
lu
So
TE
SB
M
P
AP
n
tio
lu
So
TE
SB
M