summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup/FinishPage.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/setup/FinishPage.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/setup/FinishPage.java')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/FinishPage.java53
1 files changed, 5 insertions, 48 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/FinishPage.java b/src/com/cyanogenmod/setupwizard/setup/FinishPage.java
index 3aa7422..e49cbc6 100644
--- a/src/com/cyanogenmod/setupwizard/setup/FinishPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/FinishPage.java
@@ -16,17 +16,13 @@
package com.cyanogenmod.setupwizard.setup;
-import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
-
-import android.animation.Animator;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.view.ViewAnimationUtils;
+
+import com.cyanogenmod.setupwizard.R;
+import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
public class FinishPage extends SetupPage {
@@ -63,7 +59,7 @@ public class FinishPage extends SetupPage {
@Override
public boolean doNextAction() {
- mFinishFragment.animateOut(getCallbacks());
+ getCallbacks().onFinish();
return true;
}
@@ -79,53 +75,14 @@ public class FinishPage extends SetupPage {
public static class FinishFragment extends SetupPageFragment {
- private View mReveal;
-
- private Handler mHandler;
-
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- mHandler = new Handler();
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.primary));
}
@Override
- protected void initializePage() {
- mReveal = mRootView.findViewById(R.id.reveal);
- }
-
- private void animateOut(final SetupDataCallbacks callbacks) {
- 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() {
- callbacks.onFinish();
- }
- });
- }
-
- @Override
- public void onAnimationCancel(Animator animation) {}
-
- @Override
- public void onAnimationRepeat(Animator animation) {}
- });
- anim.start();
- }
+ protected void initializePage() {}
@Override
protected int getLayoutResource() {