From 452d13c48cb15c712e860d98e7c7a09fcde490c1 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Sat, 25 Mar 2023 16:31:01 +0100 Subject: [PATCH] Operate glide on the circular image view --- .../readerforselfossv2/android/utils/glide/GlideUtils.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/glide/GlideUtils.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/glide/GlideUtils.kt index 5d91e62..979daf7 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/glide/GlideUtils.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/utils/glide/GlideUtils.kt @@ -4,6 +4,7 @@ import android.content.Context import android.graphics.Bitmap import android.widget.ImageView import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory +import bou.amine.apps.readerforselfossv2.android.utils.CircleImageView import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.BitmapImageViewTarget @@ -34,6 +35,14 @@ fun Context.circularBitmapDrawable(url: String, iv: ImageView) = } }) +fun Context.circularDrawable(url: String, view: CircleImageView) { + view.textView.text ="" + + Glide.with(this) + .load(url) + .into(view.imageView) +} + fun getBitmapInputStream(bitmap:Bitmap,compressFormat: Bitmap.CompressFormat): InputStream { val byteArrayOutputStream = ByteArrayOutputStream() bitmap.compress(compressFormat, 80, byteArrayOutputStream)