diff options
author | cretin45 <cretin45@gmail.com> | 2015-01-21 15:55:03 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-01-21 15:55:03 -0800 |
commit | 716ffa86dc68d72a6eb031a7ed52759b2298d4f3 (patch) | |
tree | 43523316775c317373411bd878ba07a60ccf2a3d /src/com/cyanogenmod/setupwizard/setup/SetupPage.java | |
parent | 48ca24eb9b92c9b62970c3a12e963f497fc65bbc (diff) | |
download | packages_apps_SetupWizard-716ffa86dc68d72a6eb031a7ed52759b2298d4f3.zip packages_apps_SetupWizard-716ffa86dc68d72a6eb031a7ed52759b2298d4f3.tar.gz packages_apps_SetupWizard-716ffa86dc68d72a6eb031a7ed52759b2298d4f3.tar.bz2 |
SetupWizard: More refactor to match redlines
Change-Id: I74f422ba0c294d5e91aefb9356458c681cc53b37
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup/SetupPage.java')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/SetupPage.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/SetupPage.java b/src/com/cyanogenmod/setupwizard/setup/SetupPage.java index 4c64d5c..60322bf 100644 --- a/src/com/cyanogenmod/setupwizard/setup/SetupPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/SetupPage.java @@ -21,10 +21,12 @@ import com.cyanogenmod.setupwizard.R; import android.app.Activity; import android.app.Fragment; import android.app.FragmentManager; -import android.app.FragmentTransaction; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.transition.Slide; +import android.transition.Transition; +import android.view.Gravity; public abstract class SetupPage implements Page { @@ -71,14 +73,19 @@ public abstract class SetupPage implements Page { public void doLoadAction(Activity context, int action) { if (context == null || context.isFinishing()) { return; } final FragmentManager fragmentManager = context.getFragmentManager(); + Fragment fragment = getFragment(); if (action == Page.ACTION_NEXT) { - FragmentTransaction transaction = fragmentManager.beginTransaction(); - transaction.replace(R.id.content, getFragment(), getKey()); - transaction.commit(); + Transition t = new Slide(Gravity.RIGHT); + fragment.setEnterTransition(t); + fragmentManager.beginTransaction() + .replace(R.id.content,fragment, getKey()) + .commit(); } else { - FragmentTransaction transaction = fragmentManager.beginTransaction(); - transaction.replace(R.id.content, getFragment(), getKey()); - transaction.commit(); + Transition t = new Slide(Gravity.LEFT); + fragment.setEnterTransition(t); + fragmentManager.beginTransaction() + .replace(R.id.content, fragment, getKey()) + .commit(); } } |