question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RoundedCornersTransformation not working in Adapter with CenterCrop

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:13
  • Comments:8

github_iconTop GitHub Comments

3reactions
yuzhentaocommented, Dec 19, 2019

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

2reactions
etenelcommented, Aug 8, 2019

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)).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Glide RoundedCornersTransformation not making any ...
Using centerCrop in the scaleType attribute of the XML does not work with the Glide library transformations. Share.
Read more >
Java Examples for com.bumptech.glide.load.resource.bitmap ...
This java examples will help you to understand the usage of com.bumptech.glide.load.resource.bitmap.CenterCrop. These source code samples are taken from ...
Read more >
Displaying Images with the Picasso Library
This is quite common and means that you are loading one or more large images that have not been properly resized. First, you...
Read more >
com.bumptech.glide.DrawableRequestBuilder.override java ...
TopNewsAdapter.bindViewHolderNormal(...) .centerCrop().override(mImageViewWidth, mImageViewHeight) .into(new DribbbleTarget(holder.imageView, false));.
Read more >
Glide - Different Rounded Corners In Recyclerview - ADocLib
Calculating fuel tank siphon problem or found flow will also collect the rent! ... tags: android development code centerCrop rounded image ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found