splitwise/TokenAutoComplete

how does TokenClickStyle.Select work with IME delete?

Closed this issue · 3 comments

I'm not sure this is an issue, it could be I'm just missing something obvious. But here goes.

TokenClickStyle.Select works the way I expect, one touch = select, one more touch = delete, touching unselected tokens shifts selection to said token.

However, while touching IME delete works similarly, I cannot get it to set the token to selected state. One press on del APPEARS to do SOMETHING, and one more deletes the token. But without the selected state being set, the highlighting I do for that first touch does not appear on the first IME delete press. I tried to track down what's happening but I can't figure it out.

Basically, I need some help finding out what happens, and where, when TokenClickStyle is set to Select, and IME delete is pressed for the first time.

I should add I'm allowing collapsable to be true, and I do realize the behaviors are different between setting focus to the TokenAutoCompleteTextView when it is collapsed, and when it is not. Specifically, the last token seems to delete on first touch of IME delete when the view was not collapsed before gaining focus. But again, I'm not sure what behavior is supposed to be in the first place. I could not get the code to break on anything on that first touch of IME delete.

mgod commented

You're not missing anything – IME behavior with the library is really inconsistent. I've never been able to figure it out because it seems to vary based on Android OS and device. When you're seeing the first press do something (and not remove the token as it does on some other platforms), you're most likely seeing it delete the space after the token.

You will also see on some platforms that selecting the token, then hitting the delete key will delete the selected token and not the one just before the cursor. On others it will just delete the preceding token.

Wow. Thanks for letting me know. This makes it even more interesting that IME del takes only one touch when TokenClickStyle is Delete. (In my Android/Device combo of course)

Device specific stuff is insane. I have a bug in my app only on s7/edge that breaks audio playback completely for the whole device and requires restart. Its ridiculous. I guess I'll have to work around that problem rather than finding a specific fix there too.

mgod commented

I've updated some of these behaviors in 3.0.0, but I'm pretty sure I didn't actually resolve the issue. Please let me know if you're still seeing this with the update.