Exemplo n.º 1
0
 public override Animator OnCreateAnimator(FragmentTransit transit, bool enter, int nextAnim)
 {
     //Mvx.Trace("SettingsView:OnCreateAnimator, transit = " + transit.ToString() +", enter = " + enter +", nextAnim = " + nextAnim);
     //if (EnterTransition != null)
     //   Mvx.Trace("enterTransition = " + EnterTransition.GetType().Name);
     return(base.OnCreateAnimator(transit, enter, nextAnim));
 }
 public override Android.Animation.Animator OnCreateAnimator(FragmentTransit transit, bool enter, int nextAnim)
 {
     if (!enter && shouldAnimatePop)
     {
         return(AnimatorInflater.LoadAnimator(View.Context, Resource.Animation.add_to_basket_in));
     }
     return(base.OnCreateAnimator(transit, enter, nextAnim));
 }
Exemplo n.º 3
0
        public override Animator OnCreateAnimator(FragmentTransit transit, bool enter, int nextAnim)
        {
            int      id   = enter ? Resource.Animator.slide_fragment_in : Resource.Animator.slide_fragment_out;
            Animator anim = AnimatorInflater.LoadAnimator(Activity, id);

            if (enter)
            {
                anim.AnimationEnd += anim_AnimationEnd;
            }

            return(anim);
        }
Exemplo n.º 4
0
 public static void CreateFragment(FragmentManager manager, int viewContainerId, Fragment fragment, FragmentTransit transition = FragmentTransit.None)
 {
     try
     {
         var trans = manager.BeginTransaction();
         trans.Replace(viewContainerId, fragment);
         trans.SetTransition(transition);
         trans.Commit();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
        void DoTransaction(Fragment fragment, FragmentTransit transition, bool addToBackstack, string title)
        {
            FragmentTransaction tx = this.FragmentManager.BeginTransaction();

            tx.SetTransition(transition);
            tx.Replace(Resource.Id.fragmentcontainer, fragment);
            if (addToBackstack)
            {
                tx.AddToBackStack(typeof(Fragment).ToString());
            }

            this.ActionBar.Title = title;
            tx.Commit();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Called when a fragment loads an animation.
        /// </summary>
        /// <param name="transit">To be added.</param>
        /// <param name="enter">To be added.</param>
        /// <param name="nextAnim">To be added.</param>
        /// <returns>The Animator object to be used for the transition.</returns>
        public override Animator OnCreateAnimator([GeneratedEnum] FragmentTransit transit, bool enter, int nextAnim)
        {
            var animator = AnimatorInflater.LoadAnimator(Activity, nextAnim);

            if (animator != null)
            {
                animator.AnimationStart += (sender, args) =>
                {
                    ((Activities.CrexActivity)Activity).FragmentAnimationStarted(enter);
                };
                animator.AnimationEnd += (sender, args) =>
                {
                    ((Activities.CrexActivity)Activity).FragmentAnimationEnded(enter);
                };
            }

            return(animator);
        }
Exemplo n.º 7
0
        public override Animator OnCreateAnimator(FragmentTransit transit, bool enter, int nextAnim)
        {
            Animator animator = AnimatorInflater.LoadAnimator(Activity,
                                                              enter ? Android.Resource.Animator.FadeIn : Android.Resource.Animator.FadeOut);

            // We bind a listener for the fragment transaction. We only bind it when
            // this fragment is entering.
            if (animator != null && enter)
            {
                animator.AnimationEnd += (object sender, EventArgs e) => {
                    // This method is called at the end of the animation for the fragment transaction,
                    // which is perfect time to start our Transition.
                    Log.Info(TAG, "Fragment animation ended. Starting a Transition.");
                    Scene scene = Scene.GetSceneForLayout((ViewGroup)View, Resource.Layout.fragment_detail_content, Activity);
                    TransitionManager.Go(scene);
                    // Note that we need to bind views with data after we call TransitionManager.go().
                    Bind(scene.SceneRoot);
                }
            }
            ;

            return(animator);
        }
    }
		public override Android.Animation.Animator OnCreateAnimator (FragmentTransit transit, bool enter, int nextAnim)
		{
			if (!enter && shouldAnimatePop)
				return AnimatorInflater.LoadAnimator (View.Context, Resource.Animation.add_to_basket_in);
			return base.OnCreateAnimator (transit, enter, nextAnim);
		}
		public override Animator OnCreateAnimator (FragmentTransit transit, bool enter, int nextAnim)
		{
			Animator animator = AnimatorInflater.LoadAnimator (Activity,
				enter ? Android.Resource.Animator.FadeIn : Android.Resource.Animator.FadeOut);
			
			// We bind a listener for the fragment transaction. We only bind it when
			// this fragment is entering.
			if (animator != null && enter)
				animator.AnimationEnd += (object sender, EventArgs e) => {
					// This method is called at the end of the animation for the fragment transaction,
					// which is perfect time to start our Transition.
					Log.Info (TAG, "Fragment animation ended. Starting a Transition.");
					Scene scene = Scene.GetSceneForLayout ((ViewGroup)View, Resource.Layout.fragment_detail_content, Activity);
					TransitionManager.Go (scene);
					// Note that we need to bind views with data after we call TransitionManager.go().
					Bind (scene.SceneRoot);
				};

			return animator;		
		}