コード例 #1
0
            public void OnAnimationEnd(Animation animation)
            {
                if (_swipeRefreshLayout._refreshing)
                {
                    // Make sure the progress view is fully visible
                    _swipeRefreshLayout._progress.SetAlpha(MaxAlpha);
                    _swipeRefreshLayout._progress.Start();
                    if (_swipeRefreshLayout._notify)
                    {
                        _swipeRefreshLayout._listener?.OnRefresh();
                    }
                }
                else
                {
                    _swipeRefreshLayout._progress.Stop();
                    _swipeRefreshLayout._circleView.Visibility = ViewStates.Gone;
                    _swipeRefreshLayout.SetColorViewAlpha(MaxAlpha);
                    // Return the circle to its start position
                    if (_swipeRefreshLayout._scale)
                    {
                        _swipeRefreshLayout.SetAnimationProgress(0 /* animation complete and view is hidden */);
                    }
                    else
                    {
                        _swipeRefreshLayout.SetTargetOffsetTopAndBottom(
                            _swipeRefreshLayout.OriginalOffsetTop - _swipeRefreshLayout._currentTargetOffsetTop,
                            true /* requires update */);
                    }
                }

                _swipeRefreshLayout._currentTargetOffsetTop = _swipeRefreshLayout._circleView.Top;
            }
コード例 #2
0
            protected override void ApplyTransformation(float interpolatedTime, Transformation t)
            {
                var targetTop = 0;
                var endTarget = 0;

                if (!_swipeRefreshLayout._usingCustomStart)
                {
                    endTarget = (int)(_swipeRefreshLayout._spinnerFinalOffset -
                                      System.Math.Abs(_swipeRefreshLayout.OriginalOffsetTop));
                }
                else
                {
                    endTarget = (int)_swipeRefreshLayout._spinnerFinalOffset;
                }

                targetTop = _swipeRefreshLayout.From +
                            (int)((endTarget - _swipeRefreshLayout.From) * interpolatedTime);
                var offset = targetTop - _swipeRefreshLayout._circleView.Top;

                _swipeRefreshLayout.SetTargetOffsetTopAndBottom(offset, false /* requires update */);
                _swipeRefreshLayout._progress.SetArrowScale(1 - interpolatedTime);
            }