textDrawable #136

Merged
AmineB merged 8 commits from davidoskky/ReaderForSelfoss-multiplatform:textDrawable into master 2023-03-26 11:12:03 +00:00
Showing only changes of commit 452d13c48c - Show all commits

View File

@ -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)