use of org.thoughtcrime.securesms.mms.GlideRequest in project Signal-Android by WhisperSystems.
the class ThumbnailView method buildThumbnailGlideRequest.
private GlideRequest buildThumbnailGlideRequest(@NonNull GlideRequests glideRequests, @NonNull Slide slide) {
GlideRequest request = applySizing(glideRequests.load(new DecryptableUri(slide.getUri())).diskCacheStrategy(DiskCacheStrategy.RESOURCE).transition(withCrossFade()), fit);
boolean doNotShowMissingThumbnailImage = Build.VERSION.SDK_INT < 23;
if (slide.isInProgress() || doNotShowMissingThumbnailImage)
return request;
else
return request.apply(RequestOptions.errorOf(R.drawable.ic_missing_thumbnail_picture));
}
use of org.thoughtcrime.securesms.mms.GlideRequest in project Signal-Android by WhisperSystems.
the class ThumbnailView method setImageResource.
public ListenableFuture<Boolean> setImageResource(@NonNull GlideRequests glideRequests, @NonNull Uri uri, int width, int height) {
SettableFuture<Boolean> future = new SettableFuture<>();
if (transferControls.isPresent())
getTransferControls().setVisibility(View.GONE);
GlideRequest request = glideRequests.load(new DecryptableUri(uri)).diskCacheStrategy(DiskCacheStrategy.NONE).transition(withCrossFade());
if (width > 0 && height > 0) {
request = request.override(width, height);
}
if (radius > 0) {
request = request.transforms(new CenterCrop(), new RoundedCorners(radius));
} else {
request = request.transforms(new CenterCrop());
}
request.into(new GlideDrawableListeningTarget(image, future));
blurhash.setImageDrawable(null);
return future;
}
use of org.thoughtcrime.securesms.mms.GlideRequest in project Signal-Android by signalapp.
the class ThumbnailView method setImageResource.
public ListenableFuture<Boolean> setImageResource(@NonNull GlideRequests glideRequests, @NonNull Uri uri, int width, int height) {
SettableFuture<Boolean> future = new SettableFuture<>();
if (transferControls.isPresent())
getTransferControls().setVisibility(View.GONE);
GlideRequest request = glideRequests.load(new DecryptableUri(uri)).diskCacheStrategy(DiskCacheStrategy.NONE).transition(withCrossFade());
if (width > 0 && height > 0) {
request = request.override(width, height);
}
if (radius > 0) {
request = request.transforms(new CenterCrop(), new RoundedCorners(radius));
} else {
request = request.transforms(new CenterCrop());
}
request.into(new GlideDrawableListeningTarget(image, future));
blurhash.setImageDrawable(null);
return future;
}
use of org.thoughtcrime.securesms.mms.GlideRequest in project Signal-Android by signalapp.
the class ThumbnailView method buildThumbnailGlideRequest.
private GlideRequest buildThumbnailGlideRequest(@NonNull GlideRequests glideRequests, @NonNull Slide slide) {
GlideRequest request = applySizing(glideRequests.load(new DecryptableUri(slide.getUri())).diskCacheStrategy(DiskCacheStrategy.RESOURCE).transition(withCrossFade()), fit);
boolean doNotShowMissingThumbnailImage = Build.VERSION.SDK_INT < 23;
if (slide.isInProgress() || doNotShowMissingThumbnailImage)
return request;
else
return request.apply(RequestOptions.errorOf(R.drawable.ic_missing_thumbnail_picture));
}
Aggregations