ChipEditTextView.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:android-chip-edittextview 作者:
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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号