diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java index 3a5e2ef..121cafd 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/MoreSettingActivity.java @@ -11,6 +11,8 @@ import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.NumberPicker; @@ -103,6 +105,9 @@ public class MoreSettingActivity extends BaseActivity { binding.svContent.setVisibility(View.GONE); - FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + binding.svContent.startAnimation(exitAnim); + FragmentTransaction ft = getSupportFragmentManager() + .beginTransaction() + .setCustomAnimations( + R.anim.fragment_enter, + R.anim.fragment_exit, + R.anim.fragment_enter_pop, + R.anim.fragment_exit_pop + ); if (mProxyFragment == null) { mProxyFragment = new ProxyFragment(); ft.add(R.id.ll_content, mProxyFragment); @@ -257,7 +272,15 @@ public class MoreSettingActivity extends BaseActivity { binding.svContent.setVisibility(View.GONE); - FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + binding.svContent.startAnimation(exitAnim); + FragmentTransaction ft = getSupportFragmentManager() + .beginTransaction() + .setCustomAnimations( + R.anim.fragment_enter, + R.anim.fragment_exit, + R.anim.fragment_enter_pop, + R.anim.fragment_exit_pop + ); if (mWebDavFragment == null) { mWebDavFragment = new WebDavFragment(); ft.add(R.id.ll_content, mWebDavFragment); @@ -609,7 +632,15 @@ public class MoreSettingActivity extends BaseActivity + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_enter_pop.xml b/app/src/main/res/anim/fragment_enter_pop.xml new file mode 100644 index 0000000..6a1d9f3 --- /dev/null +++ b/app/src/main/res/anim/fragment_enter_pop.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_exit.xml b/app/src/main/res/anim/fragment_exit.xml new file mode 100644 index 0000000..59ca284 --- /dev/null +++ b/app/src/main/res/anim/fragment_exit.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_exit_pop.xml b/app/src/main/res/anim/fragment_exit_pop.xml new file mode 100644 index 0000000..c39aaf6 --- /dev/null +++ b/app/src/main/res/anim/fragment_exit_pop.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file