Example usage for android.widget TextView clearAnimation

List of usage examples for android.widget TextView clearAnimation

Introduction

In this page you can find the example usage for android.widget TextView clearAnimation.

Prototype

public void clearAnimation() 

Source Link

Document

Cancels any animations for this view.

Usage

From source file:org.secuso.privacyfriendlydicegame.MainActivity.java

public void hints(int position) {

    TextView hint = (TextView) findViewById(R.id.initialTextView);
    TextView initialText = (TextView) findViewById(R.id.initialTextTextView);
    TextView hint2 = (TextView) findViewById(R.id.initialTextView2);
    ImageView background = (ImageView) findViewById(R.id.backgroundImageView);

    Animation anim = new AlphaAnimation(0.0f, 1.0f);

    if (position == 0) {
        hint.setVisibility(View.VISIBLE);
        hint2.setVisibility(View.VISIBLE);
        background.setVisibility(View.VISIBLE);
        initialText.setVisibility(View.VISIBLE);

        anim.setDuration(1000);/*from   www.  j av a2  s  .com*/
        anim.setStartOffset(20);
        anim.setRepeatMode(Animation.REVERSE);
        anim.setRepeatCount(Animation.INFINITE);
        hint.startAnimation(anim);
        hint2.startAnimation(anim);

    } else {
        hint.clearAnimation();
        hint2.clearAnimation();
        hint.setVisibility(View.INVISIBLE);
        hint2.setVisibility(View.INVISIBLE);
        background.setVisibility(View.INVISIBLE);
        initialText.setVisibility(View.INVISIBLE);
    }

}