Simplification

pull/194/merge
M66B 3 years ago
parent 9b89d21010
commit 7f2661502b

@ -163,27 +163,11 @@ public class EditTextMultiAutoComplete extends AppCompatMultiAutoCompleteTextVie
@Override @Override
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
try { try {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { return super.onTouchEvent(event);
Editable edit = getText();
int off = Helper.getOffset(this, edit, event);
ClipImageSpan[] spans = edit.getSpans(off, off, ClipImageSpan.class);
if (spans.length == 1)
post(new Runnable() {
@Override
public void run() {
try {
edit.removeSpan(spans[0]);
} catch (Throwable ex) {
Log.e(ex);
}
}
});
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
return true;
} }
return super.onTouchEvent(event);
} }
@Override @Override

Loading…
Cancel
Save