public void Run() { if (_scroller.IsFinished()) { return; // remaining post that should not be handled } var imageView = _attacher.GetImageView(); if (null != imageView && _scroller.ComputeScrollOffset()) { int newX = _scroller.GetCurrX(); int newY = _scroller.GetCurrY(); if (_attacher.DEBUG) { Log.Info(LOG_TAG, "fling run(). CurrentX:" + _currentX + " CurrentY:" + _currentY + " NewX:" + newX + " NewY:" + newY); } _attacher._suppMatrix.PostTranslate(_currentX - newX, _currentY - newY); _attacher.SetImageViewMatrix(_attacher.GetDrawMatrix()); _currentX = newX; _currentY = newY; Compat.PostOnAnimation(imageView, this); } }
public void Run() { var imageView = _attacher.GetImageView(); if (imageView == null) { return; } float t = Interpolate(); float scale = _zoomStart + t * (_zoomEnd - _zoomStart); float deltaScale = scale / _attacher.GetScale(); _attacher._suppMatrix.PostScale(deltaScale, deltaScale, _focalX, _focalY); _attacher.checkAndDisplayMatrix(); // We haven't hit our target scale yet, so post ourselves again if (t < 1f) { Compat.PostOnAnimation(imageView, this); } }