From 749471130cfc39caeca4b0612eb0bfdb3d563e4f Mon Sep 17 00:00:00 2001 From: sspanak Date: Wed, 18 Sep 2024 16:42:36 +0300 Subject: [PATCH] disabled selecting lowercase in Predictive mode, when Auto Text Case is on and there are no suggestions --- .../github/sspanak/tt9/ime/modes/ModePredictive.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModePredictive.java b/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModePredictive.java index 5db68a9f..e14a29e9 100644 --- a/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModePredictive.java +++ b/app/src/main/java/io/github/sspanak/tt9/ime/modes/ModePredictive.java @@ -408,8 +408,18 @@ public class ModePredictive extends InputMode { @Override public boolean nextTextCase() { + int before = textCase; boolean changed = super.nextTextCase(); - textFieldTextCase = changed ? CASE_UNDEFINED : textFieldTextCase; // since it's a user's choice, the default matters no more + + // When Auto Text Case is on, only upper- and automatic cases are available, so we skip lowercase. + // Yet, we allow adjusting individual words to lowercase, if needed. + if (digitSequence.isEmpty() && settings.getAutoTextCase() && language.hasUpperCase() && (before == CASE_LOWER || textCase == CASE_LOWER)) { + changed = super.nextTextCase(); + } + + // since it's a user's choice, the default matters no more + textFieldTextCase = changed ? CASE_UNDEFINED : textFieldTextCase; + return changed; }