fix(android): context-initial handling with repeated-char rotation

This commit is contained in:
Joshua A. Horton 2024-02-29 09:24:16 +07:00
parent 5f524d69a6
commit e83ff96efb

View file

@ -49,6 +49,9 @@ public final class CharSequenceUtil {
String expectedCharsString = expectedChars.toString();
String currentContextString = currentContext.toString();
int index = expectedCharsString.lastIndexOf(currentContextString);
if (currentContextString.length() == 0) {
index = 0;
}
if (index > -1) {
// subSequence indices are start(inclusive) to end(exclusive)
charsToRestore = expectedChars.subSequence(index + currentContextString.length(), expectedChars.length());