Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

RoundedImageView appearing with black border since 2.1.0 #115

Closed
dlew opened this issue Jul 28, 2015 · 7 comments
Closed

RoundedImageView appearing with black border since 2.1.0 #115

dlew opened this issue Jul 28, 2015 · 7 comments

Comments

@dlew
Copy link
Contributor

dlew commented Jul 28, 2015

Since updating to 2.1.0+, we've noticed black borders being drawn on RoundedImageView:

We're recycling the RoundedImageView; the differences are either calling setOval() with true/false, and loading different images w/ Picasso.

Going back to 2.0.1 fixes the problem:

Since we don't need the capabilities of 2.1.0+, we've just reverted to 2.0.1 as a solution. As a result I haven't dug too deeply into what's going on.

@vinc3m1
Copy link
Owner

vinc3m1 commented Jul 28, 2015

Huh, very interesting... will look into it

@vinc3m1
Copy link
Owner

vinc3m1 commented Aug 2, 2015

Can't seem to reproduce this, mind digging deeper when you get a chance? Also if you're using Picasso are you using the TransformationBuilder?

@dlew
Copy link
Contributor Author

dlew commented Aug 2, 2015

I'll see if I can find time this week to dig into it.

I'm not using TransformationBuilder, but I'm also not using Transformations so that shouldn't be the issue.

@dlew
Copy link
Contributor Author

dlew commented Aug 3, 2015

I haven't dug into why it's happening but it's incredibly easy to reproduce. I was able to do it with a single simple Activity using this layout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:background="@android:color/white"
  >

  <com.makeramen.roundedimageview.RoundedImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:src="@drawable/ic_launcher"
    />

</FrameLayout>

The layout results in this image (tested on 4.4.4 and 5.1.1).

If you want I can upload the whole project but that's basically all of it.

@vinc3m1
Copy link
Owner

vinc3m1 commented Aug 4, 2015

No need for a project, seems simple enough. Thanks! Also just in case, what
API are you targeting and running on?

On Mon, Aug 3, 2015 at 7:06 AM Daniel Lew notifications@github.com wrote:

I haven't dug into why it's happening but it's incredibly easy to
reproduce. I was able to do it with a single simple Activity using this
layout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"

<com.makeramen.roundedimageview.RoundedImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_launcher"
/>

If you want I can upload the whole project but that's basically all of it.


Reply to this email directly or view it on GitHub
#115 (comment)
.

@dlew
Copy link
Contributor Author

dlew commented Aug 4, 2015

Targeting 22, running on 4.4.4 and 5.1.1.

@paetztm
Copy link

paetztm commented Aug 9, 2015

Looks like on line 307 of RoundedDrawable you need:

if (mBorderWidth > 0) {
    canvas.drawRect(mBorderRect, mBorderPaint);
}

Not sure if that's the only place but that fixes the issue for me.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants