FileDocCategorySizeDatePackage
RevealActivity.javaAPI DocAndroid 5.1 API4045Thu Mar 12 22:22:44 GMT 2015com.android.test.hwui

RevealActivity

public class RevealActivity extends android.app.Activity implements android.view.View.OnClickListener

Fields Summary
private static final int
DURATION
private boolean
mShouldBlock
private int
mIteration
private android.animation.Animator.AnimatorListener
mListener
private static final Runnable
sBlockThread
Constructors Summary
Methods Summary
public voidonClick(android.view.View view)

        Animator animator = ViewAnimationUtils.createCircularReveal(view,
                view.getWidth() / 2, view.getHeight() / 2,
                0, Math.max(view.getWidth(), view.getHeight()));
        Log.d("Reveal", "Calling start...");
        animator.addListener(mListener);
        if (mIteration < 2) {
            animator.setDuration(DURATION);
            animator.start();
        } else {
            AnimatorSet set = new AnimatorSet();
            set.playTogether(animator);
            set.setDuration(DURATION);
            set.addListener(mListener);
            set.start();
        }

        mIteration = (mIteration + 1) % 4;
        mShouldBlock = !mShouldBlock;
        if (mShouldBlock) {
            view.post(sBlockThread);
        }
    
protected voidonCreate(android.os.Bundle savedInstanceState)


    
        
        super.onCreate(savedInstanceState);

        final LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);

        ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge);
        layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
        View revealView = new MyView(this);
        layout.addView(revealView,
                new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
        setContentView(layout);

        revealView.setOnClickListener(this);