|
|
|
@ -5,12 +5,12 @@ package com.keylesspalace.tusky.util |
|
|
|
|
import android.widget.ImageView |
|
|
|
|
import androidx.annotation.Px |
|
|
|
|
import com.bumptech.glide.Glide |
|
|
|
|
import com.bumptech.glide.load.resource.bitmap.FitCenter |
|
|
|
|
import com.bumptech.glide.load.resource.bitmap.CenterCrop |
|
|
|
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners |
|
|
|
|
import com.keylesspalace.tusky.R |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private val fitCenterTransformation = FitCenter() |
|
|
|
|
private val centerCropTransformation = CenterCrop() |
|
|
|
|
|
|
|
|
|
fun loadAvatar(url: String?, imageView: ImageView, @Px radius: Int, animate: Boolean) { |
|
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ fun loadAvatar(url: String?, imageView: ImageView, @Px radius: Int, animate: Boo |
|
|
|
|
Glide.with(imageView) |
|
|
|
|
.load(url) |
|
|
|
|
.transform( |
|
|
|
|
fitCenterTransformation, |
|
|
|
|
centerCropTransformation, |
|
|
|
|
RoundedCorners(radius) |
|
|
|
|
) |
|
|
|
|
.placeholder(R.drawable.avatar_default) |
|
|
|
@ -34,7 +34,7 @@ fun loadAvatar(url: String?, imageView: ImageView, @Px radius: Int, animate: Boo |
|
|
|
|
.asBitmap() |
|
|
|
|
.load(url) |
|
|
|
|
.transform( |
|
|
|
|
fitCenterTransformation, |
|
|
|
|
centerCropTransformation, |
|
|
|
|
RoundedCorners(radius) |
|
|
|
|
) |
|
|
|
|
.placeholder(R.drawable.avatar_default) |
|
|
|
|