@Override public void run() { float t = interpolate(); float scale = mZoomStart + t * (mZoomEnd - mZoomStart); float deltaScale = scale / getScale(); onScale(deltaScale, mFocalX, mFocalY); if (t < 1f) { Compat.postOnAnimation(CropView.this, this); } }
@Override public void onFling(float startX, float startY, float velocityX, float velocityY) { mCurrentFlingRunnable = new FlingRunnable(getContext()); mCurrentFlingRunnable.fling((int) velocityX, (int) velocityY); post(mCurrentFlingRunnable); }
public static int getPointerIndex(int action) { if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { return getPointerIndexHoneyComb(action); } else { return getPointerIndexEclair(action); } }
private void setScale(float scale, float focalX, float focalY, boolean animate) { if (scale < mMinScale || scale > mMaxScale) { return; } if (animate) { post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY)); } else { mSuppMatrix.setScale(scale, scale, focalX, focalY); checkAndDisplayMatrix(); } }
private void checkAndDisplayMatrix() { if (checkMatrixBounds()) { setImageMatrix(getDrawMatrix()); } }
private void setImageRotateBitmap(RotateBitmap bitmap) { Bitmap old = mBitmapDisplayed.getBitmap(); mBitmapDisplayed = bitmap; setImageBitmap(bitmap.getBitmap()); if (old != null) { old.recycle(); } updateBaseMatrix(); }
private int getCropViewWidth() { return getWidth() - getPaddingLeft() - getPaddingRight(); }
private void cancelFling() { if (null != mCurrentFlingRunnable) { mCurrentFlingRunnable.cancelFling(); mCurrentFlingRunnable = null; } }
public void setHeight(int height){ mAspectY++; updateBaseMatrix(); } public void setWidth(int width){
public static Crop of(Uri source, Uri destination) { return new Crop(source, destination); }
@Override public void onFling(float startX, float startY, float velocityX, float velocityY) { mCurrentFlingRunnable = new FlingRunnable(getContext()); mCurrentFlingRunnable.fling((int) velocityX, (int) velocityY); post(mCurrentFlingRunnable); }
private void setScale(float scale, float focalX, float focalY, boolean animate) { if (scale < mMinScale || scale > mMaxScale) { return; } if (animate) { post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY)); } else { mSuppMatrix.setScale(scale, scale, focalX, focalY); checkAndDisplayMatrix(); } }
@Override public void run() { float t = interpolate(); float scale = mZoomStart + t * (mZoomEnd - mZoomStart); float deltaScale = scale / getScale(); onScale(deltaScale, mFocalX, mFocalY); if (t < 1f) { Compat.postOnAnimation(CropView.this, this); } }
private void checkAndDisplayMatrix() { if (checkMatrixBounds()) { setImageMatrix(getDrawMatrix()); } }
private void setImageRotateBitmap(RotateBitmap bitmap) { Bitmap old = mBitmapDisplayed.getBitmap(); mBitmapDisplayed = bitmap; setImageBitmap(bitmap.getBitmap()); if (old != null) { old.recycle(); } updateBaseMatrix(); }
private int getCropViewWidth() { return getWidth() - getPaddingLeft() - getPaddingRight(); }
public static int getPointerIndex(int action) { if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { return getPointerIndexHoneyComb(action); } else { return getPointerIndexEclair(action); } }
private void cancelFling() { if (null != mCurrentFlingRunnable) { mCurrentFlingRunnable.cancelFling(); mCurrentFlingRunnable = null; } }
public void setWidth(int width){ mAspectX++; updateBaseMatrix(); } }
public static Crop of(Uri source, Uri destination) { return new Crop(source, destination); }