Compare commits

...

7 Commits

Author SHA1 Message Date
Jules Aguillon
65cc0c736e Release 1.14.2 (21) 2022-04-16 23:43:25 +02:00
Jules Aguillon
2cce0fed67 Makefile: Pass -r to adb install
Fails to update on some versions of Android without it.
2022-04-16 23:38:16 +02:00
Jules Aguillon
9a8c4f291d Fix compatibility with Android 6
Android 6 uses Java 1.7, the only incompatible feature in use was
lambdas.
2022-04-16 23:36:54 +02:00
marciozomb13
14cc318a0e Update PT strings (#121)
Tiny fixes and improvements.
2022-04-16 23:17:17 +02:00
Jules Aguillon
8d8a58462c Release 1.14.1 (20) 2022-04-06 09:50:33 +02:00
Jules Aguillon
5562ee1391 Fix mismatch layout name
The Korean layout id was not consistent and this caused a crash.
2022-04-06 09:50:33 +02:00
Jules Aguillon
120c0a9d23 Fix compat with older version of Android
Resources.getFloat is new from API 29.
2022-04-06 09:50:33 +02:00
9 changed files with 87 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="19" android:versionName="1.14.0" android:hardwareAccelerated="false"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="21" android:versionName="1.14.2" android:hardwareAccelerated="false">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="30"/> <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="30"/>
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:hardwareAccelerated="false"> <application android:label="@string/app_name" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:hardwareAccelerated="false">
<service android:name="juloo.keyboard2.Keyboard2" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD"> <service android:name="juloo.keyboard2.Keyboard2" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD">

View File

@@ -3,7 +3,7 @@
PACKAGE_NAME = juloo.keyboard2 PACKAGE_NAME = juloo.keyboard2
ANDROID_PLATFORM_VERSION = android-30 ANDROID_PLATFORM_VERSION = android-30
JAVA_VERSION = 1.8 JAVA_VERSION = 1.7
SRC_DIR = srcs SRC_DIR = srcs
RES_DIR = res RES_DIR = res
@@ -16,7 +16,7 @@ debug: _build/$(PACKAGE_NAME).debug.apk
release: _build/$(PACKAGE_NAME).apk release: _build/$(PACKAGE_NAME).apk
installd: _build/$(PACKAGE_NAME).debug.apk installd: _build/$(PACKAGE_NAME).debug.apk
adb install "$<" adb install -r "$<"
clean: clean:
rm -rf _build/*.dex _build/class _build/gen _build/*.apk _build/*.unsigned-apk \ rm -rf _build/*.dex _build/class _build/gen _build/*.apk _build/*.unsigned-apk \

View File

@@ -0,0 +1,25 @@
Quick fix release.
Previously:
Translations: Brazilian portuguese (@igorSilCar), Chinese-Simplified (@9-2-1), Korean (@notnickid)
New layouts: Swedish (@thabubble), Korean (@notnickid)
Improved computation of the swipe gesture and fix unstoppable key-repeat on
some devices.
Moved keys away from the edges of the screen and other improvements to the layouts.
Improved rendering of some symbols.
Added more characters to the keyboard:
- New combinations to Fn (@ArenaL5)
- Currency symbols
- Added arrow and box symbols (@sdrapha)
- F11 and F12.
Option for making modifiers lockable. (@sdrapha)
Fixes to the Spanish layout and other fixes. (@ArenaL5)
Many other fixes.
Huge thanks to the contributors: @igorSilCar, @sdrapha, @ArenaL5, @notnickid, @9-2-1, @thabubble

View File

@@ -0,0 +1,4 @@
Fix compatibility with Android 6.
Translation improvements.
Huge thanks to the contributors: @marciozomb13

View File

@@ -1,29 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name" product="debug">Unexpected Keyboard</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Configurações Unexpected Keyboard</string> <string name="settings_activity_label">Configurações Unexpected Keyboard</string>
<string name="pref_category_layout">Layout</string> <string name="pref_category_layout">Layout</string>
<string name="pref_layout_title">Mudar layout do teclado</string> <string name="pref_layout_title">Mudar layout do teclado</string>
<string name="pref_layout_e_system">Mesmo do sistema</string> <string name="pref_layout_e_system">Mesmo do sistema</string>
<string name="pref_accents_title">Acentos</string> <string name="pref_accents_title">Acentos</string>
<string name="pref_accents_e_all_installed">Mostrar acentos para todos idiomas instalados</string> <string name="pref_accents_e_all_installed">Mostrar acentos para todos os idiomas instalados</string>
<string name="pref_accents_e_selected">Mostrar acentos só para o idioma selecionado</string> <string name="pref_accents_e_selected">Mostrar acentos só para o idioma selecionado</string>
<string name="pref_accents_e_all">Mostrar todos acentos</string> <string name="pref_accents_e_all">Mostrar todos acentos</string>
<string name="pref_accents_e_none">Esconder acentos</string> <string name="pref_accents_e_none">Ocultar acentos</string>
<string name="pref_programming_layout_title">Layout do teclado para programação</string>
<string name="pref_programming_layout_none">Nenhum</string>
<string name="pref_category_typing">Digitação</string> <string name="pref_category_typing">Digitação</string>
<string name="pref_swipe_dist_title">Distância a deslizar</string> <string name="pref_swipe_dist_title">Distância a deslizar</string>
<string name="pref_swipe_dist_summary">Distância até acionar os cantos das teclas (%s)</string> <string name="pref_swipe_dist_summary">Distância até acionar os cantos das teclas (%s)</string>
<string name="pref_long_timeout_title">Tempo até repetir tecla</string> <string name="pref_long_timeout_title">Tempo até repetir tecla</string>
<string name="pref_long_interval_title">Intervalo para repetir tecla</string> <string name="pref_long_interval_title">Intervalo de repetição de tecla</string>
<string name="pref_category_vibrate">Vibração</string> <string name="pref_category_vibrate">Vibração</string>
<string name="pref_vibrate_title">Vibração</string> <string name="pref_vibrate_title">Vibração</string>
<string name="pref_vibrate_summary">Ativar/desativar vibração ao digitar</string> <string name="pref_vibrate_summary">Ativar/desativar vibração ao digitar</string>
<string name="pref_vibrate_duration_title">Duração</string> <string name="pref_vibrate_duration_title">Duração</string>
<string name="pref_precise_repeat_title">Precisão nos movimentos do cursor</string> <string name="pref_precise_repeat_title">Precisão nos movimentos do cursor</string>
<string name="pref_precise_repeat_summary">Varia a velocidade de repetição ao depender de quanto deslizar</string> <string name="pref_precise_repeat_summary">Varia a velocidade de repetição a depender do quanto deslizar</string>
<string name="pref_lockable_keys_title">Segurar teclas</string> <string name="pref_lockable_keys_title">Teclas traváveis</string>
<string name="pref_lockable_keys_summary">Teclas que podem ficar seguradas ao teclar duas vezes</string> <string name="pref_lockable_keys_summary">Teclas que podem ficar seguradas ao teclar duas vezes</string>
<string name="pref_category_style">Estilo</string> <string name="pref_category_style">Estilo</string>
<string name="pref_margin_bottom_title">Margem de baixo</string> <string name="pref_margin_bottom_title">Margem inferior</string>
<string name="pref_keyboard_height_title">Altura do teclado</string> <string name="pref_keyboard_height_title">Altura do teclado</string>
<string name="pref_horizontal_margin_title">Margem horizontal</string> <string name="pref_horizontal_margin_title">Margem horizontal</string>
<string name="pref_character_size_title">Tamanho dos indicadores</string> <string name="pref_character_size_title">Tamanho dos indicadores</string>

View File

@@ -6,7 +6,7 @@
<item>qwerty</item> <item>qwerty</item>
<item>qwerty_pt</item> <item>qwerty_pt</item>
<item>qwerty_es</item> <item>qwerty_es</item>
<item>qwerty_kr</item> <item>qwerty_ko</item>
<item>qwerty_lv</item> <item>qwerty_lv</item>
<item>qwerty_sv_se</item> <item>qwerty_sv_se</item>
<item>ru_jcuken</item> <item>ru_jcuken</item>

View File

@@ -56,8 +56,8 @@ final class Config
// static values // static values
marginTop = res.getDimension(R.dimen.margin_top); marginTop = res.getDimension(R.dimen.margin_top);
keyPadding = res.getDimension(R.dimen.key_padding); keyPadding = res.getDimension(R.dimen.key_padding);
labelTextSize = res.getFloat(R.integer.label_text_size); labelTextSize = Float.valueOf(res.getString(R.integer.label_text_size));
sublabelTextSize = res.getFloat(R.integer.sublabel_text_size); sublabelTextSize = Float.valueOf(res.getString(R.integer.sublabel_text_size));
// default values // default values
layout = -1; layout = -1;
programming_layout = -1; programming_layout = -1;
@@ -149,9 +149,11 @@ final class Config
public KeyboardData modify_layout(KeyboardData kw) public KeyboardData modify_layout(KeyboardData kw)
{ {
// Update the name to avoid caching in KeyModifier // Update the name to avoid caching in KeyModifier
KeyValue action_key = (actionLabel == null) ? null : final KeyValue action_key = (actionLabel == null) ? null :
KeyValue.getKeyByName("action").withNameAndSymbol(actionLabel, actionLabel); KeyValue.getKeyByName("action").withNameAndSymbol(actionLabel, actionLabel);
return kw.replaceKeys(key -> { return kw.replaceKeys(new KeyboardData.MapKeys() {
public KeyValue apply(KeyValue key)
{
if (key == null) if (key == null)
return null; return null;
switch (key.eventCode) switch (key.eventCode)
@@ -176,7 +178,9 @@ final class Config
return key.withFlags(key.flags | KeyValue.FLAG_LOCK); return key.withFlags(key.flags | KeyValue.FLAG_LOCK);
} }
return key; return key;
}}); }
}
});
} }
private float getDipPref(DisplayMetrics dm, SharedPreferences prefs, String pref_name, float def) private float getDipPref(DisplayMetrics dm, SharedPreferences prefs, String pref_name, float def)
@@ -223,7 +227,7 @@ final class Config
case "qwerty_sv_se": return R.xml.qwerty_sv_se; case "qwerty_sv_se": return R.xml.qwerty_sv_se;
case "qwertz": return R.xml.qwertz; case "qwertz": return R.xml.qwertz;
case "ru_jcuken": return R.xml.local_ru_jcuken; case "ru_jcuken": return R.xml.local_ru_jcuken;
default: throw new IllegalArgumentException("layoutId_of_string: Unknown layout: " + name); default: return R.xml.qwerty; // The config might store an invalid layout, don't crash
} }
} }

View File

@@ -294,10 +294,13 @@ public class Keyboard2 extends InputMethodService
if (_config.programming_layout == -1) if (_config.programming_layout == -1)
return; return;
KeyboardData layout = KeyboardData layout =
getLayout(_config.programming_layout).replaceKeys(key -> { getLayout(_config.programming_layout).replaceKeys(new KeyboardData.MapKeys() {
public KeyValue apply(KeyValue key)
{
if (key != null && key.eventCode == KeyValue.EVENT_SWITCH_PROGRAMMING) if (key != null && key.eventCode == KeyValue.EVENT_SWITCH_PROGRAMMING)
return KeyValue.getKeyByName("switch_text"); return KeyValue.getKeyByName("switch_text");
return key; return key;
}
}); });
_keyboardView.setKeyboard(layout); _keyboardView.setKeyboard(layout);
} }

View File

@@ -208,7 +208,10 @@ class KeyboardData
} }
} }
public static abstract interface MapKeys extends Function<KeyValue, KeyValue> { } // Not using Function<KeyValue, KeyValue> to keep compatibility with Android 6.
public static abstract interface MapKeys {
public KeyValue apply(KeyValue kv);
}
/** Parsing utils */ /** Parsing utils */