Small improvement

pull/194/merge
M66B 4 years ago
parent 4fd22ca4d6
commit 6f11c86b56

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

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

Loading…
Cancel
Save