|
|
|
|
@ -603,6 +603,7 @@ public class EditTextMultiAutoComplete extends AppCompatMultiAutoCompleteTextVie
|
|
|
|
|
if (this == state.source && target >= sourceStart && target <= sourceEnd)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
Editable source = state.source.getText();
|
|
|
|
|
source.removeSpan(state.span);
|
|
|
|
|
source.delete(sourceStart, sourceEnd);
|
|
|
|
|
@ -615,13 +616,15 @@ public class EditTextMultiAutoComplete extends AppCompatMultiAutoCompleteTextVie
|
|
|
|
|
|
|
|
|
|
target = Math.max(0, Math.min(target, edit.length()));
|
|
|
|
|
target = resolveDropBoundary(edit, target, null);
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
String text = state.text;
|
|
|
|
|
int insertLength = text.length();
|
|
|
|
|
int spanLength = state.end - state.start;
|
|
|
|
|
edit.insert(target, text);
|
|
|
|
|
edit.setSpan(state.span, target, target + spanLength, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
|
|
|
|
setSelection(target + insertLength);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
invalidate();
|
|
|
|
|
post(update);
|
|
|
|
|
|
|
|
|
|
|