You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
I have a simple cardview that contains a htmltextview. But upon compiling, I'm not able to click the cardview and the htmltextview is in focus instead. I tried defining the htmltextview as not clickable or focusable, but to no success. Is there a way to click a cardview that contains the htmltextview? (htmltextview matches cardviews width and height).
I have the same problem. It's due to setMovementMethod(..) being called in setHtml(..) in source code. If I got it right this call makes every HtmlTextView you use clickable by default therefore makes it intercept click events.
public void setHtml(@NonNull String html, @Nullable Html.ImageGetter imageGetter) {
final HtmlTagHandler htmlTagHandler = new HtmlTagHandler(getPaint());
htmlTagHandler.setClickableTableSpan(clickableTableSpan);
htmlTagHandler.setDrawTableLinkSpan(drawTableLinkSpan);
htmlTagHandler.setListIndentPx(indent);
html = htmlTagHandler.overrideTags(html);
if (removeTrailingWhiteSpace) {
setText(removeHtmlBottomPadding(Html.fromHtml(html, imageGetter, htmlTagHandler)));
} else {
setText(Html.fromHtml(html, imageGetter, htmlTagHandler));
}
// make links work
setMovementMethod(LocalLinkMovementMethod.getInstance());
}
Solution was to use setMovementMethod(null); after setHtml().
I have a simple cardview that contains a htmltextview. But upon compiling, I'm not able to click the cardview and the htmltextview is in focus instead. I tried defining the htmltextview as not clickable or focusable, but to no success. Is there a way to click a cardview that contains the htmltextview? (htmltextview matches cardviews width and height).
The text was updated successfully, but these errors were encountered: