Refactoring

pull/194/merge
M66B 4 years ago
parent b93263f000
commit f2b08b338b

@ -376,6 +376,9 @@ public class FixedTextView extends AppCompatTextView {
public boolean onTextContextMenuItem(int id) {
try {
if (id == android.R.id.copy) {
Context context = getContext();
ClipboardManager cbm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
int start = getSelectionStart();
int end = getSelectionEnd();
if (start > end) {
@ -384,8 +387,6 @@ public class FixedTextView extends AppCompatTextView {
end = s;
}
Context context = getContext();
ClipboardManager cbm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
if (start != end && cbm != null) {
CharSequence selected = getText().subSequence(start, end);
if (selected instanceof Spanned) {

Loading…
Cancel
Save