Methods Summary |
---|
private void | initViews()
mNextButton = findViewById(R.id.next_button);
mNextButton.setOnClickListener(this);
mSkipButton = findViewById(R.id.skip_button);
mSkipButton.setOnClickListener(this);
mImageView = (ImageView) findViewById(R.id.lock_anim);
mImageView.setBackgroundResource(R.drawable.lock_anim);
mImageView.setOnClickListener(this);
mAnimation = (AnimationDrawable) mImageView.getBackground();
|
protected void | onActivityResult(int requestCode, int resultCode, android.content.Intent data)
if (requestCode == REQUESTCODE_CHOOSE && resultCode == ChooseLockPattern.RESULT_FINISHED) {
setResult(resultCode);
finish();
}
|
public void | onClick(android.view.View v)
if (v == mSkipButton) {
// Canceling, so finish all
setResult(ChooseLockPattern.RESULT_FINISHED);
finish();
} else if (v == mNextButton) {
stopAnimation(mAnimation);
Intent intent = new Intent(this, ChooseLockPattern.class);
startActivityForResult(intent, REQUESTCODE_CHOOSE);
}
|
protected void | onCreate(android.os.Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_lock_pattern_example);
initViews();
|
protected void | onPause()
super.onPause();
stopAnimation(mAnimation);
|
protected void | onResume()
super.onResume();
mHandler.postDelayed(mRunnable, START_DELAY);
|
protected void | startAnimation(android.graphics.drawable.AnimationDrawable animation)
if (animation != null && !animation.isRunning()) {
animation.run();
}
|
protected void | stopAnimation(android.graphics.drawable.AnimationDrawable animation)
if (animation != null && animation.isRunning()) animation.stop();
|