Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: restore uncompleted input on screen rotation #313

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexcustos
Copy link
Contributor

No description provided.

@mgod
Copy link
Contributor

mgod commented Aug 15, 2017

I like this improvement, but you should use the getSpans method on the characters to figure out where the incomplete input is rather than use a sentinel.

@alexcustos
Copy link
Contributor Author

alexcustos commented Aug 16, 2017

I have been trying it at the first place, but it looks like onRestoreInstanceState restores the plain String, there are no Spans in it. I dug into it a bit more, the TokenCompleteTextView.SavedState is not involved in save/restore process at all, so it maybe a point.

@mgod
Copy link
Contributor

mgod commented Aug 16, 2017

I guess I was thinking to try to fins the uncompleted text during the save process where you should still have the spans available.

@alexcustos
Copy link
Contributor Author

Good idea I will try to implement it... may be at weekends.

@mgod mgod force-pushed the master branch 2 times, most recently from bdb918d to 6bc7cd4 Compare August 24, 2017 19:40
@mgod mgod added this to the 4.0.0 milestone Aug 3, 2020
@saurabh0802chd
Copy link

@alexcustos @mgod Any plans to merge this PR?

@mgod
Copy link
Contributor

mgod commented Jan 14, 2022

Not at the moment. The general approach here is pretty good, but we probably need to move to the opposite check - instead of adding sentinels to keep track of regular text, we probably need to keep track of text ranges for each token and manually re-attach the token spans during restore instead of using the normal add token calls. The current implementation hard-codes a particular tokenizer implementation and also my original code using addObject to restore tokens to the view has some unwanted side effects (#415, for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants