package com.android_examples.androidanimations_android_examplescom;
import android.support.v7.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.TextView;

public class BlinkingActivity extends AppCompatActivity {

    Button button ;
    TextView textView ;
    Animation animation ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_blinking);

        button = (Button)findViewById(R.id.buttonblinkingActivity);
        textView = (TextView)findViewById(R.id.textViewblinking);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {


                animation = AnimationUtils.loadAnimation(BlinkingActivity.this,
                        R.anim.animation_blinking);

                textView.startAnimation(animation);

            }
        });
    }
}
