hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
http://hanggrian.com/socialview/
Apache License 2.0
324 stars 81 forks source link

Crash on color set #19

Closed CripyIce closed 7 years ago

CripyIce commented 7 years ago

Hi there, Since your latest update i get a crash on setting mention/hashtag/hyperlink colors, For example: commercialContentTextView.setMentionColor(Color.BLACK); also on this: commercialContentTextView.setMentionColor(Color.parseColor("#000000"));

the error i'm getting is: android.content.res.Resources$NotFoundException: Resource ID #0xff000000 at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:195) at android.content.res.Resources.getColor(Resources.java:949) at android.content.Context.getColor(Context.java:588) at android.support.v4.content.ContextCompat.getColor(ContextCompat.java:409) at com.hendraanggrian.socialview.SocialView$DefaultImpls.setMentionColor(SocialView.kt:129) at com.hendraanggrian.widget.SocialTextView.setMentionColor(SocialTextView.kt:12)

Would be happy to get your attention as always :)

hanggrian commented 7 years ago

I can't remember why, but I start keeping those colors as ColorStateList instead of color integers, which may have caused this issue. I guess I haven't been thorough in testing it, that's why these error reports are crucial in its development, and I thank you for it. Version 0.16.3 should fix this issue.

CripyIce commented 7 years ago

@HendraAnggrian thanks for the quick reply and fix! But i'm not sure if i'm doing something wrong, but i cannot sync gradle now with version 0.16.3.

image

CripyIce commented 7 years ago

Hi @HendraAnggrian, my mistake! Now works perfect! sorry for that.