mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Fixed reset link
This commit is contained in:
parent
1f4590d60b
commit
cac373e372
1 changed files with 10 additions and 10 deletions
|
@ -715,21 +715,21 @@ public class StyleHelper {
|
|||
String url = (String) args[0];
|
||||
String title = (String) args[1];
|
||||
|
||||
if (TextUtils.isEmpty(url))
|
||||
return false;
|
||||
if (TextUtils.isEmpty(title))
|
||||
title = url;
|
||||
|
||||
URLSpan[] spans = edit.getSpans(start, end, URLSpan.class);
|
||||
for (URLSpan span : spans)
|
||||
edit.removeSpan(span);
|
||||
|
||||
if (start == end)
|
||||
edit.insert(start, title);
|
||||
else if (!title.equals(edit.subSequence(start, end).toString()))
|
||||
edit.replace(start, end, title);
|
||||
if (!TextUtils.isEmpty(url)) {
|
||||
if (TextUtils.isEmpty(title))
|
||||
title = url;
|
||||
|
||||
edit.setSpan(new URLSpan(url), start, start + title.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
if (start == end)
|
||||
edit.insert(start, title);
|
||||
else if (!title.equals(edit.subSequence(start, end).toString()))
|
||||
edit.replace(start, end, title);
|
||||
|
||||
edit.setSpan(new URLSpan(url), start, start + title.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
|
||||
etBody.setText(edit);
|
||||
etBody.setSelection(start + title.length());
|
||||
|
|
Loading…
Reference in a new issue