setGestureDetector(getContext());
TypedArray typedAttr = getContext().obtainStyledAttributes(attr, styleable.SubsamplingScaleImageView); if (typedAttr.hasValue(styleable.SubsamplingScaleImageView_assetName)) { String assetName = typedAttr.getString(styleable.SubsamplingScaleImageView_assetName);
BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, false); execute(task);
Uri uri = previewSource.getUri(); if (uri == null && previewSource.getResource() != null) { uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getContext().getPackageName() + "/" + previewSource.getResource()); BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, true); execute(task); uri = imageSource.getUri(); if (uri == null && imageSource.getResource() != null) { uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getContext().getPackageName() + "/" + imageSource.getResource()); TilesInitTask task = new TilesInitTask(this, getContext(), regionDecoderFactory, uri); execute(task); } else { BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, false); execute(task);
TypedArray typedAttr = getContext().obtainStyledAttributes(attr, styleable.SubsamplingScaleImageView); if (typedAttr.hasValue(styleable.SubsamplingScaleImageView_assetName)) { String assetName = typedAttr.getString(styleable.SubsamplingScaleImageView_assetName);
setGestureDetector(getContext());
= new GestureDetector(imageView.getContext(), new GestureDetector.SimpleOnGestureListener() { @Override
Uri uri = previewSource.getUri(); if (uri == null && previewSource.getResource() != null) { uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getContext().getPackageName() + "/" + previewSource.getResource()); BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, true); execute(task); uri = imageSource.getUri(); if (uri == null && imageSource.getResource() != null) { uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + getContext().getPackageName() + "/" + imageSource.getResource()); TilesInitTask task = new TilesInitTask(this, getContext(), regionDecoderFactory, uri); execute(task); } else { BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, false); execute(task);
public static void bindSubsamplingImageView(SubsamplingScaleImageView imageView, Photo photo, SubsamplingScaleImageView.DefaultOnImageEventListener onImageEventListener) { imageView.recycle(); ImageViewState imageViewState = null; if (photo.getImageViewSavedState() != null) { imageViewState = (ImageViewState) photo.getImageViewSavedState(); photo.putImageViewSavedState(null); } imageView.setImage( ImageSource.uri(photo.getUri(imageView.getContext())), imageViewState); if (onImageEventListener != null) { imageView.setOnImageEventListener(onImageEventListener); } }
BitmapLoadTask task = new BitmapLoadTask(this, getContext(), bitmapDecoderFactory, uri, false); execute(task);