diff --git a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt index fd2862f5f0..14aa617a4e 100644 --- a/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt +++ b/vector/src/main/java/im/vector/app/features/home/AvatarRenderer.kt @@ -16,6 +16,7 @@ package im.vector.app.features.home +import android.content.Context import android.graphics.Bitmap import android.graphics.drawable.Drawable import android.net.Uri @@ -73,6 +74,15 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active ) } + @UiThread + fun render(matrixItem: MatrixItem, context: Context, imageView: ImageView) { + render( + GlideApp.with(context), + matrixItem, + DrawableImageViewTarget(imageView) + ) + } + // fun renderSpace(matrixItem: MatrixItem, imageView: ImageView) { // renderSpace( // matrixItem, diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index cfcbdd65ae..aac67470b1 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -391,7 +391,7 @@ class HomeDetailFragment @Inject constructor( views.groupToolbarSpaceTitleView.text = spaceSummary.displayName views.groupToolbarTitleView.text = spaceSummary.displayName views.spaceAvatar.isVisible = true - avatarRenderer.render(spaceSummary.toMatrixItem(), views.spaceAvatar) + avatarRenderer.render(spaceSummary.toMatrixItem(), requireContext(), views.spaceAvatar) ImageViewCompat.setImageTintList(views.toolbarChevron, ColorStateList.valueOf(MaterialColors.getColor(views.toolbarChevron, R.attr.vctr_message_text_color))) spaceSummary.spaceParents?.firstOrNull()?.let { directParent ->