示例#1
0
        private void RunCountdown(int countdownTime, Action onFinished)
        {
            UpdateCountdownLabel(countdownTime);
            ViewPropertyAnimator animator = _label.Animate().ScaleX(0).ScaleY(0).Alpha(0.0f).SetDuration(1000);

            if (countdownTime > 0)
            {
                animator.WithEndAction(new Runnable(() => RunCountdown(countdownTime - 1, onFinished)));
            }
            else
            {
                animator.WithStartAction(new Runnable(onFinished));
                animator.WithEndAction(new Runnable(() => _label.Visibility = ViewStates.Visible));
            }
            animator.Start();
        }