regression: fixed the text case not being preserved when changing the language
This commit is contained in:
parent
b26aba2273
commit
252c3e557d
3 changed files with 18 additions and 7 deletions
|
|
@ -187,12 +187,9 @@ abstract public class CommandHandler extends TextEditingHandler {
|
|||
settings.setDefaultCharOrder(mLanguage, false); // initialize default order, if missing
|
||||
|
||||
// for languages that do not have ABC or Predictive, make sure we remain in valid state
|
||||
final String digits = mInputMode.getSequence();
|
||||
mInputMode = InputMode.getInstance(settings, mLanguage, inputType, textField, determineInputModeId());
|
||||
if (!InputModeKind.isNumeric(mInputMode)) {
|
||||
mInputMode.setSequence(digits);
|
||||
mInputMode.determineNextWordTextCase(-1);
|
||||
}
|
||||
mInputMode = InputMode
|
||||
.getInstance(settings, mLanguage, inputType, textField, determineInputModeId())
|
||||
.copy(mInputMode);
|
||||
|
||||
getSuggestions(null);
|
||||
setStatusIcon(mInputMode, mLanguage);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,20 @@ abstract public class InputMode {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public InputMode copy(InputMode other) {
|
||||
if (other == null || InputModeKind.isNumeric(this) || InputModeKind.isNumeric(other)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
autoAcceptTimeout = -1;
|
||||
textCase = other.textCase;
|
||||
setSequence(other.digitSequence);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
// Key handlers. Return "true" when handling the key or "false", when is nothing to do.
|
||||
public boolean onBackspace() { return false; }
|
||||
abstract public boolean onNumber(int number, boolean hold, int repeat);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ public class Text extends TextTools {
|
|||
|
||||
|
||||
public boolean isUpperCase() {
|
||||
return language != null && text != null && text.toUpperCase(language.getLocale()).equals(text);
|
||||
return language != null && text != null && language.hasUpperCase() && text.toUpperCase(language.getLocale()).equals(text);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue