[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Make another CircleImageView extending AppCompatImageView #105

Closed
hanggrian opened this issue Feb 1, 2016 · 8 comments
Closed

Comments

@hanggrian
Copy link

android:tint isn't working in xml, crashes the app. I suppose this is achievable using AppCompatImageView

@Wicowyn
Copy link
Wicowyn commented Feb 4, 2016

It's work only on Android 5.0 and after. Before 5.0 we get a crash during inflate :

Caused by: java.lang.NullPointerException
at de.hdodenhof.circleimageview.CircleImageView.setColorFilter(CircleImageView.java:249)
at android.widget.ImageView.setColorFilter(ImageView.java:1111)
at android.widget.ImageView.setColorFilter(ImageView.java:1123)
at android.widget.ImageView.<init>(ImageView.java:157)
at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:88)
at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:84)

(with v2.0.0 release)

After debuging it appear that all mBitmapPaint, mBorderPaint, mFillPaint, mDrawableRect, mBorderRect, mShaderMatrix are null, whereas they are all initialized and not modifiable.

How is this possible ?

@colinrtwhite
Copy link

+1 Tint isn't applied to images. Tested on Nexus 5, 6.0.1.

@hdodenhof
Copy link
Owner

The NPE is fixed, thanks to @colinrtwhite.

I'm not gonna make CirlcleImageView extend AppCompatImageView and with that depend on the appcompat library though, as that would needlessly bloat this library.

@colinrtwhite
Copy link

Good point - I didn't think about the bloat. However, does that mean image tint on pre-Lollipop will not work? Also, when do you plan to make the next release? Thanks.

@hdodenhof
Copy link
Owner

android:tint won't work but you can achieve a similar result using setColorFilter(). There are no plans for the next release yet, as the only change so far is the non-critical NPE-fix.

@mingchen
Copy link
mingchen commented May 8, 2016

Could you release include this fix ?

@jy617lee
Copy link
jy617lee commented Jul 8, 2016

as above talks, image tint on after-Lollipop should work. However it doesn't work on android-m... tint attribute is included in not only AppCompatImageView but also ImageView. Why is this? Please have an answer.

@hdodenhof
Copy link
Owner

@jy617lee you misread that, tint is not supported at all.

hdodenhof added a commit that referenced this issue Jan 1, 2020
This fixes a regression introduced with 528125c.
Add comment to make sure the check stays this time. See #326 and #105.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants