glide rounded corner transform issue

I had the same issue, the problem in my case was the image what i’ve tried to load had less size in pixels (320×480), then the ImageView size in pixels.
My solution was the following:

My ImageView in the xml file:

    <ImageView
    android:id="@+id/image_program_thumb"
    android:layout_width="match_parent"
    android:layout_height="186dp" />

ProgramViewHolder.java class

@BindView(R.id.image_program_thumb) ImageView mProgramThumbnail;
.....
void bindData(final Program item) {
    RequestOptions requestOptions = new RequestOptions();
    requestOptions = requestOptions.transforms(new CenterCrop(), new RoundedCorners(16));
    Glide.with(itemView.getContext())
            .load(item.getImage())
            .apply(requestOptions)
            .into(mProgramThumbnail);
....

}

P.S. I use 4.2.0 version of Glide

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)