[Android] Don't attach an enter animation for the first fragment

Ludovic Fauvet git at videolan.org
Sat Jun 23 00:19:28 CEST 2012


android | branch: master | Ludovic Fauvet <etix at videolan.org> | Sat Jun 23 00:14:22 2012 +0200| [25c8cfdde2c04d4f5c0277eecadacba7349a773e] | committer: Ludovic Fauvet

Don't attach an enter animation for the first fragment

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=25c8cfdde2c04d4f5c0277eecadacba7349a773e
---

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 03b5ade..d6e570f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -498,10 +498,10 @@ public class MainActivity extends SherlockFragmentActivity {
 
         @Override
         public void onTabSelected(Tab tab, FragmentTransaction ft) {
-            if (mTag.equalsIgnoreCase("video"))
-                ft.setCustomAnimations(R.anim.anim_enter_left, R.anim.anim_leave_left);
-            else if (mTag.equalsIgnoreCase("audio"))
-                ft.setCustomAnimations(R.anim.anim_enter_right, R.anim.anim_leave_right);
+	        if (mTag.equalsIgnoreCase("video"))
+	            ft.setCustomAnimations((mFragment == null) ? 0 : R.anim.anim_enter_left, R.anim.anim_leave_left);
+	        else if (mTag.equalsIgnoreCase("audio"))
+	            ft.setCustomAnimations(R.anim.anim_enter_right, R.anim.anim_leave_right);
 
             if (mFragment == null) {
                 mFragment = Fragment.instantiate(mActivity, mClass.getName(), mArgs);



More information about the Android mailing list