public override void AnimateHide(BaseToastView toastView, Action completion) { toastView.Alpha = 1; UIView.Animate(AnimationDuration, 0, UIViewAnimationOptions.CurveEaseInOut, () => { toastView.Alpha = 0; }, completion); }
public override void AnimateShow(BaseToastView toastView) { toastView.Alpha = 0; UIView.Animate(AnimationDuration, 0, UIViewAnimationOptions.CurveEaseOut, () => { toastView.Alpha = 1; }, null); }
public ToastTimer(BaseToastView toastView, double duration, Action completion) { _toastView = toastView; _duration = duration; _completion = completion; _timer = new Timer(_duration); _timer.AutoReset = false; }
public override void AnimateShow(BaseToastView toastView) { toastView.Transform = CoreGraphics.CGAffineTransform.MakeScale(0.7f, 0.7f); toastView.ParentView.LayoutIfNeeded(); toastView.Alpha = 0; UIView.AnimateNotify(AnimationDuration, 0, 0.65f, 1f, UIViewAnimationOptions.CurveEaseInOut, () => { toastView.Alpha = 1; toastView.Transform = CoreGraphics.CGAffineTransform.MakeScale(1, 1); toastView.ParentView.LayoutIfNeeded(); }, null); }
/// <summary> /// Start hide animation. /// Completion will be invoked when animation completes. /// </summary> public abstract void AnimateHide(BaseToastView toastView, Action completion);
/// <summary> /// Start show animation /// </summary> public abstract void AnimateShow(BaseToastView toastView);