siyamed / android-shape-imageview

Custom shaped android imageview components
MIT License
2.66k stars 599 forks source link

use glide,RoundedImageView no effect #67

Open Cangol opened 7 years ago

Cangol commented 7 years ago

use glide,RoundedImageView no effect

mitakaniad commented 7 years ago

same problem here.

troy379 commented 7 years ago

try to add asBitmap() chain, like below


    .load(src)
    .asBitmap()
    .into(imageView) ```
clunyes commented 7 years ago

yes,resolved

KhalidElSayed commented 7 years ago

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 5 years ago

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>