use of com.keylesspalace.tusky.entity.Attachment.Focus in project Tusky by Vavassor.
the class StatusBaseViewHolder method loadImage.
private void loadImage(MediaPreviewImageView imageView, @Nullable String previewUrl, @Nullable MetaData meta, @Nullable String blurhash) {
Drawable placeholder = blurhash != null ? decodeBlurHash(blurhash) : mediaPreviewUnloaded;
if (TextUtils.isEmpty(previewUrl)) {
imageView.removeFocalPoint();
Glide.with(imageView).load(placeholder).centerInside().into(imageView);
} else {
Focus focus = meta != null ? meta.getFocus() : null;
if (focus != null) {
// If there is a focal point for this attachment:
imageView.setFocalPoint(focus);
Glide.with(imageView).load(previewUrl).placeholder(placeholder).centerInside().addListener(imageView).into(imageView);
} else {
imageView.removeFocalPoint();
Glide.with(imageView).load(previewUrl).placeholder(placeholder).centerInside().into(imageView);
}
}
}
Aggregations