use glide,RoundedImageView no effect
Cangol opened this issue · 5 comments
Cangol commented
use glide,RoundedImageView no effect
mitakaniad commented
same problem here.
troy379 commented
try to add asBitmap()
chain, like below
.load(src)
.asBitmap()
.into(imageView) ```
clunyes commented
yes,resolved
KhalidElSayed commented
Doesn't work here, even I use .asBitmap()
chain. below is the code snippet for loading an image that should be rounded and using crossfade animation:
Note: i'm using Glide 4
Glide.with(mContext)
.asBitmap()
.load(/* some image url */)
.apply(new RequestOptions()
.bitmapTransform(new CenterCrop())
.placeholder(R.drawable.img_book_placeholder)
.error(R.drawable.img_book_placeholder)
)
.transition(BitmapTransitionOptions.withCrossFade())
.into(holder.imgBook);
Rhtyme commented
I was able to do that by wrapping out the image with some layout and setting a padding (something like 1dp) into layout, then setting the following shape as a background:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/inbox_item_background_radius" />
<stroke android:width="@dimen/inbox_item_background_stroke_width" android:color="@color/back_shadow_color"/>
</shape>