private void ListViewOnOnOverscrolled(object sender, OverscrollListenerListViewEventArgs overscrollListenerListViewEventArgs) { if (overscrollListenerListViewEventArgs.DeltaY < 0) { _overscrolling = true; vT.ComputeCurrentVelocity(1); if (_header != null && (int)Math.Ceiling(_header.GetY()) != 0 && _historyEvent.Action == MotionEventActions.Up || _historyEvent.Action == MotionEventActions.Cancel) { long duration = (long)Math.Ceiling(Math.Abs(_header.Height) / vT.GetYVelocity(0)); _header.Animate().Y(0).SetDuration(duration).SetInterpolator(new DecelerateInterpolator(1.0f)).Start(); _listView.Animate().Y(_header.Height).SetDuration(duration).SetInterpolator(new DecelerateInterpolator(1.0f)).Start(); } } else { _overscrolling = false; } }
private void ListViewOnOnOverscrolled(object sender, OverscrollListenerListViewEventArgs overscrollListenerListViewEventArgs) { if (overscrollListenerListViewEventArgs.DeltaY < 0) { _overscrolling = true; vT.ComputeCurrentVelocity(1); if (_header != null && (int)Math.Ceiling(_header.GetY()) != 0 &&_historyEvent.Action == MotionEventActions.Up || _historyEvent.Action == MotionEventActions.Cancel) { long duration = (long)Math.Ceiling(Math.Abs(_header.Height) / vT.GetYVelocity(0)); _header.Animate().Y(0).SetDuration(duration).SetInterpolator(new DecelerateInterpolator(1.0f)).Start(); _listView.Animate().Y(_header.Height).SetDuration(duration).SetInterpolator(new DecelerateInterpolator(1.0f)).Start(); } } else { _overscrolling = false; } }