Compare commits

...

4 Commits

Author SHA1 Message Date
Jules Aguillon
deb611a0d2 Release 1.29.0 (41) 2024-07-15 00:21:59 +02:00
solokot
29f03d0e96 Update Russian translation (#702) 2024-07-14 16:55:34 +02:00
Jules Aguillon
4629410230 Fix unintended layout used for unsupported languages
The arabic layout was used as the default on devices where all the
installed languages are not supported by the keyboard. This is not
intended.
This is probably caused by 'getCurrentInputMethodSubtype' returning the
first layout in the list of disabled subtypes in alphabetical or
language tag order.
Re-ordering the subtypes in method.xml had no effect.

Setting 'overridesImplicitlyEnabledSubtype' in method.xml has no
measured effect.
2024-07-14 16:15:18 +02:00
Jules Aguillon
b9526d918d Fix crash when using a different script layout
This might happen when using a layout of a different script than the
installed languages.
2024-07-14 15:52:24 +02:00
6 changed files with 39 additions and 20 deletions

View File

@@ -10,8 +10,8 @@ android {
applicationId "juloo.keyboard2"
minSdk 11
targetSdkVersion 34
versionCode 40
versionName "1.28.0"
versionCode 41
versionName "1.29.0"
}
sourceSets {

View File

@@ -0,0 +1,8 @@
Clipboard pane
New Monet theme
Improvements to custom layouts
Options to disable key repeat and the circle gesture
Options to disable the Tab and Esc keys
Many thanks to the contributors: @alotbsol555 @ChasmSolacer @eandersons @polyctena @Sestowner @solokot @Spike-from-NH @TadaCZE @V6lhost @Validbit

View File

@@ -68,9 +68,9 @@
<string name="pref_theme_e_epaper">Электронная бумага</string>
<string name="pref_theme_e_desert">Пустыня</string>
<string name="pref_theme_e_jungle">Джунгли</string>
<!-- <string name="pref_theme_e_monet">Monet (System)</string> -->
<!-- <string name="pref_theme_e_monetlight">Monet (Light)</string> -->
<!-- <string name="pref_theme_e_monetdark">Monet (Dark)</string> -->
<string name="pref_theme_e_monet">Моне (системная)</string>
<string name="pref_theme_e_monetlight">Моне (светлая)</string>
<string name="pref_theme_e_monetdark">Моне (темная)</string>
<string name="pref_swipe_dist_e_very_short">Очень короткая</string>
<string name="pref_swipe_dist_e_short">Короткая</string>
<string name="pref_swipe_dist_e_default">Обычная</string>
@@ -119,9 +119,9 @@
<string name="key_descr_page_down">Страница вниз</string>
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
<!-- <string name="clipboard_remove_confirmed">Yes</string> -->
<string name="key_descr_clipboard">Менеджер буфера обмена</string>
<string name="clipboard_history_heading">Недавно скопированный текст</string>
<string name="clipboard_pin_heading">Закреплено</string>
<string name="clipboard_remove_confirm">Удалить этот буфер обмена?</string>
<string name="clipboard_remove_confirmed">Да</string>
</resources>

View File

@@ -12,7 +12,7 @@
<subtype android:label="%s" android:languageTag="el" android:imeSubtypeLocale="el" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=grek_qwerty,extra_keys=£@l|€"/>
<subtype android:label="%s" android:languageTag="en-CA" android:imeSubtypeLocale="en_CA" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us"/>
<subtype android:label="%s" android:languageTag="en-GB" android:imeSubtypeLocale="en_GB" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_gb,extra_keys=£@l"/>
<subtype android:label="%s" android:languageTag="en-US" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us"/>
<subtype android:label="%s" android:languageTag="en-US" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us" android:overridesImplicitlyEnabledSubtype="true"/>
<subtype android:label="%s" android:languageTag="es" android:imeSubtypeLocale="es_ES" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_es,extra_keys=accent_aigu:á:é:í:ó:ú@d|accent_tilde:ñ@n|accent_grave@f|accent_trema@u|€"/>
<subtype android:label="%s" android:languageTag="fa" android:imeSubtypeLocale="fa_IR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=arab_pc_ir"/>
<subtype android:label="%s" android:languageTag="fr-CA" android:imeSubtypeLocale="fr_CA" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_azerty_fr,extra_keys=accent_grave:à:è:ù@f|accent_aigu:é@d|accent_circonflexe:â:ê:ô@f|accent_cedille:ç@c|accent_trema:ë:ï:ü:ÿ@u"/>

View File

@@ -136,13 +136,9 @@ public class Keyboard2 extends InputMethodService
return ExtraKeys.EMPTY;
}
@TargetApi(12)
private void refreshAccentsOption(InputMethodManager imm, InputMethodSubtype subtype)
private void refreshAccentsOption(InputMethodManager imm, List<InputMethodSubtype> enabled_subtypes)
{
List<InputMethodSubtype> enabled_subtypes = getEnabledSubtypes(imm);
List<ExtraKeys> extra_keys = new ArrayList<ExtraKeys>();
// Gather extra keys from all enabled subtypes
extra_keys.add(extra_keys_of_subtype(subtype));
for (InputMethodSubtype s : enabled_subtypes)
extra_keys.add(extra_keys_of_subtype(s));
_config.extra_keys_subtype = ExtraKeys.merge(extra_keys);
@@ -153,6 +149,18 @@ public class Keyboard2 extends InputMethodService
return (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
}
@TargetApi(12)
private String defaultLayoutForSubtypes(InputMethodManager imm, List<InputMethodSubtype> enabled_subtypes)
{
// Android might return a random subtype, for example, the first in the
// list alphabetically.
InputMethodSubtype current_subtype = imm.getCurrentInputMethodSubtype();
for (InputMethodSubtype s : enabled_subtypes)
if (s.getLanguageTag().equals(current_subtype.getLanguageTag()))
return s.getExtraValueOf("default_layout");
return null;
}
private void refreshSubtypeImm()
{
InputMethodManager imm = get_imm();
@@ -161,13 +169,14 @@ public class Keyboard2 extends InputMethodService
_config.extra_keys_subtype = null;
if (VERSION.SDK_INT >= 12)
{
List<InputMethodSubtype> enabled_subtypes = getEnabledSubtypes(imm);
InputMethodSubtype subtype = imm.getCurrentInputMethodSubtype();
if (subtype != null)
{
String s = subtype.getExtraValueOf("default_layout");
String s = defaultLayoutForSubtypes(imm, enabled_subtypes);
if (s != null)
default_layout = LayoutsPreference.layout_of_string(getResources(), s);
refreshAccentsOption(imm, subtype);
refreshAccentsOption(imm, enabled_subtypes);
}
}
if (default_layout == null)

View File

@@ -71,13 +71,15 @@ public final class KeyboardData
KeyPos next_to_pos = getKeys().get(pos.next_to);
// Use preferred direction if some preferred pos match
if (next_to_pos != null)
{
for (KeyPos p : pos.positions)
if ((p.row == -1 || p.row == next_to_pos.row)
&& (p.col == -1 || p.col == next_to_pos.col)
&& add_key_to_pos(rows, kv, next_to_pos.with_dir(p.dir)))
return true;
if (add_key_to_pos(rows, kv, next_to_pos.with_dir(-1)))
return true;
if (add_key_to_pos(rows, kv, next_to_pos.with_dir(-1)))
return true;
}
}
for (KeyPos p : pos.positions)
if (add_key_to_pos(rows, kv, p))