RevealActivitypublic 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 |
Methods Summary |
---|
public void | onClick(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 void | onCreate(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);
|
|