content: package com.example.frameanimation;
  
  import androidx.appcompat.app.AppCompatActivity;
  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;
  
  public class MainActivity extends AppCompatActivity {
  
      ImageView imageView;
      Button blinkBTN, rotateBTN, fadeBTN, moveBTN, slideBTN, zoomBTN, stopBTN;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          imageView = findViewById(R.id.imageview);
          blinkBTN = findViewById(R.id.BTNblink);
          rotateBTN = findViewById(R.id.BTNrotate);
          fadeBTN = findViewById(R.id.BTNfade);
          moveBTN = findViewById(R.id.BTNmove);
          slideBTN = findViewById(R.id.BTNslide);
          zoomBTN = findViewById(R.id.BTNzoom);
          stopBTN = findViewById(R.id.BTNstop);
  
          blinkBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add blink animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blinkanimation);
                  imageView.startAnimation(animation);
              }
          });
  
          rotateBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add rotate animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotateanimation);
                  imageView.startAnimation(animation);
              }
          });
          fadeBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add fade animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fadeanimation);
                  imageView.startAnimation(animation);
              }
          });
          moveBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add move animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.moveanimation);
                  imageView.startAnimation(animation);
              }
          });
          slideBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add slide animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slideanimation);
                  imageView.startAnimation(animation);
              }
          });
          zoomBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To add zoom animation
                  Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.zoomanimation);
                  imageView.startAnimation(animation);
              }
          });
          stopBTN.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // To stop the animation going on imageview
                  imageView.clearAnimation();
              }
          });
      }
  }