/** * Sets scale and translate ready for the next draw. */ private void preDraw() { if (getWidth() == 0 || getHeight() == 0 || sWidth <= 0 || sHeight <= 0) { return; } // If waiting to translate to new center position, set translate now if (sPendingCenter != null && pendingScale != null) { scale = pendingScale; if (vTranslate == null) { vTranslate = new PointF(); } vTranslate.x = (getWidth()/2) - (scale * sPendingCenter.x); vTranslate.y = (getHeight()/2) - (scale * sPendingCenter.y); sPendingCenter = null; pendingScale = null; fitToBounds(true); refreshRequiredTiles(true); } // On first display of base image set up position, and in other cases make sure scale is correct. fitToBounds(false); }
refreshRequiredTiles(eagerLoadingEnabled); refreshRequiredTiles(eagerLoadingEnabled); refreshRequiredTiles(eagerLoadingEnabled); refreshRequiredTiles(true); return true;
/** * Enable or disable pan gesture detection. Disabling pan causes the image to be centered. Pan * can still be changed from code. * @param panEnabled true to enable panning, false to disable. */ public final void setPanEnabled(boolean panEnabled) { this.panEnabled = panEnabled; if (!panEnabled && vTranslate != null) { vTranslate.x = (getWidth()/2) - (scale * (sWidth()/2)); vTranslate.y = (getHeight()/2) - (scale * (sHeight()/2)); if (isReady()) { refreshRequiredTiles(true); invalidate(); } } }
refreshRequiredTiles(finished); if (finished) { if (anim.listener != null) {
execute(task); refreshRequiredTiles(true);
refreshRequiredTiles(finished); if (finished) { if (anim.listener != null) {
/** * Sets scale and translate ready for the next draw. */ private void preDraw() { if (getWidth() == 0 || getHeight() == 0 || sWidth <= 0 || sHeight <= 0) { return; } // If waiting to translate to new center position, set translate now if (sPendingCenter != null && pendingScale != null) { scale = pendingScale; if (vTranslate == null) { vTranslate = new PointF(); } vTranslate.x = (getWidth()/2) - (scale * sPendingCenter.x); vTranslate.y = (getHeight()/2) - (scale * sPendingCenter.y); sPendingCenter = null; pendingScale = null; fitToBounds(true); refreshRequiredTiles(true); } // On first display of base image set up position, and in other cases make sure scale is correct. fitToBounds(false); }
refreshRequiredTiles(false); refreshRequiredTiles(false); refreshRequiredTiles(false); refreshRequiredTiles(true); return true;
/** * Enable or disable pan gesture detection. Disabling pan causes the image to be centered. */ public final void setPanEnabled(boolean panEnabled) { this.panEnabled = panEnabled; if (!panEnabled && vTranslate != null) { vTranslate.x = (getWidth()/2) - (scale * (sWidth()/2)); vTranslate.y = (getHeight()/2) - (scale * (sHeight()/2)); if (isReady()) { refreshRequiredTiles(true); invalidate(); } } }
execute(task); refreshRequiredTiles(true);