protected void panBy(double dx, double dy) { RectF rect = getBitmapRect(); mScrollPoint.set((float) dx, (float) dy); updateRect(rect, mScrollPoint); if (mScrollPoint.x != 0 || mScrollPoint.y != 0) { postTranslate(mScrollPoint.x, mScrollPoint.y); center(true, true); } }
protected void zoomTo(float scale, float centerX, float centerY) { if (scale > getMaxScale()) { scale = getMaxScale(); } float oldScale = getScale(); float deltaScale = scale / oldScale; postScale(deltaScale, centerX, centerY); onZoom(getScale()); center(true, true); }
center(true, true);
protected void panBy(double dx, double dy) { RectF rect = getBitmapRect(); mScrollRect.set((float) dx * scrollFactor, (float) dy * scrollFactor, 0, 0); updateRect(rect, mScrollRect); postTranslate(mScrollRect.left, mScrollRect.top); center(true, true); }
@Override public void run() { long now = System.currentTimeMillis(); float currentMs = Math.min(durationMs, now - startTime); float newScale = (float) mEasing.easeInOut(currentMs, 0, deltaScale, durationMs); zoomTo(oldScale + newScale, destX, destY); if (currentMs < durationMs) { mHandler.post(this); } else { onZoomAnimationCompleted(getScale()); center(true, true); } } });
protected void zoomTo(float scale, float centerX, float centerY) { if (scale > getMaxScale()) scale = getMaxScale(); float oldScale = getScale(); float deltaScale = scale / oldScale; postScale(deltaScale, centerX, centerY); onZoom(getScale()); center(true, true); }
center(true, true);