@Override public void onAnimationEnd(final Animator animation) { RectF centerRect = getCenter(mSuppMatrix, true, true); if (centerRect.left != 0 || centerRect.top != 0) { scrollBy(centerRect.left, centerRect.top); } }
@Override public void run() { long now = System.currentTimeMillis(); double currentMs = Math.min(durationMs, now - startTime); double x = mEasing.easeOut(currentMs, 0, dx, durationMs); double y = mEasing.easeOut(currentMs, 0, dy, durationMs); panBy((x - old_x), (y - old_y)); old_x = x; old_y = y; if (currentMs < durationMs) { mHandler.post(this); } else { RectF centerRect = getCenter(mSuppMatrix, true, true); if (centerRect.left != 0 || centerRect.top != 0) scrollBy(centerRect.left, centerRect.top); } } });