AlignTextView
AlignTextView copied to clipboard
可以支持富文本
在process(boolean setText)方法中的settext之前处理newText,例如 SpannableString spannableString = new SpannableString(newText); int a = newText.toString().indexOf(data); Log.e(TAG, "a=" + a); while (a != -1) { ForegroundColorSpan colorSpan = new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.colorAccent)); spannableString.setSpan(colorSpan, a, data.length() + a, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); a = newText.toString().indexOf(data, a + 1); Log.e(TAG, "a=" + a); } setText(spannableString);