Advertisement
Pauland

Waiting Fragment animation

Nov 6th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1.  
  2. public class FragmentBase extends SherlockFragment
  3. {
  4.  
  5.     @Override
  6.     public Animation onCreateAnimation(int transit, boolean enter, int nextAnim)
  7.     {
  8.         Animation anim;
  9.         if (enter)
  10.         {
  11.             anim = AnimationUtils.loadAnimation(this.getActivity(), R.anim.fragment_enter);
  12.         }
  13.         else
  14.         {
  15.             anim = AnimationUtils.loadAnimation(this.getActivity(), R.anim.fragment_exit);
  16.         }
  17.  
  18.         anim.setAnimationListener(new AnimationListener()
  19.         {
  20.             public void onAnimationEnd(Animation animation)
  21.             {
  22.  
  23.                 FragmentBase.this.onFragmentEndAnimation();
  24.             }
  25.  
  26.             public void onAnimationRepeat(Animation animation)
  27.             {
  28.             }
  29.  
  30.             public void onAnimationStart(Animation animation)
  31.             {
  32.             }
  33.         });
  34.  
  35.         return anim;
  36.     }
  37.  
  38.  
  39.     protected void onFragmentEndAnimation()
  40.     {
  41.         //To Override
  42.     }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement