-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
How to inject BootstrapLabel inside TextView? #189
Comments
I'm looking on https://github.com/binaryfork/Spanny at the moment. |
Is it possible to just use the newline character? BootstrapLabel ultimately extends from TextView, and TextView definitely supports this |
I forgot to add clarification: [#hashtag] - it's BootstrapLabel. So whole text But I cannot insert BootstrapLabel as content of TextView, because BootstrapLabel is not Spannable. |
In Spanny (https://github.com/binaryfork/Spanny) take a look on CustomBackgroundSpan. |
I ended up with my own impl Span (like CustomBackgroundSpan) which uses BootstrapBrand styling. |
FYI BootstrapText extends SpannableString, so that might help achieve the same effect? |
I found two solutions: Solution I:
Solution II
|
Solution 2 is based on ReplacementSpan. It's good in all cases becuase provides full controll over drawing and measing the size of span. But I faced later with strange bug: Solution 1 is based on LineBackgroundSpan which created to write background. I choose solution 1 temporarily, because I dont like solutions, where I cannot explain something, even if there is a workaround. |
Is this possible at all?
Use case:
I need next content to be inserted as text content of text view:
[#hashtag] blah blah blah....
second line, blah blah... <-- second line is inside the same textView (text view is multilined)
The text was updated successfully, but these errors were encountered: