Example #1
0
    @Override
    public void run() {

      //
      // OnTouchImageViewListener is set: TouchImageView listener has been flung by user.
      // Listener runnable updated with each frame of fling animation.
      //
      if (touchImageViewListener != null) {
        touchImageViewListener.onMove();
      }

      if (scroller.isFinished()) {
        scroller = null;
        return;
      }

      if (scroller.computeScrollOffset()) {
        int newX = scroller.getCurrX();
        int newY = scroller.getCurrY();
        int transX = newX - currX;
        int transY = newY - currY;
        currX = newX;
        currY = newY;
        matrix.postTranslate(transX, transY);
        fixTrans();
        setImageMatrix(matrix);
        compatPostOnAnimation(this);
      }
    }