Ejemplo n.º 1
0
 /// <summary>
 /// Animates a fade-out where the view starts visible and fades to hidden.
 /// </summary>
 /// <param name="view">The view to animate.</param>
 /// <param name="duration">The duration for the animation.</param>
 /// <param name="animationOptions">The animation options, the default is a cross dissolve transition.</param>
 public static void AnimateFadeOut(
     UIView view,
     double duration,
     UIViewAnimationOptions animationOptions = UIViewAnimationOptions.TransitionCrossDissolve)
 {
     ViewAnimation.AnimateFadeOut(new[] { view }, duration, animationOptions);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Animates a fade-in where the view starts hidden and fades visible.
        /// </summary>
        /// <param name="views">A list of views to animate.</param>
        /// <param name="duration">The duration for the animation.</param>
        /// <param name="delay">An optional delay before starting the animation.</param>
        /// <param name="animationOptions">The animation options, the default is a cross dissolve transition.</param>
        public static void AnimateFadeIn(
            IEnumerable <UIView> views,
            double duration,
            double delay = 0,
            UIViewAnimationOptions animationOptions = UIViewAnimationOptions.TransitionCrossDissolve)
        {
            if (delay > 0)
            {
                foreach (UIView view in views)
                {
                    view.Alpha = 0;
                }

                NSTimer.CreateScheduledTimer(delay, timer => ViewAnimation.AnimateFadeIn(views, duration, animationOptions));
            }
            else
            {
                ViewAnimation.AnimateFadeIn(views, duration, animationOptions);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Animates the movement of a list of views in a vertical direction.
 /// </summary>
 /// <param name="duration">The duration for the animation.</param>
 /// <param name="translateY">The amount to translate.</param>
 /// <param name="views">One or more views to move vertically.</param>
 public static void AnimateMoveVertical(double duration, nfloat translateY, params UIView[] views)
 {
     ViewAnimation.AnimateMoveVertical(duration, translateY, (IEnumerable <UIView>)views);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Resets the tranform for the given views.
 /// </summary>
 /// <param name="views">One or more views.</param>
 public static void ResetTransform(params UIView[] views)
 {
     ViewAnimation.ResetTransform((IEnumerable <UIView>)views);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Animates the movement of a list of views in a vertical direction.
 /// </summary>
 /// <param name="duration">The duration for the animation.</param>
 /// <param name="translateY">The amount to translate.</param>
 /// <param name="views">One or more views to move vertically.</param>
 public static void AnimateMoveVertical(double duration, nfloat translateY, IEnumerable <UIView> views)
 {
     ViewAnimation.AnimateMoveVertical(duration, translateY, () => { }, views);
 }