fixing wrong shortcut icon size and ensuring the transformed files are stored with unique keys
This commit is contained in:
parent
5bbb3f28b1
commit
506690a897
|
@ -31,7 +31,7 @@ class AdaptiveIconTransformation(private val adaptiveIconSize: Int, private val
|
|||
|
||||
override fun updateDiskCacheKey(messageDigest: MessageDigest) {
|
||||
messageDigest.update(ID_BYTES)
|
||||
messageDigest.update(ByteBuffer.allocate(4).putInt(adaptiveIconSize).putFloat(adaptiveIconOuterSides).array())
|
||||
messageDigest.update(ByteBuffer.allocate(8).putInt(adaptiveIconSize).putFloat(adaptiveIconOuterSides).array())
|
||||
}
|
||||
|
||||
override fun transform(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap {
|
||||
|
|
|
@ -33,6 +33,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
|||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.bumptech.glide.request.target.DrawableImageViewTarget
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.bumptech.glide.signature.ObjectKey
|
||||
import im.vector.app.core.contacts.MappedContact
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.glide.AvatarPlaceholder
|
||||
|
@ -171,8 +172,9 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active
|
|||
.asBitmap()
|
||||
.avatarOrText(matrixItem, iconSize)
|
||||
.transform(CenterCrop(), AdaptiveIconTransformation(adaptiveIconSize, adaptiveIconOuterSides))
|
||||
.signature(ObjectKey("adaptive-icon"))
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
.submit(adaptiveIconSize, adaptiveIconSize)
|
||||
.submit(iconSize, iconSize)
|
||||
.get()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue