private void handleEdit(final int start,final 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.
final Editable editable=getText();
setSelection(end);
final String text=getText().toString().substring(start,end);
if(!TextUtils.isEmpty(text))
{
final RecipientEntry entry=RecipientEntry.constructFakeEntry(text,isValid(text));
QwertyKeyListener.markAsReplaced(editable,start,end,"");
final CharSequence chipText=createChip(entry,false);
final int selEnd=getSelectionEnd();
if(chipText!=null&&start>-1&&selEnd>-1)
editable.replace(start,selEnd,chipText);
}
dismissDropDown();
}
RecipientEditTextView.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:ChipsLibrary
作者:
评论列表
文章目录