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
Problem with Spannable #277
Comments
@carmas123 please use hte built in functionality to color icons: |
I try it but also does not work |
@carmas123 can you please show what you tried? Because in the sample it is working fine |
Ok but I use Kotlin and not Java...
The textview is always empty |
@carmas123 shouldn't change much. The textview is always empty? the code you posted will only adjust the color of the icon if it was set. So if no text is set, it makes sense that it stays empty :D |
This is the result I try also with this:
|
Do you have any other spannables or fonts or so set manually? Anything which might break the icon? any log output saying that the icon does not exist or so? is it working without any color change or so? |
Yes it work.without spannable |
you mean without this: val spannable = SpannableString("{gmi-pin} my text bla bla bla") ? |
@carmas123 so why do you want this |
I need to highlight the Icon into TextView with another color |
@carmas123 for this there is: Iconics.IconicsBuilder().ctx(activity)
.style(ForegroundColorSpan(Color.RED), BackgroundColorSpan(Color.RED), RelativeSizeSpan(2f))
.styleFor("gmi-pin", BackgroundColorSpan(Color.RED), ForegroundColorSpan(Color.parseColor("#33000000")), RelativeSizeSpan(2f))
.on(b.textView)
.build() and the best would anyways to set the |
Yes but the text into TextView need to have {gmi-pin} or not? |
@carmas123 if you set it as compound drawable not. |
@carmas123 and then you set the icon via the |
mmm |
It's work but with this I cannot use the com.mikepenz.iconics.view.IconicsTextView with all functionality :( |
@carmas123 well using the android iconics as Drawable via the |
I would suggest that this be mentioned in the README, as the gimicky solution is currently featured prominently and gives the impression that it is the recommended way to use the library. An example in the README of how to use setCompoundDrawables would be great too. |
I try to use IconicsTextView with this:
but the Magenta Color does not appear.
If I change the TextView color for all text without spannable it work.
The text was updated successfully, but these errors were encountered: