Small improvement

This commit is contained in:
M66B 2022-01-02 15:44:33 +01:00
parent 4fd22ca4d6
commit 6f11c86b56
2 changed files with 4 additions and 6 deletions

View File

@ -125,7 +125,7 @@ public class EditTextCompose extends FixedEditText {
String html = HtmlHelper.toHtml((Spanned) selected, context);
cbm.setPrimaryClip(ClipData.newHtmlText(context.getString(R.string.app_name), selected, html));
setSelection(end);
return false;
return true;
}
}
} else if (id == android.R.id.paste) {

View File

@ -392,11 +392,9 @@ public class FixedTextView extends AppCompatTextView {
if (selected instanceof Spanned) {
String html = HtmlHelper.toHtml((Spanned) selected, context);
cbm.setPrimaryClip(ClipData.newHtmlText(context.getString(R.string.app_name), selected, html));
if (getText() instanceof Spannable) {
Selection.removeSelection((Spannable) getText());
return true;
} else
return false;
if (getText() instanceof Spannable)
Selection.setSelection((Spannable) getText(), end);
return true;
}
}
}