bump to 6.1.11

This commit is contained in:
Yuriy Liskov
2020-07-19 14:25:04 +03:00
parent 6040c66cd8
commit 6d1e314f9c
4 changed files with 23 additions and 14 deletions

View File

@@ -14,8 +14,8 @@ android {
applicationId "org.liskovsoft.leankeykeyboard.pro"
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
versionCode 180
versionName "6.1.10"
versionCode 181
versionName "6.1.11"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

View File

@@ -12,6 +12,7 @@ import com.liskovsoft.leankeyboard.addons.keyboards.KeyboardBuilder;
import com.liskovsoft.leankeyboard.addons.keyboards.KeyboardFactory;
import com.liskovsoft.leankeyboard.addons.keyboards.KeyboardInfo;
import com.liskovsoft.leankeyboard.ime.LeanbackKeyboardView;
import com.liskovsoft.leankeyboard.utils.LeanKeyPreferences;
import com.liskovsoft.leankeyboard.utils.TextDrawable;
import com.liskovsoft.leankeykeyboard.R;
@@ -44,24 +45,27 @@ public class ResKeyboardFactory implements KeyboardFactory {
// at least one kbd should be enabled
if (result.isEmpty()) {
KeyboardInfo firstKbd = findByLocale(infos);
result.add(createKeyboard(firstKbd));
firstKbd.setEnabled(true);
KeyboardInfo defaultKbd = findDefaultKeyboard(infos);
result.add(createKeyboard(defaultKbd));
defaultKbd.setEnabled(true);
//ResKeyboardInfo.updateAllKeyboardInfos(mContext, infos);
}
return result;
}
private KeyboardInfo findByLocale(List<KeyboardInfo> infos) {
private KeyboardInfo findDefaultKeyboard(List<KeyboardInfo> infos) {
KeyboardInfo defaultKeyboard = infos.get(0);
Locale defaultLocale = Locale.getDefault();
String lang = defaultLocale.getLanguage();
for (final KeyboardInfo info : infos) {
if (info.getLangCode().startsWith(lang)) {
defaultKeyboard = info;
break;
if (LeanKeyPreferences.instance(mContext).getAutodetectLayout()) {
Locale defaultLocale = Locale.getDefault();
String lang = defaultLocale.getLanguage();
for (final KeyboardInfo info : infos) {
if (info.getLangCode().startsWith(lang)) {
defaultKeyboard = info;
break;
}
}
}

View File

@@ -17,6 +17,7 @@ public final class LeanKeyPreferences {
public static final String THEME_DARK3 = "Dark3";
private static final String SUGGESTIONS_ENABLED = "suggestionsEnabled";
private static final String CYCLIC_NAVIGATION_ENABLED = "cyclicNavigationEnabled";
private static final String AUTODETECT_LAYOUT = "autodetectLayout";
private static LeanKeyPreferences sInstance;
private final Context mContext;
private SharedPreferences mPrefs;
@@ -111,4 +112,8 @@ public final class LeanKeyPreferences {
public boolean getCyclicNavigationEnabled() {
return mPrefs.getBoolean(CYCLIC_NAVIGATION_ENABLED, false);
}
public boolean getAutodetectLayout() {
return mPrefs.getBoolean(AUTODETECT_LAYOUT, false);
}
}

View File

@@ -46,8 +46,8 @@
<string name="change_theme">Выбрать тему</string>
<string name="enable_suggestions">Отображать подсказки</string>
<string name="enable_suggestions_desc">Отображать ряд с подсказками при вводе</string>
<string name="show_launcher_icon">Отображать иконку</string>
<string name="show_launcher_icon_desc">Отображать иконку лаунчера</string>
<string name="show_launcher_icon">Отображать приложение</string>
<string name="show_launcher_icon_desc">Отображать приложение на домашнем экране</string>
<string name="enable_cyclic_navigation">Циклическая навигация</string>
<string name="enable_cyclic_navigation_desc">Циклическая навигация по клавиатуре</string>
</resources>