BigImageViewer
BigImageViewer copied to clipboard
Double Click zoom is not zooming in with 'centerInside' scale type.
Double Click zoom is not zooming in with 'centerInside' value for 'initScaleType'. I want to show full image on the screen and give an ability that user can tap it twice to see the details.
You mean making the tapped position become center of screen after zooming in?
Actually that's SSIV's feature, you can read its doc, or submit a issue here: https://github.com/davemorrissey/subsampling-scale-image-view
No. That can be another topic. I mean it doesn't work at all with initScaleType="centerInside". Reaction for image tapped twice is none or insignificant.
Double tap to zoom is working fine for the same image in SSIV(typically the image is of height>>width such that the center fit is on the basis of height) but the image is not zooming on double tap in BigImage..
I think it's because SubsamplingScaleImageView.this.doubleTapZoomScale is always 1.
So this line in the doubleTapZoom will always zoom to 1.
float doubleTapZoomScale = Math.min(maxScale, SubsamplingScaleImageView.this.doubleTapZoomScale);
Because this value will be set in DisplayOptimizeListener.onReady which was called in SubsamplingScaleImageView.onImageLoaded.
This is how I make it work.
imageSliderImageView.setImageLoaderCallback(new ImageLoader.Callback() {
@Override
public void onCacheHit(int imageType, File image) {
}
@Override
public void onCacheMiss(int imageType, File image) {
}
@Override
public void onStart() {
}
@Override
public void onProgress(int progress) {
}
@Override
public void onFinish() {
}
@Override
public void onSuccess(File image) {
final SubsamplingScaleImageView view = imageSliderImageView.getSSIV();
if( view != null ){
view.setMinimumDpi(80);
view.setOnImageEventListener(new SubsamplingScaleImageView.OnImageEventListener() {
@Override
public void onReady() {
}
@Override
public void onImageLoaded() {
view.setDoubleTapZoomDpi(80);
view.setDoubleTapZoomDuration(200);
view.setDoubleTapZoomStyle(ZOOM_FOCUS_FIXED);
view.setQuickScaleEnabled(false);
}
@Override
public void onPreviewLoadError(Exception e) {
}
@Override
public void onImageLoadError(Exception e) {
}
@Override
public void onTileLoadError(Exception e) {
}
@Override
public void onPreviewReleased() {
}
});
}
}
@Override
public void onFail(Exception error) {
}
});