Search in sources :

Example 1 with CenterInside

use of com.bumptech.glide.load.resource.bitmap.CenterInside in project Signal-Android by WhisperSystems.

the class BorderlessImageView method setSlide.

public void setSlide(@NonNull GlideRequests glideRequests, @NonNull Slide slide) {
    boolean showControls = slide.asAttachment().getUri() == null;
    if (slide.hasSticker()) {
        image.setFit(new CenterInside());
        image.setImageResource(glideRequests, slide, showControls, false);
    } else {
        image.setFit(new CenterCrop());
        image.setImageResource(glideRequests, slide, showControls, false, slide.asAttachment().getWidth(), slide.asAttachment().getHeight());
    }
    missingShade.setVisibility(showControls ? View.VISIBLE : View.GONE);
}
Also used : CenterCrop(com.bumptech.glide.load.resource.bitmap.CenterCrop) CenterInside(com.bumptech.glide.load.resource.bitmap.CenterInside)

Example 2 with CenterInside

use of com.bumptech.glide.load.resource.bitmap.CenterInside in project Signal-Android by signalapp.

the class BorderlessImageView method setSlide.

public void setSlide(@NonNull GlideRequests glideRequests, @NonNull Slide slide) {
    boolean showControls = slide.asAttachment().getUri() == null;
    if (slide.hasSticker()) {
        image.setFit(new CenterInside());
        image.setImageResource(glideRequests, slide, showControls, false);
    } else {
        image.setFit(new CenterCrop());
        image.setImageResource(glideRequests, slide, showControls, false, slide.asAttachment().getWidth(), slide.asAttachment().getHeight());
    }
    missingShade.setVisibility(showControls ? View.VISIBLE : View.GONE);
}
Also used : CenterCrop(com.bumptech.glide.load.resource.bitmap.CenterCrop) CenterInside(com.bumptech.glide.load.resource.bitmap.CenterInside)

Aggregations

CenterCrop (com.bumptech.glide.load.resource.bitmap.CenterCrop)2 CenterInside (com.bumptech.glide.load.resource.bitmap.CenterInside)2