Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RZHSSNZDH authored Nov 1, 2023
2 parents a6aaa1a + 838fbc8 commit 1db17a3
Show file tree
Hide file tree
Showing 140 changed files with 3,103 additions and 1,251 deletions.
2 changes: 1 addition & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="35" android:versionName="1.23.0" android:hardwareAccelerated="false">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="36" android:versionName="1.24.0" android:hardwareAccelerated="false">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="33"/>
<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" android:exported="true" android:directBootAware="true">
Expand Down
32 changes: 24 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,32 @@ and other extra keys to show.

The list of language tags (generally two letters)
and locales (generally of the form `xx_XX`)
can be found in this stackoverflow answer: https://stackoverflow.com/a/7989085
can be found in this [stackoverflow answer](https://stackoverflow.com/a/7989085)

### Translations
### Updating translations

Translations are always welcome !
The text used in the app is written in `res/values-<language_tag>/strings.xml`.

See for example: 1723288 (Latvian), baf867a (French).
The app can be translated by writing `res/values-<language code>/strings.xml`
(for example `values-fr`, `values-lv`), based on the default:
`res/values/strings.xml` (English).
The list of language tags can be found in this
[stackoverflow answer](https://stackoverflow.com/a/7989085)

The first part before the `_` is used, for example,
`res/values-fr/strings.xml` for French,
`res/values-lv/strings.xml` for Latvian.

Commented-out lines indicate missing translations:

```xml
<!-- <string name="pref_layouts_add">Add an alternate layout</string> -->
```

Remove the `<!--` and `-->` parts and change the text.

### Adding a translation

The `res/values-<language_tag>/strings.xml` file must be created by copying the
default translation in `res/values/strings.xml`, which contain the structure of
the file and the English strings.

To check that `strings.xml` is formatted correctly, run
`python sync_translations.py`. This will modify your files.
Expand All @@ -152,7 +168,7 @@ The store description is found in `metadata/android/<locale>/`,
The short description must not exceed 80 characters.
Translating changelogs is not useful.

The app name might be partially translated, the "unexpected" word should remain
The app name might be partially translated, the "Unexpected" word should remain
untranslated.

As translations need to be updated regularly, you can subscribe to this issue
Expand Down
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
92 changes: 49 additions & 43 deletions check_layout.output
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
# res/xml/arab_alt.xml
Layout includes some ASCII punctuation but not all, missing: !, ", ', +, -, /, :, ;, <, =, >, ?, [, \, ], _, |, ~
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/arab_pc.xml
Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, |
1 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
# res/xml/arab_pc.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/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
0 warnings
# res/xml/cyrl_ueishsht.xml
0 warnings
# res/xml/cyrl_yaverti.xml
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 @@ -49,17 +53,26 @@ Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], {
1 warnings
# res/xml/latn_azerty_fr.xml
0 warnings
# res/xml/latn_bepo_fr.xml
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 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_cz.xml
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
# res/xml/latn_qwerty_es.xml
0 warnings
# res/xml/latn_qwerty_hu.xml
Expand All @@ -73,44 +86,37 @@ 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.xml
0 warnings
# res/xml/latn_qwertz_cz.xml
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
# res/xml/latn_qwertz_cz_multifunctional.xml
Layout includes some ASCII punctuation but not all, missing: `
1 warnings
# res/xml/latn_qwertz_cz.xml
0 warnings
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/latn_qwertz_de.xml
0 warnings
# res/xml/latn_qwertz_fr_ch.xml
0 warnings
# res/xml/latn_qwertz_hu.xml
0 warnings
# res/xml/latn_qwertz_sk.xml
Layout includes some ASCII punctuation but not all, missing: \, `
1 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.
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# res/xml/urdu_phonetic_ur.xml
Duplicate keys:
Layout includes some ASCII punctuation but not all, missing: <, >, ?, `, |, ~
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
3 warnings
Not a layout file: res/xml/settings.xml
40 changes: 31 additions & 9 deletions check_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

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",
"res/xml/emoji_bottom_row.xml" ])

def warn(msg):
global warning_count
print(msg)
Expand Down Expand Up @@ -31,27 +37,41 @@ 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" ],
"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 @@ -64,7 +84,9 @@ def check_layout(layout):
if root.get("script") == None:
warn("Layout doesn't specify a script.")

for fname in sys.argv[1:]:
for fname in sorted(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
9 changes: 9 additions & 0 deletions metadata/android/en-US/changelogs/36.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Allow selecting any number of standard and custom layouts.
Allow adding custom keys to the keyboard.
Changed behavior of auto-added keys (often dead-keys).
New layouts.
Improved layouts and language support.
Improved the space bar slider, and many more.
Updated translations.

Thanks to the contributors: @ChasmSolacer, @ElucGeek, @GoRaN909, @RZHSSNZDH, @Shareef101, @Validbit, @eandersons, @nitsvga, @polyctena, @sdrapha, @syskill
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.
6 changes: 6 additions & 0 deletions metadata/android/tr-TR/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bu uygulama özünde tuşların kenarlarından kaydırarak daha fazla karakter yazabilmek amacıyla geliştirildi.

Bu uygulama aslında Termux kullanıcıları için geliştirildi.
Artık gündelik kullanım için de uygun.

Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz.
1 change: 1 addition & 0 deletions metadata/android/tr-TR/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Android için hafif ve güvenlik odaklı bir sanal klavye uygulaması.
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>
5 changes: 1 addition & 4 deletions res/layout/emoji_pane.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<juloo.keyboard2.EmojiGroupButtonsBar android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height" android:orientation="vertical" android:numColumns="auto_fit" android:columnWidth="45sp" android:background="?attr/colorKeyboard"/>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" key="switch_back_emoji"/>
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" android:layout_weight="4" key="space"/>
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" key="backspace"/>
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" key="enter"/>
<juloo.keyboard2.EmojiBottomRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="?attr/emoji_key_bg"/>
</LinearLayout>
</LinearLayout>
5 changes: 0 additions & 5 deletions res/layout/extra_keys_preference.xml

This file was deleted.

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>
Loading

0 comments on commit 1db17a3

Please sign in to comment.