Similar to WeChat Moments Reply function

The layout of the reply list is a simple TextView

Judging whether to reply or directly comment on the change of font color by data In addition to SpannableString (not applicable to lists), there is also a Html.forHtml method to achieve.

String itemName = "回复 " + "<font color='#4C9CDE'>" + comments.getParent().getName() + "</font>"  + " " + comments.getContent();

 

vh.tv_content.setText(Html.fromHtml(itemName));

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326991282&siteId=291194637