vinc3m1 / RoundedImageView

A fast ImageView that supports rounded corners, ovals, and circles.
Other
6.44k stars 1.25k forks source link

How can I display a gif??? #252

Closed Power-Android closed 4 years ago

Power-Android commented 4 years ago

Glide.with(this).load(url).into(imageview); can work Glide.with(this).load(url).into(roundImageview); not work How can I display a gif???

vinc3m1 commented 4 years ago

as noted in the readme: Glide transforms are not supported, please use wasabeef/glide-transformations if you want to round images loaded from Glide.

rovkinmax commented 4 years ago

@Power-Android Just use usual ImageView with outline bounds For example,

fun View.setRoundedCorners(@Px radius: Float) {
    clipToOutline = true
    outlineProvider = object : ViewOutlineProvider() {
        override fun getOutline(view: View, outline: Outline) {
            val selfRect = Rect(0, 0, view.width, view.height)
            outline.setRoundRect(selfRect, radius)
        }
    }
}