Closed cesards closed 7 years ago
Did you set
setLinkColor(Color.BLUE)
setLinkUnderline(false)
in RxMDConfiguration.Builder
?
Yep. Nothing happens:
RxMDConfiguration rxMDConfiguration = new RxMDConfiguration.Builder(this)
.setLinkColor(Color.RED)//default color of link text
.setLinkUnderline(false)//default value of whether displays link underline
.build();
RxMarkdown.with(newsItemUI.getText(), this)
.config(rxMDConfiguration)
.factory(TextFactory.create())
.intoObservable()
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<CharSequence>() {
@Override
public void onCompleted() { }
@Override
public void onError(Throwable e) { }
@Override
public void onNext(CharSequence charSequence) {
view.text.setText(charSequence, TextView.BufferType.SPANNABLE);
}
});
where newsItemUI.getText()
is:
[PLEASEEEEEE](http://deathstar-qa.herokuapp.com/)
and the output of onNext
is:
PLEASEEEEEE
@cesards Can you attached your xml file and class of your view?
I found the problem!
The problem is related to the flag:
android:autoLink="web"
because the TextView removes all the Spans, I guess, and it creates its own.
You should mention that in the documentation. Thank you so much, guys!
If we got:
It's not printing the url span properly, it just prints the text.
I've checked the code, and also I've been retrieving the spans, and it seems the span is there
URLSpan[] spans = stringBuilder.getSpans(0, charSequence.length(), URLSpan.class);
but it's not being drawn properly: