From 0a7ecb89ce91fcb6b284a0236a1fef1c2e2dea0b Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Wed, 28 Jun 2017 16:38:13 -0300 Subject: [PATCH] Adjust fragments' enter/exit animations - Make a little bit faster --- .../java/org/schabi/newpipe/util/NavigationHelper.java | 8 ++++---- app/src/main/res/anim/custom_fade_in.xml | 6 ++++++ app/src/main/res/anim/custom_fade_out.xml | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/anim/custom_fade_in.xml create mode 100644 app/src/main/res/anim/custom_fade_out.xml diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index 56a44cf55..8c47879a3 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -77,14 +77,14 @@ public class NavigationHelper { public static void openMainFragment(FragmentManager fragmentManager) { ImageLoader.getInstance().clearMemoryCache(); fragmentManager.beginTransaction() - .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out) + .setCustomAnimations(R.anim.custom_fade_in, R.anim.custom_fade_out, R.anim.custom_fade_in, R.anim.custom_fade_out) .replace(R.id.fragment_holder, new MainFragment()) .commit(); } public static void openSearchFragment(FragmentManager fragmentManager, int serviceId, String query) { fragmentManager.beginTransaction() - .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out) + .setCustomAnimations(R.anim.custom_fade_in, R.anim.custom_fade_out, R.anim.custom_fade_in, R.anim.custom_fade_out) .replace(R.id.fragment_holder, SearchFragment.getInstance(serviceId, query)) .addToBackStack(null) .commit(); @@ -109,7 +109,7 @@ public class NavigationHelper { instance.setAutoplay(autoPlay); fragmentManager.beginTransaction() - .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out) + .setCustomAnimations(R.anim.custom_fade_in, R.anim.custom_fade_out, R.anim.custom_fade_in, R.anim.custom_fade_out) .replace(R.id.fragment_holder, instance) .addToBackStack(null) .commit(); @@ -118,7 +118,7 @@ public class NavigationHelper { public static void openChannelFragment(FragmentManager fragmentManager, int serviceId, String url, String name) { if (name == null) name = ""; fragmentManager.beginTransaction() - .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out) + .setCustomAnimations(R.anim.custom_fade_in, R.anim.custom_fade_out, R.anim.custom_fade_in, R.anim.custom_fade_out) .replace(R.id.fragment_holder, ChannelFragment.getInstance(serviceId, url, name)) .addToBackStack(null) .commit(); diff --git a/app/src/main/res/anim/custom_fade_in.xml b/app/src/main/res/anim/custom_fade_in.xml new file mode 100644 index 000000000..2b94a1394 --- /dev/null +++ b/app/src/main/res/anim/custom_fade_in.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/anim/custom_fade_out.xml b/app/src/main/res/anim/custom_fade_out.xml new file mode 100644 index 000000000..03a6bc9bb --- /dev/null +++ b/app/src/main/res/anim/custom_fade_out.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file