private void handleEdit(int start, int end) {
if (start == -1 || end == -1) {
// This chip no longer exists in the field.
dismissDropDown();
return;
}
// This is in the middle of a chip, so select out the whole chip
// and commit it.
Editable editable = getText();
setSelection(end);
String text = getText().toString().substring(start, end);
if (!TextUtils.isEmpty(text)) {
QwertyKeyListener.markAsReplaced(editable, start, end, "");
CharSequence chipText = createChip(text, false);
int selEnd = getSelectionEnd();
if (chipText != null && start > -1 && selEnd > -1) {
editable.replace(start, selEnd, chipText);
}
}
dismissDropDown();
}
ChipEditTextView.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:android-chip-edittextview
作者:
评论列表
文章目录