Skip to content

Commit

Permalink
Merge branch 'master' into pr/390
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Aug 16, 2023
2 parents ae3a85c + 405e63d commit b957fee
Show file tree
Hide file tree
Showing 86 changed files with 1,968 additions and 817 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Now perfect for everyday use.

This application contains no ads, doesn't make any network requests and is Open Source.

## Similar apps
* [Calculator++](https://github.com/Bubu/android-calculatorpp) - Calculator with a similar UX, swipe to corners for advanced math symbols and operators. Works up to Android 13 but maybe unmaintained.

## Contributing

For instructions on building the application, see
Expand Down
69 changes: 30 additions & 39 deletions check_layout.output
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# res/xml/arab_alt.xml
Layout includes some ASCII punctuation but not all, missing: !, ", ', +, -, /, :, ;, <, =, >, ?, [, \, ], _, |, ~
1 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/arab_pc_ckb.xml
Layout includes some ASCII punctuation but not all, missing: ", %, ', +, ,, ., :, ;, <, =, >, ?, `, |, ~
1 warnings
# res/xml/arab_pc_ir.xml
Layout includes some ASCII punctuation but not all, missing: ", $, %, ', *, ,, /, ;, <, =, >, ?, [, \, ], ^, _, `, {, |, }, ~
1 warnings
Duplicate keys: (, )
Layout includes some ASCII punctuation but not all, missing: ", %, ', ,, /, ;, <, =, >, ?, [, \, ], `, {, |, }
2 warnings
# res/xml/arab_pc.xml
Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, |
1 warnings
# res/xml/beng_national.xml
Layout includes some ASCII punctuation but not all, missing: $
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
Layout doesn't specify a script.
2 warnings
3 warnings
# res/xml/beng_provat.xml
Layout includes some ASCII punctuation but not all, missing: $, &, *, ., /, <, >, [, \, ], `, {, |, }
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
Layout doesn't specify a script.
2 warnings
Not a layout file: res/xml/bottom_row.xml
3 warnings
# res/xml/cyrl_jcuken_ru.xml
0 warnings
# res/xml/cyrl_jcuken_uk.xml
Expand All @@ -28,17 +31,16 @@ Layout includes some ASCII punctuation but not all, missing: ~
1 warnings
# res/xml/deva_alt.xml
Layout includes some ASCII punctuation but not all, missing: #, $, %, &, ', (, ), *, +, ., /, :, <, =, >, @, [, \, ], ^, _, `, {, |, }, ~
1 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/deva_inscript.xml
Duplicate keys: , ।
Layout includes some ASCII punctuation but not all, missing: ", $, ', ^, _, `, |
1 warnings
# res/xml/greekmath.xml
Layout includes some ASCII punctuation but not all, missing: !, ", #, $, %, &, ', (, ), *, +, ,, -, /, :, ;, <, >, ?, @, [, \, ], _, `, {, |, }, ~
Layout redefines the bottom row but some important keys are missing, missing: change_method, config, ctrl, switch_emoji, switch_second
Layout doesn't specify a script.
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
3 warnings
# res/xml/grek_qwerty.xml
0 warnings
Duplicate keys: ;
1 warnings
# res/xml/hang_dubeolsik_kr.xml
0 warnings
# res/xml/hebr_1_il.xml
Expand All @@ -51,13 +53,16 @@ Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], {
0 warnings
# res/xml/latn_bone.xml
Layout includes some ASCII punctuation but not all, missing: $
1 warnings
Layout redefines the bottom row but some important keys are missing, missing: switch_backward
2 warnings
# res/xml/latn_colemak.xml
0 warnings
# res/xml/latn_dvorak.xml
0 warnings
# res/xml/latn_neo2.xml
0 warnings
Duplicate keys: -
Layout redefines the bottom row but some important keys are missing, missing: switch_forward
2 warnings
# res/xml/latn_qwerty_br.xml
0 warnings
# res/xml/latn_qwerty_es.xml
Expand All @@ -73,19 +78,23 @@ Layout includes some ASCII punctuation but not all, missing: $
# res/xml/latn_qwerty_ro.xml
0 warnings
# res/xml/latn_qwerty_se.xml
0 warnings
Duplicate keys: !, ', ,, -, ., ?
1 warnings
# res/xml/latn_qwerty_tr.xml
0 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
# res/xml/latn_qwerty_us.xml
0 warnings
# res/xml/latn_qwerty_vi.xml
Layout includes some ASCII punctuation but not all, missing: \
1 warnings
# res/xml/latn_qwertz_cz_multifunctional.xml
Layout includes some ASCII punctuation but not all, missing: `
1 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/latn_qwertz_cz.xml
0 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
# res/xml/latn_qwertz_de.xml
0 warnings
# res/xml/latn_qwertz_fr_ch.xml
Expand All @@ -94,25 +103,7 @@ Layout includes some ASCII punctuation but not all, missing: `
0 warnings
# res/xml/latn_qwertz_sk.xml
Layout includes some ASCII punctuation but not all, missing: \, `
1 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/latn_qwertz.xml
0 warnings
Not a layout file: res/xml/method.xml
Not a layout file: res/xml/number_row.xml
# res/xml/numeric.xml
Layout includes some ASCII punctuation but not all, missing: &, ?, @, `
Layout redefines the bottom row but some important keys are missing, missing: change_method, config, switch_emoji, switch_numeric, switch_second
Layout doesn't specify a script.
3 warnings
# res/xml/numpad.xml
Layout includes some ASCII punctuation but not all, missing: !, ", #, $, %, &, ', (, ), ,, :, ;, <, >, ?, @, [, \, ], ^, _, `, {, |, }, ~
Layout doesn't define some important keys, missing: backspace, delete
Layout redefines the bottom row but some important keys are missing, missing: action, change_method, config, ctrl, down, enter, fn, left, right, space, switch_emoji, switch_numeric, switch_second, up
Layout doesn't specify a script.
4 warnings
# res/xml/pin.xml
Layout includes some ASCII punctuation but not all, missing: !, ", $, %, &, ', ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, ~
Layout redefines the bottom row but some important keys are missing, missing: change_method, config, ctrl, fn, switch_emoji, switch_second
Layout doesn't specify a script.
3 warnings
Not a layout file: res/xml/settings.xml
38 changes: 30 additions & 8 deletions check_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

warning_count = 0

KNOWN_NOT_LAYOUT = set([
"res/xml/number_row.xml", "res/xml/numpad.xml", "res/xml/pin.xml",
"res/xml/bottom_row.xml", "res/xml/settings.xml", "res/xml/method.xml",
"res/xml/greekmath.xml", "res/xml/numeric.xml" ])

def warn(msg):
global warning_count
print(msg)
Expand Down Expand Up @@ -31,27 +36,42 @@ def unexpected_keys(keys, symbols, msg):

def parse_layout(fname):
keys = set()
dup = set()
root = ET.parse(fname).getroot()
if root.tag != "keyboard":
return None
for row in root:
for key in row:
for attr in key.keys():
keys.add(key.get(attr).removeprefix("\\"))
return root, keys
if attr.startswith("key"):
k = key.get(attr).removeprefix("\\")
if k in keys: dup.add(k)
keys.add(k)
return root, keys, dup

def check_layout(layout):
root, keys = layout
root, keys, dup = layout
if len(dup) > 0: warn("Duplicate keys: " + key_list_str(dup))
missing_some_of(keys, "~!@#$%^&*(){}`[]=\\-_;:/.,?<>'\"+|", "ASCII punctuation")
missing_some_of(keys, "0123456789", "digits")
missing_some_of(keys, ["f11_placeholder", "f12_placeholder"])
missing_some_of(keys, ["esc", "tab"])
missing_required(keys, ["backspace", "delete"], "Layout doesn't define some important keys")
missing_required(keys,
["esc", "tab", "backspace", "delete",
"f11_placeholder", "f12_placeholder"],
"Layout doesn't define some important keys")
unexpected_keys(keys,
["copy", "paste", "cut", "selectAll", "shareText",
"pasteAsPlainText", "undo", "redo", "replaceText",
"textAssist", "autofill" ],
"Layout contains editing keys")
unexpected_keys(keys,
[ "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9",
"f10", "f11", "f12" ],
"Layout contains function keys")

bottom_row_keys = [
"ctrl", "fn", "switch_numeric", "change_method", "switch_emoji",
"config", "switch_second", "enter", "action", "left", "up", "right",
"down", "space"
"config", "switch_forward", "switch_backward", "enter", "action",
"left", "up", "right", "down", "space"
]

if root.get("bottom_row") == "false":
Expand All @@ -65,6 +85,8 @@ def check_layout(layout):
warn("Layout doesn't specify a script.")

for fname in sys.argv[1:]:
if fname in KNOWN_NOT_LAYOUT:
continue
layout = parse_layout(fname)
if layout == None:
print("Not a layout file: %s" % fname)
Expand Down
6 changes: 3 additions & 3 deletions gen_layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def mk_array(tag, name, strings_items):
item.text = s
elem.append(item)
return elem
none_item = [ ("none", "None") ]
system_item = [ ("system", "@string/pref_layout_e_system") ]
custom_item = [ ("custom", "@string/pref_layout_e_custom") ]
values_items, entries_items = zip(*(none_item + layouts + custom_item)) # unzip
ids_items = map(lambda s: "@xml/%s" % s if s not in ["none", "custom"] else "-1", values_items)
values_items, entries_items = zip(*(system_item + layouts + custom_item)) # unzip
ids_items = map(lambda s: "@xml/%s" % s if s not in ["system", "custom"] else "-1", values_items)
root = XML.Element("resources")
root.append(XML.Comment(text="DO NOT EDIT. This file is generated, see gen_layouts.py."))
root.append(mk_array("string-array", "pref_layout_values", values_items))
Expand Down
6 changes: 6 additions & 0 deletions metadata/android/es-ES/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
La característica principal es que hay acceso a más caractéres deslizando hacia las esquinas de las teclas.

Esta aplicación fue originalmente diseñada para programadores que usaran Termux.
Ahora es perfecta para uso cotidiano.

La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y es de Fuente Abierta.
2 changes: 1 addition & 1 deletion metadata/android/es-ES/short_description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Un teclado virtual ligero para desarrolladores.
Un teclado virtual ligero para Android consciente de su privacidad.
4 changes: 4 additions & 0 deletions res/layout/dialog_edit_text.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content">
<EditText android:id="@+id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp"/>
</LinearLayout>
3 changes: 2 additions & 1 deletion res/layout/launcher_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<TextView style="@style/paragraph" android:text="@string/launcher_description"/>
<Button style="@style/paragraph" android:text="@string/launcher_button_imesettings" android:onClick="launch_imesettings" android:layout_width="wrap_content"/>
<TextView style="@style/paragraph" android:text="@string/launcher_sourcecode" android:autoLink="web"/>
<TextView style="@style/paragraph" android:text="@string/launcher_sourcecode"/>
<TextView style="@style/paragraph" android:text="https://github.com/Julow/Unexpected-Keyboard" android:autoLink="web" android:linksClickable="true"/>
<TextView android:id="@+id/launcher_tryhere_text" style="@style/paragraph" android:text="@string/launcher_tryhere"/>
<EditText android:id="@+id/launcher_tryhere_area" style="@style/paragraph" android:inputType="text"/>
</LinearLayout>
4 changes: 4 additions & 0 deletions res/layout/pref_layouts_add_btn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:minHeight="?android:attr/listPreferredItemHeightSmall">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pref_layouts_add" android:textAppearance="?android:attr/textAppearanceListItemSmall"/>
</LinearLayout>
4 changes: 4 additions & 0 deletions res/layout/pref_listgroup_add_btn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center">
<View android:layout_width="@dimen/pref_button_size" android:layout_height="@dimen/pref_button_size" android:background="@android:drawable/ic_menu_add"/>
</LinearLayout>
3 changes: 3 additions & 0 deletions res/layout/pref_listgroup_group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center">
</LinearLayout>
4 changes: 4 additions & 0 deletions res/layout/pref_listgroup_item_widget.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal">
<Button android:id="@+id/pref_listgroup_remove_btn" android:layout_width="@dimen/pref_button_size" android:layout_height="@dimen/pref_button_size" android:layout_gravity="center" android:background="@android:drawable/ic_menu_close_clear_cancel"/>
</LinearLayout>
41 changes: 30 additions & 11 deletions res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@
<string name="pref_keyboard_opacity">Upravit průhlednost pozadí klávesnice</string>
<string name="pref_key_opacity">Upravit průhlednost kláves</string>
<string name="pref_key_activated_opacity">Upravit průhlednost stisknutých kláves</string>
<string name="pref_layout_title">Změnit rozvržení klávesnice</string>
<string name="pref_layout_e_system">Dle nastavení systému</string>
<string name="pref_layout_e_custom">Vlastní rozvržení</string>
<string name="pref_accents_title">(Univerzální) Diakritická znaménka</string>
<string name="pref_accents_e_all_installed">Zobrazovat znaménka pro všechny instalované systémové jazyky</string>
<string name="pref_accents_e_selected">Zobrazovat znaménka pouze pro současně zvolený jazyk</string>
<string name="pref_accents_e_none">Skrýt (univerzální) diakritická znaménka</string>
<string name="pref_layouts_add">Přidat alternativní rozložení</string>
<string name="pref_layouts_item">Rozložení %1$d: %2$s</string>
<!-- <string name="pref_layouts_remove_custom">Remove layout</string> -->
<string name="pref_custom_layout_title">Vlastní rozvržení</string>
<string name="pref_show_numpad_title">Zobrazit NumPad</string>
<string name="pref_show_numpad_never">Nikdy</string>
<string name="pref_show_numpad_landscape">Pouze v režimu na šířku</string>
<string name="pref_show_numpad_always">Vždy</string>
<string name="pref_number_row_title">Zobrazit řádek s čísly</string>
<string name="pref_number_row_summary">Přidá řádek s čísly nad klávesnici, pokud je NumPad skrytý</string>
<string name="pref_numpad_layout">Rozložení NumPadu</string>
<string name="pref_numpad_layout_e_high_first">Vyšší číslice jako první</string>
<string name="pref_numpad_layout_e_low_first">Nižší číslice jako první</string>
<string name="pref_numpad_layout_e_high_first">Vyšší číslice jako první (horní řádek 789)</string>
<string name="pref_numpad_layout_e_low_first">Nižší číslice jako první (horní řádek 123)</string>
<string name="pref_extra_keys_title">Přidat klávesy do klávesnice</string>
<string name="pref_extra_keys_custom">Přidat vlastní klávesy</string>
<string name="pref_extra_keys_internal">Výbrané klávesy k přidaní do klávesnice</string>
<string name="pref_second_layout_title">Vedlejší rozvržení</string>
<string name="pref_second_layout_none">Žádné</string>
<string name="pref_category_typing">Psaní</string>
Expand All @@ -43,6 +44,8 @@
<string name="pref_switch_input_immediate_summary">Jak bude klávesa pro přepnutí klávesnice reagovat</string>
<string name="pref_vibrate_title">Vibrace</string>
<string name="pref_vibrate_summary">Preference intenzity vibrací při stisku klávesy</string>
<string name="pref_pin_entry_enabled_title">Rozvržení zadávání PIN kódu</string>
<string name="pref_pin_entry_enabled_summary">Při psaní čísel, datumů a telefonních čísel</string>
<string name="pref_category_style">Styl</string>
<string name="pref_margin_bottom_title">Spodní odsazení</string>
<string name="pref_keyboard_height_title">Výška klávesnice</string>
Expand All @@ -64,9 +67,6 @@
<string name="pref_swipe_dist_e_very_far">Velmi dlouhá</string>
<string name="pref_key_horizontal_space">Horizontální mezery mezi klávesami</string>
<string name="pref_key_vertical_space">Vertikální mezery mezi klávesami</string>
<string name="pref_category_advanced">Pokročilé</string>
<string name="pref_custom_layout_title">Vlastní rozvržení</string>
<string name="pref_custom_layout_summary">Více informací naleznete ve zdrojovém kódu. Tato možnost není určena pro běžné užití.</string>
<string name="pref_vibration_e_disabled">Deaktivovány</string>
<string name="pref_vibration_e_system">Dle systému</string>
<string name="pref_vibration_e_strong">Silné</string>
Expand All @@ -80,6 +80,25 @@
<string name="key_action_send">Odeslat</string>
<string name="launcher_button_imesettings">Aktivovat klávesnici</string>
<string name="launcher_description">Tato aplikace je pouhou virtuální klávesnicí. Přejděte do systémového nastavení, kliknutím na tlačítko níže a aktivujte ji.</string>
<string name="launcher_sourcecode">Toto je volná, open-source aplikace. Její zdrojový kód, či hlášení chyb, naleznete na <a href="https://github.com/Julow/Unexpected-Keyboard/">Githubu</a>.</string>
<string name="launcher_sourcecode">Toto je volná, open-source aplikace. Její zdrojový kód, či hlášení chyb, naleznete na Githubu.</string>
<string name="launcher_tryhere">Po aktivaci můžete klávesnici rovnou vyzkoušet zde:</string>
<string name="key_descr_capslock">Caps lock</string>
<string name="key_descr_switch_greekmath">Řecké a matematické symboly</string>
<string name="key_descr_voice_typing">Hlasové zadávání</string>
<string name="key_descr_copy">Kopírovat</string>
<string name="key_descr_paste">Vložit</string>
<string name="key_descr_cut">Vyjmout</string>
<string name="key_descr_selectAll">Označit vše</string>
<string name="key_descr_shareText">Sdílet text</string>
<string name="key_descr_pasteAsPlainText">Vložit jako prostý text</string>
<string name="key_descr_undo">Zpět</string>
<string name="key_descr_redo">Znovu</string>
<string name="key_descr_replaceText">Nahradit</string>
<string name="key_descr_textAssist">Asistovat</string>
<string name="key_descr_autofill">Předvyplnit</string>
<string name="key_descr_ª">Indikátor řadové číslovky</string>
<string name="key_descr_º">Indikátor řadové číslovky</string>
<string name="key_descr_superscript">Horní index</string>
<string name="key_descr_subscript">Dolní index</string>
<string name="pref_category_advanced">Pokročilé</string>
</resources>
Loading

0 comments on commit b957fee

Please sign in to comment.