Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SES-337] Add rounded corners to thumbnail in QuoteView #1285

Merged
merged 8 commits into from
Jun 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ open class ThumbnailView: FrameLayout {

val dimens = dimensDelegate.resourceSize()

val request = glide.load(DecryptableUri(slide.thumbnailUri!!))
var request = glide.load(DecryptableUri(slide.thumbnailUri!!))
.diskCacheStrategy(DiskCacheStrategy.NONE)
.let { request ->
if (dimens[WIDTH] == 0 || dimens[HEIGHT] == 0) {
Expand All @@ -150,7 +150,12 @@ open class ThumbnailView: FrameLayout {
}
}
.transition(DrawableTransitionOptions.withCrossFade())
.centerCrop()

request = if (radius > 0) {
bemusementpark marked this conversation as resolved.
Show resolved Hide resolved
request.transforms(CenterCrop(), RoundedCorners(radius))
} else {
request.transforms(CenterCrop())
}

return if (slide.isInProgress) request else request.apply(RequestOptions.errorOf(R.drawable.ic_missing_thumbnail_picture))
}
Expand Down