android-chips icon indicating copy to clipboard operation
android-chips copied to clipboard

Putting space in does not create a "chip" for unknown contact

Open tyczj opened this issue 11 years ago • 9 comments

If I put in and email address for someone that is not in my contact list there is no way to create a chip for that email.

In the gmail app for example if the email address is not in the contact list all you do is put a space in and it will create a chip for that address however putting in a space here does not do this and the only way to create a chip is to focus on something else.

Either that or do like the hangouts app does where you select the item from the Autocomplete list but as it stands this is broke.

I have not tried this with phone numbers so I do not know if that works correctly or not.

Edit:

I see that using a comma creates it but IMO you cannot expect the user to know this, use a comma or a space?

Edit 2:

I think I see the problem, in the method lastCharacterIsCommitCharacter of class RecipientEditTextView you do

return last == COMMIT_CHAR_COMMA || last == COMMIT_CHAR_SEMICOLON;

but you are missing COMMIT_CHAR_SPACE

tyczj avatar Jan 06 '15 02:01 tyczj

^ same exact problem, @tyczj did modifying the source with COMMIT_CHAR_SPACE fix the problem?

cargo8 avatar Jan 14 '15 19:01 cargo8

@cargo8 I didnt try it yet

tyczj avatar Jan 15 '15 15:01 tyczj

@cargo8 @tyczj Tried. It works great :-)

legarspol avatar Jan 31 '15 19:01 legarspol

^ Yeah works quite well.

cargo8 avatar Feb 11 '15 19:02 cargo8

Maybe close this issue so that any forker knows what's going on?

timkoers avatar Feb 25 '16 16:02 timkoers

Hi, It does not work again after this commit. Is there some big reason for that?

bomiyr avatar Sep 15 '16 09:09 bomiyr

@bomiyr seems as though it may be intentional. Certain use cases warrant a space as tokenization, others don't (i.e if the primary input will be full names that need to map to emails, you would want to be able to type the space as part of the match rather than tokenizing)

cargo8 avatar Sep 15 '16 19:09 cargo8

Hey everyone, I created a custom solution for this, though I am only using phone numbers. Gist if anyone is interested: https://gist.github.com/KtodaZ/45c039abfcb208055f33e72e538e1124

KtodaZ avatar Oct 28 '16 05:10 KtodaZ

I have this setup so that if the user denies contacts permission, I don't set an adapter, and if no adapter is present, then space is a separator, because the list is just straight up email addresses. If the adapter is present however, then contacts are used, and space is allowable in the context of a search.

mandrachek avatar Feb 27 '19 21:02 mandrachek