Compare commits

...

1 Commits

Author SHA1 Message Date
Jules Aguillon
08a1774055 Fix crash with unexpected value in NumberLayout pref 2025-07-02 23:04:47 +02:00
2 changed files with 14 additions and 4 deletions

View File

@@ -168,7 +168,7 @@ public final class Config
switch_input_immediate = _prefs.getBoolean("switch_input_immediate", false); switch_input_immediate = _prefs.getBoolean("switch_input_immediate", false);
extra_keys_param = ExtraKeysPreference.get_extra_keys(_prefs); extra_keys_param = ExtraKeysPreference.get_extra_keys(_prefs);
extra_keys_custom = CustomExtraKeysPreference.get(_prefs); extra_keys_custom = CustomExtraKeysPreference.get(_prefs);
selected_number_layout = NumberLayout.valueOf(_prefs.getString("number_entry_layout", "pin").toUpperCase()); selected_number_layout = NumberLayout.of_string(_prefs.getString("number_entry_layout", "pin"));
current_layout_portrait = _prefs.getInt("current_layout_portrait", 0); current_layout_portrait = _prefs.getInt("current_layout_portrait", 0);
current_layout_landscape = _prefs.getInt("current_layout_landscape", 0); current_layout_landscape = _prefs.getInt("current_layout_landscape", 0);
current_layout_unfolded_portrait = _prefs.getInt("current_layout_unfolded_portrait", 0); current_layout_unfolded_portrait = _prefs.getInt("current_layout_unfolded_portrait", 0);

View File

@@ -1,7 +1,17 @@
package juloo.keyboard2; package juloo.keyboard2;
public enum NumberLayout { public enum NumberLayout {
PIN, PIN,
NUMBER, NUMBER,
NORMAL NORMAL;
public static NumberLayout of_string(String name)
{
switch (name)
{
case "number": return NUMBER;
case "normal": return NORMAL;
case "pin": default: return PIN;
}
}
} }