本文整理匯總了Java中org.telegram.ui.Components.URLSpanNoUnderlineBold類的典型用法代碼示例。如果您正苦於以下問題:Java URLSpanNoUnderlineBold類的具體用法?Java URLSpanNoUnderlineBold怎麽用?Java URLSpanNoUnderlineBold使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
URLSpanNoUnderlineBold類屬於org.telegram.ui.Components包,在下文中一共展示了URLSpanNoUnderlineBold類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: replaceWithLink
import org.telegram.ui.Components.URLSpanNoUnderlineBold; //導入依賴的package包/類
public CharSequence replaceWithLink(CharSequence source, String param, ArrayList<Integer> uids, AbstractMap<Integer, TLRPC.User> usersDict) {
int start = TextUtils.indexOf(source, param);
if (start >= 0) {
SpannableStringBuilder names = new SpannableStringBuilder("");
for (int a = 0; a < uids.size(); a++) {
TLRPC.User user = null;
if (usersDict != null) {
user = usersDict.get(uids.get(a));
}
if (user == null) {
user = MessagesController.getInstance().getUser(uids.get(a));
}
if (user != null) {
String name = UserObject.getUserName(user);
start = names.length();
if (names.length() != 0) {
names.append(", ");
}
names.append(name);
names.setSpan(new URLSpanNoUnderlineBold("" + user.id), start, start + name.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
return TextUtils.replace(source, new String[]{param}, new CharSequence[]{names});
}
return source;
}