From 111cd6b7318c19ff743020b1711c8907ea9a3186 Mon Sep 17 00:00:00 2001 From: Raimondas Rimkus Date: Sun, 4 Aug 2019 10:20:34 +0300 Subject: [PATCH] Don't show language on spacebar if only one is selected --- app/build.gradle | 4 ++-- .../inputmethod/keyboard/MainKeyboardView.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4cf87473b..ca7d8a046 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "rkr.simplekeyboard.inputmethod" minSdkVersion 19 targetSdkVersion 28 - versionCode 59 - versionName "3.9" + versionCode 60 + versionName "3.10" } buildTypes { release { diff --git a/app/src/main/java/rkr/simplekeyboard/inputmethod/keyboard/MainKeyboardView.java b/app/src/main/java/rkr/simplekeyboard/inputmethod/keyboard/MainKeyboardView.java index a6fbfc16c..a96f81e1f 100644 --- a/app/src/main/java/rkr/simplekeyboard/inputmethod/keyboard/MainKeyboardView.java +++ b/app/src/main/java/rkr/simplekeyboard/inputmethod/keyboard/MainKeyboardView.java @@ -45,6 +45,7 @@ import rkr.simplekeyboard.inputmethod.keyboard.internal.MoreKeySpec; import rkr.simplekeyboard.inputmethod.keyboard.internal.NonDistinctMultitouchHelper; import rkr.simplekeyboard.inputmethod.keyboard.internal.TimerHandler; +import rkr.simplekeyboard.inputmethod.latin.RichInputMethodManager; import rkr.simplekeyboard.inputmethod.latin.RichInputMethodSubtype; import rkr.simplekeyboard.inputmethod.latin.common.Constants; import rkr.simplekeyboard.inputmethod.latin.common.CoordinateUtils; @@ -605,8 +606,9 @@ protected void onDrawKeyTopVisuals(final Key key, final Canvas canvas, final Pai super.onDrawKeyTopVisuals(key, canvas, paint, params); final int code = key.getCode(); if (code == Constants.CODE_SPACE) { - // If input language are explicitly selected. - if (mLanguageOnSpacebarFormatType != LanguageOnSpacebarUtils.FORMAT_TYPE_NONE) { + // If more than one language is enabled in current input method + final RichInputMethodManager imm = RichInputMethodManager.getInstance(); + if (imm.getMyEnabledInputMethodSubtypeList(false).size() > 1) { drawLanguageOnSpacebar(key, canvas, paint); } }