use of com.bumptech.glide.request.target.GlideDrawableImageViewTarget in project Signal-Android by WhisperSystems.
the class ZoomingImageView method setImageViewUri.
private void setImageViewUri(MasterSecret masterSecret, Uri uri) {
subsamplingImageView.setVisibility(View.GONE);
imageView.setVisibility(View.VISIBLE);
Glide.with(getContext()).load(new DecryptableUri(masterSecret, uri)).diskCacheStrategy(DiskCacheStrategy.NONE).dontTransform().dontAnimate().into(new GlideDrawableImageViewTarget(imageView) {
@Override
protected void setResource(GlideDrawable resource) {
super.setResource(resource);
imageViewAttacher.update();
}
});
}
use of com.bumptech.glide.request.target.GlideDrawableImageViewTarget in project Pix-Art-Messenger by kriztan.
the class ShowFullscreenMessageActivity method DisplayImage.
private void DisplayImage(final File file) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(new File(file.getPath()).getAbsolutePath(), options);
height = options.outHeight;
width = options.outWidth;
rotation = getRotation(Uri.parse("file://" + file.getAbsolutePath()));
Log.d(Config.LOGTAG, "Image height: " + height + ", width: " + width + ", rotation: " + rotation);
if (useAutoRotateScreen()) {
rotateScreen(width, height, rotation);
}
final PhotoViewAttacher mAttacher = new PhotoViewAttacher(mImage);
mImage.setVisibility(View.VISIBLE);
try {
Glide.with(this).load(file).dontAnimate().into(new GlideDrawableImageViewTarget(mImage) {
@Override
public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
super.onResourceReady(resource, animation);
mAttacher.update();
}
});
} catch (Exception e) {
Toast.makeText(this, getString(R.string.error_file_corrupt), Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
Aggregations