Mad MP
Mad MP
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.
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.
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.
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="236dp"
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>
Rotateanticlockwise.xml-
<?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"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000"/>
</set>
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">
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="5000"/>
</set>
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;
Manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.micro_19">
<uses-permission android:name="android.permission.ZOOM_In"/>
<uses-permission android:name="android.permission.ZOOM_OUT"/>
<uses-permission android:name="android.permission.ROTATE_ANTICLOCKWISE"/>
<uses-permission android:name="android.permission.ROTATE_CLOCKWISE"/>
<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" />
</manifest>
9.0Skill Developed / Learning outcome of this Micro-Project:
1.Learn to create an application using classes and methods.
2.Understand the concepts of service.