private void SmoothScrollBrowser(bool down)
        {
            var delay = (DateTime.Now - scrollLastTime).TotalMilliseconds;

            if (scrollLastDirection.HasValue && scrollLastDirection == down && SCROLL_ACCEL_DELAY_MS > delay)
            {
                scrollAccel += SCROLL_ACCEL_INCREMENT;
            }
            else
            {
                scrollAccel = 0;
            }

            scrollLastTime      = DateTime.Now;
            scrollLastDirection = down;
            ObjectAnimator anim = ObjectAnimator.OfInt(_browserView, "scrollY", _browserView.ScrollY, _browserView.ScrollY + (down ? 300 + scrollAccel : -300 - scrollAccel));

            if (_currentScroll != null)
            {
                _currentScroll.End();
                anim.SetInterpolator(new DecelerateInterpolator());
            }
            else
            {
                anim.SetInterpolator(new AccelerateDecelerateInterpolator());
            }
            anim.SetDuration(500).Start();
            _currentScroll = anim;
        }
示例#2
0
        private void SmoothScrollBrowser(bool down)
        {
            ObjectAnimator anim = ObjectAnimator.OfInt(_browserView, "scrollY", _browserView.ScrollY, _browserView.ScrollY + (down ? 300 : -300));

            if (_currentScroll != null)
            {
                _currentScroll.End();
                anim.SetInterpolator(new DecelerateInterpolator());
            }
            else
            {
                anim.SetInterpolator(new AccelerateDecelerateInterpolator());
            }
            anim.SetDuration(500).Start();
            _currentScroll = anim;
        }
 private void StopTextColorAnimation()
 {
     _textColorChangingAnimation.End();
 }