mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +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 url = (String) args[0];
|
||||||
String title = (String) args[1];
|
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);
|
URLSpan[] spans = edit.getSpans(start, end, URLSpan.class);
|
||||||
for (URLSpan span : spans)
|
for (URLSpan span : spans)
|
||||||
edit.removeSpan(span);
|
edit.removeSpan(span);
|
||||||
|
|
||||||
if (start == end)
|
if (!TextUtils.isEmpty(url)) {
|
||||||
edit.insert(start, title);
|
if (TextUtils.isEmpty(title))
|
||||||
else if (!title.equals(edit.subSequence(start, end).toString()))
|
title = url;
|
||||||
edit.replace(start, end, title);
|
|
||||||
|
|
||||||
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.setText(edit);
|
||||||
etBody.setSelection(start + title.length());
|
etBody.setSelection(start + title.length());
|
||||||
|
|
Loading…
Reference in a new issue