summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2015-01-27 15:23:16 -0800
committercretin45 <cretin45@gmail.com>2015-01-27 15:23:16 -0800
commit031e58ebc41f1ccb76353581d58c1a6f059fc9b4 (patch)
tree9916f72d2921df2371df8ccd9fd14aa123c1ab12 /src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
parentc5e5df96b18620f3e7d18d7536f4b67709f4d111 (diff)
downloadpackages_apps_SetupWizard-031e58ebc41f1ccb76353581d58c1a6f059fc9b4.zip
packages_apps_SetupWizard-031e58ebc41f1ccb76353581d58c1a6f059fc9b4.tar.gz
packages_apps_SetupWizard-031e58ebc41f1ccb76353581d58c1a6f059fc9b4.tar.bz2
SetupWizard: Move reveal finish animation up to activity
Change-Id: I983cfcfad3fcd9808442917bb8b4ae7f8a8d7c2b
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java')
-rw-r--r--src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
index d696854..c93c76e 100644
--- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
+++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
@@ -16,16 +16,19 @@
package com.cyanogenmod.setupwizard.ui;
+import android.animation.Animator;
import android.app.Activity;
import android.app.AppGlobals;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
+import android.os.Handler;
import android.provider.Settings;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
+import android.view.ViewAnimationUtils;
import android.widget.Button;
import com.cyanogenmod.setupwizard.R;
@@ -48,9 +51,12 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
private View mRootView;
private Button mNextButton;
private Button mPrevButton;
+ private View mReveal;
private AbstractSetupData mSetupData;
+ private final Handler mHandler = new Handler();
+
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setup_main);
@@ -63,6 +69,7 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
}
mNextButton = (Button) findViewById(R.id.next_button);
mPrevButton = (Button) findViewById(R.id.prev_button);
+ mReveal = findViewById(R.id.reveal);
mSetupData.registerListener(this);
mNextButton.setOnClickListener(new View.OnClickListener() {
@Override
@@ -210,7 +217,39 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks
@Override
public void onFinish() {
- finishSetup();
+ animateOut();
+ }
+
+ private void animateOut() {
+ int cx = (mReveal.getLeft() + mReveal.getRight()) / 2;
+ int cy = (mReveal.getTop() + mReveal.getBottom()) / 2;
+ int finalRadius = Math.max(mReveal.getWidth(), mReveal.getHeight());
+ Animator anim =
+ ViewAnimationUtils.createCircularReveal(mReveal, cx, cy, 0, finalRadius);
+
+ anim.addListener(new Animator.AnimatorListener() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ mReveal.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ finishSetup();;
+ }
+ });
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {}
+
+ @Override
+ public void onAnimationRepeat(Animator animation) {}
+ });
+ anim.start();
}
private void handleWhisperPushRegistration() {