Closed andresgr closed 9 years ago
i think, TextViewEx lost spannable style, because it is working only with String (not Charsequence or child).
So, is there a way to apply the justifying algorithm to a CharSequence, avoiding the lost of the spannable styles?
Can you explain a bit about how Spannables are encoded?
i think, you have to replace String with Charsequence in the source, but you will have some problems. for example: Chasequence hasn't split function, you have to write your split function for Charsequnce, etc...
Any news about this issue ? I think it is a very useful feature since this library is mainly used for news or chat I think and in these use case text is often formatted ("bold", "italic", color ..)
Check out the experimental version. It is currently a work in progress, but it should provide you with Spannable support. Refer to README.md
Refer to updated version. It has been fixed along with major optimizations.
This is still not working for me how do I change the background of the DocumentView?
Given the following program:
TextViewEx textView = (TextViewEx) findViewById(R.id.textView1); textView.setText("", true); Spannable span = Spannable.Factory.getInstance().newSpannable("Hello "); span.setSpan(new ForegroundColorSpan(Color.RED), 0, span.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); span = Spannable.Factory.getInstance().newSpannable(" world!"); span.setSpan(new ForegroundColorSpan(Color.GREEN), 0, span.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
The output text is printed without any red or green color. Is there any way to solve the justifying of a TextViewEx with different styles?