mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 14:02:44 +00:00
avoid potentially unwanted layout switches due to hint locales
This commit is contained in:
parent
58f98e3024
commit
9bd2136ebe
1 changed files with 3 additions and 0 deletions
|
@ -63,6 +63,7 @@ import helium314.keyboard.latin.common.ColorType;
|
||||||
import helium314.keyboard.latin.common.Constants;
|
import helium314.keyboard.latin.common.Constants;
|
||||||
import helium314.keyboard.latin.common.CoordinateUtils;
|
import helium314.keyboard.latin.common.CoordinateUtils;
|
||||||
import helium314.keyboard.latin.common.InputPointers;
|
import helium314.keyboard.latin.common.InputPointers;
|
||||||
|
import helium314.keyboard.latin.common.LocaleUtils;
|
||||||
import helium314.keyboard.latin.common.ViewOutlineProviderUtilsKt;
|
import helium314.keyboard.latin.common.ViewOutlineProviderUtilsKt;
|
||||||
import helium314.keyboard.latin.define.DebugFlags;
|
import helium314.keyboard.latin.define.DebugFlags;
|
||||||
import helium314.keyboard.latin.define.ProductionFlags;
|
import helium314.keyboard.latin.define.ProductionFlags;
|
||||||
|
@ -878,6 +879,8 @@ public class LatinIME extends InputMethodService implements
|
||||||
}
|
}
|
||||||
// Try switching to a subtype matching the hint language.
|
// Try switching to a subtype matching the hint language.
|
||||||
for (final Locale hintLocale : hintLocales) {
|
for (final Locale hintLocale : hintLocales) {
|
||||||
|
if (LocaleUtils.INSTANCE.getMatchLevel(hintLocale, mRichImm.getCurrentSubtypeLocale()) >= 3)
|
||||||
|
return; // current locale is already a good match, and we want to avoid unnecessary layout switches
|
||||||
final InputMethodSubtype newSubtype = mRichImm.findSubtypeForHintLocale(hintLocale);
|
final InputMethodSubtype newSubtype = mRichImm.findSubtypeForHintLocale(hintLocale);
|
||||||
if (newSubtype == null) continue;
|
if (newSubtype == null) continue;
|
||||||
if (newSubtype.equals(mRichImm.getCurrentSubtype().getRawSubtype()))
|
if (newSubtype.equals(mRichImm.getCurrentSubtype().getRawSubtype()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue