Practical No 25
Q1.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="@+id/editTextTextPersonName"
android:layout_width="162dp"
android:layout_height="48dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Atharva Butte"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<LinearLayout
android:layout_width="319dp"
android:layout_height="549dp"
android:layout_marginTop="112dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.63"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/img"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/img" />
<Button
android:onClick="b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:text="Clockwise / Anti Clockwise" />
<Button
android:onClick="b2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:text="Zoom In / Out" />
<Button
android:onClick="b3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:text="Fade In / Out" />
</LinearLayout>
</[Link]>
[Link]
package [Link].practical25;
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];
public class MainActivity extends AppCompatActivity {
ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
img = findViewById([Link]);
public void b1(View v) {
Animation rot = [Link](this, [Link]);
Animation ant_rot = [Link](this, [Link].anit_rotate);
[Link](new [Link]() {
@Override
public void onAnimationStart(Animation animation) { }
@Override
public void onAnimationEnd(Animation animation) {
[Link](ant_rot);
}
@Override
public void onAnimationRepeat(Animation animation) { }
});
[Link](rot);
}
public void b2(View v) {
Animation zom_in = [Link](this, [Link].zoom_in);
Animation zom_out = [Link](this, [Link].zoom_out);
zom_in.setAnimationListener(new [Link]() {
@Override
public void onAnimationStart(Animation animation) { }
@Override
public void onAnimationEnd(Animation animation) {
[Link](zom_out);
}
@Override
public void onAnimationRepeat(Animation animation) { }
});
[Link](zom_in);
}
public void b3(View v) {
Animation fad_in = [Link](this, [Link].fade_in);
Animation fad_out = [Link](this, [Link].fade_out);
fad_in.setAnimationListener(new [Link]() {
@Override
public void onAnimationStart(Animation animation) { }
@Override
public void onAnimationEnd(Animation animation) {
[Link](fad_out);
}
@Override
public void onAnimationRepeat(Animation animation) { }
});
[Link](fad_in);
}
}