protected float computeMaxZoom() { final Drawable drawable = getDrawable(); if (drawable == null) { return 1f; } float fw = mBitmapRect.width() / mViewPort.width(); float fh = mBitmapRect.height() / mViewPort.height(); float scale = Math.max(fw, fh) * 4; if (DEBUG) { Log.i(TAG, "computeMaxZoom: " + scale); } return scale; }
protected float computeMinZoom() { if (DEBUG) { Log.i(TAG, "computeMinZoom"); } final Drawable drawable = getDrawable(); if (drawable == null) { return 1f; } float scale = getScale(mBaseMatrix); scale = Math.min(1f, 1f / scale); if (DEBUG) { Log.i(TAG, "computeMinZoom: " + scale); } return scale; }
@Override protected void onDraw(final Canvas canvas) { if (getScaleType() == ScaleType.FIT_XY) { final Drawable drawable = getDrawable(); if (null != drawable) { drawable.draw(canvas); } } else { super.onDraw(canvas); } } }
protected RectF getCenter(Matrix supportMatrix, boolean horizontal, boolean vertical) { final Drawable drawable = getDrawable();
protected void center(boolean horizontal, boolean vertical) { final Drawable drawable = getDrawable(); if (drawable == null) { return; } RectF rect = getCenter(mSuppMatrix, horizontal, vertical); if (rect.left != 0 || rect.top != 0) { postTranslate(rect.left, rect.top); } }
final Drawable drawable = getDrawable();
protected float computeMaxZoom() { final Drawable drawable = getDrawable(); if (drawable == null) { return 1F; } float fw = (float) drawable.getIntrinsicWidth() / (float) mThisWidth; float fh = (float) drawable.getIntrinsicHeight() / (float) mThisHeight; float scale = Math.max(fw, fh) * 8; if (LOG_ENABLED) { Log.i(LOG_TAG, "computeMaxZoom: " + scale); } return scale; }
protected float computeMinZoom() { if (LOG_ENABLED) { Log.i(LOG_TAG, "computeMinZoom"); } final Drawable drawable = getDrawable(); if (drawable == null) { return 1F; } float scale = getScale(mBaseMatrix); scale = Math.min(1f, 1f / scale); if (LOG_ENABLED) { Log.i(LOG_TAG, "computeMinZoom: " + scale); } return scale; }
protected RectF getBitmapRect(Matrix supportMatrix) { final Drawable drawable = getDrawable(); if (drawable == null) return null; Matrix m = getImageViewMatrix(supportMatrix); mBitmapRect.set(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); m.mapRect(mBitmapRect); return mBitmapRect; }
protected RectF getCenter(Matrix supportMatrix, boolean horizontal, boolean vertical) { final Drawable drawable = getDrawable();
protected void center(boolean horizontal, boolean vertical) { final Drawable drawable = getDrawable(); if (drawable == null) return; RectF rect = getCenter(mSuppMatrix, horizontal, vertical); if (rect.left != 0 || rect.top != 0) { if (LOG_ENABLED) { Log.i(LOG_TAG, "center"); } postTranslate(rect.left, rect.top); } }
if (getWidth() != 0 && getHeight() != 0 && getDrawable() != null) { float mImageOriginalWidth = getDrawable().getIntrinsicWidth(); float mImageOriginalHeight = getDrawable().getMinimumHeight(); if ((mImageOriginalWidth - getWidth()) * mImageOriginalWidth / getWidth() > (mImageOriginalHeight - getHeight()) * mImageOriginalHeight / getHeight()) { if (getWidth() != 0 && getHeight() != 0 && getDrawable() != null) { float mImageOriginalWidth = getDrawable().getIntrinsicWidth(); float mImageOriginalHeight = getDrawable().getMinimumHeight(); if ((mImageOriginalWidth - getWidth()) * mImageOriginalWidth / getWidth() < (mImageOriginalHeight - getHeight()) * mImageOriginalHeight / getHeight()) {
final Drawable drawable = getDrawable();