glide-transformations icon indicating copy to clipboard operation
glide-transformations copied to clipboard

RoundedCornersTransformation not working in Adapter with CenterCrop

Open RaymanMartin opened this issue 6 years ago • 8 comments

I try to use RoundedCornersTransformation to cut the bitmap in Adapter. But its not working good with Glide CenterCrop. and i also saw some issue like this. then i change the usage like this.but it's also not good working

heres the code i used in Adapter Glide.with(mContext) .load(avatar) .placeholder(R.drawable.ic_user_default_avatar) .error(R.drawable.ic_user_default_avatar) .transform(new CenterCrop(mContext), new RoundedCornersTransformation(mContext, 4, 0)) .into(ivAvatar);

btw.why the newest dependency library is use Glide 4.x , those i copy the RoundedCornersTransformation source code to my project.

My situation is: while i remove the RoundedCornersTransformation. The CenterCrop is work good. while i remove the CenterCrop.but the RoundedCornersTransformation is still not working.

Is there's some solutions to fix this problem?

RaymanMartin avatar Feb 27 '19 06:02 RaymanMartin

I just have the same problem after moving to AndroidX. Currently using these versions: glide 4.9.0 glide-transformations 4.0.1

joernahrens avatar Feb 28 '19 10:02 joernahrens

i am facing the same problem

tranquoctrungcntt avatar Mar 03 '19 14:03 tranquoctrungcntt

anyone who is facing the same problem, please vote for @RaymanMartin.

tranquoctrungcntt avatar Mar 03 '19 15:03 tranquoctrungcntt

i am facing the same problem

M2dL1fe avatar Jun 11 '19 09:06 M2dL1fe

i am facing the same problem too.

iamnicholasyeung avatar Jul 15 '19 09:07 iamnicholasyeung

i am facing the same problem too.

RoundedCornersTransformation extends BitmapTransformation ,in glide4.9,BitmapTransformation remove context in constructor. I copy and modify RoundedCornersTransformation constructor. it is normal, transform(new CenterCrop(),new RoundedCornersTransformation (5, 0, RoundedCornersTransformation .CornerType.LEFT)).

etenel avatar Aug 08 '19 02:08 etenel

GlideApp .with(context) .load(url) .transform(new CenterCrop(), new RoundedCornersTransformation(6, 0)) .into(iv);

yuzhentao avatar Dec 19 '19 01:12 yuzhentao

 RequestOptions options = new RequestOptions().transform(new MultiTransformation<>(new CenterCrop(),
                new RoundedCornersTransformation(DisplayUtils.dp2px(10), 0)));
            Glide.with(context).load(url).apply(options).into(imageView);

AndSync avatar Jul 07 '20 06:07 AndSync