use of org.telegram.ui.Components.URLSpanNoUnderline in project Telegram-FOSS by Telegram-FOSS-Team.
the class SettingsSuggestionCell method setType.
public void setType(int type) {
currentType = type;
if (type == TYPE_PHONE) {
final TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(UserConfig.getInstance(currentAccount).clientUserId);
textView.setText(LocaleController.formatString("CheckPhoneNumber", R.string.CheckPhoneNumber, PhoneFormat.getInstance().format("+" + user.phone)));
String text = LocaleController.getString("CheckPhoneNumberInfo", R.string.CheckPhoneNumberInfo);
SpannableStringBuilder builder = new SpannableStringBuilder(text);
int index1 = text.indexOf("**");
int index2 = text.lastIndexOf("**");
if (index1 >= 0 && index2 >= 0 && index1 != index2) {
builder.replace(index2, index2 + 2, "");
builder.replace(index1, index1 + 2, "");
try {
builder.setSpan(new URLSpanNoUnderline(LocaleController.getString("CheckPhoneNumberLearnMoreUrl", R.string.CheckPhoneNumberLearnMoreUrl)), index1, index2 - 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} catch (Exception e) {
FileLog.e(e);
}
}
detailTextView.setText(builder);
yesButton.setText(LocaleController.getString("CheckPhoneNumberYes", R.string.CheckPhoneNumberYes));
noButton.setText(LocaleController.getString("CheckPhoneNumberNo", R.string.CheckPhoneNumberNo));
} else if (type == TYPE_PASSWORD) {
textView.setText(LocaleController.getString("YourPasswordHeader", R.string.YourPasswordHeader));
detailTextView.setText(LocaleController.getString("YourPasswordRemember", R.string.YourPasswordRemember));
yesButton.setText(LocaleController.getString("YourPasswordRememberYes", R.string.YourPasswordRememberYes));
noButton.setText(LocaleController.getString("YourPasswordRememberNo", R.string.YourPasswordRememberNo));
}
}
Aggregations