Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73b73d89a2 | ||
|
|
06cb2526a4 | ||
|
|
12a95a4604 | ||
|
|
b263d75373 | ||
|
|
495da34e37 | ||
|
|
a2fc16baeb | ||
|
|
98cf27a3a9 | ||
|
|
31eecc2a13 | ||
|
|
08c895aa12 | ||
|
|
be6f455b01 | ||
|
|
5cba22a19a | ||
|
|
0f2f8a47ff | ||
|
|
affc78fb63 | ||
|
|
5781fb6efc | ||
|
|
6be0938566 | ||
|
|
4520271c8f | ||
|
|
656c1e24f4 | ||
|
|
eb9a5103c2 | ||
|
|
f59603c90b | ||
|
|
4534df8bcb | ||
|
|
ecdb43a593 | ||
|
|
939e8da252 | ||
|
|
e2d5b47c7c | ||
|
|
96966332ce | ||
|
|
b034191a1c | ||
|
|
b86481461a | ||
|
|
5fbd21c7d9 | ||
|
|
b6618444a2 | ||
|
|
4a05bf54d5 | ||
|
|
9c70f1113e | ||
|
|
c0a4bca8e2 | ||
|
|
b6ba00a1f6 | ||
|
|
43550a3ad1 | ||
|
|
b73ac529e8 | ||
|
|
f192dfcb32 | ||
|
|
4ab921f112 | ||
|
|
44dcf6e753 | ||
|
|
ccd9568e3d | ||
|
|
21633f22fd | ||
|
|
c6a568a74b | ||
|
|
241e034a3f | ||
|
|
27329091af | ||
|
|
a7645c3934 | ||
|
|
374c47af9d | ||
|
|
49627b63e3 |
@@ -36,6 +36,8 @@ jobs:
|
||||
java-version: '17'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: 8.14.4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
@@ -11,3 +11,4 @@
|
||||
# Directory _build is not used anymore
|
||||
/_build
|
||||
/release
|
||||
vendor/libswipetype/
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Harley's Keyboard - agent notes
|
||||
|
||||
Fork of Julow/Unexpected-Keyboard (Unexpected Keyboard). Android IME, Java, Gradle Kotlin DSL.
|
||||
|
||||
## Build & test (exact)
|
||||
|
||||
```bash
|
||||
./gradlew testDebugUnitTest assembleDebug # full verification: unit tests THEN the APK
|
||||
./gradlew clean assembleDebug # when a generated file may be stale
|
||||
```
|
||||
|
||||
- SDK: `local.properties` -> `sdk.dir=/home/nyra/android-sdk` (present, gitignored, do not commit).
|
||||
- JDK 21, build-tools 34.0.0/36.0.0, AGP 8.8.2, compileSdk 36, minSdk 21.
|
||||
- APK: `build/outputs/apk/debug/Unexpected-Keyboard-debug.apk`, package id `harley.keyboard`.
|
||||
|
||||
## Layout & generated code
|
||||
|
||||
- Layout rows live in `srcs/layouts/*.xml`. A layout edit needs a **full build**, not just compile:
|
||||
`gen_layouts.py` regenerates `res/values/layouts.xml`, `res/raw/*.xml` and
|
||||
`srcs/juloo.keyboard2/ComposeKeyData.java`. Unit tests run before regeneration report
|
||||
stale-generated-state failures that are not real bugs.
|
||||
- Never hand-edit generated files (`res/values/layouts.xml`, `res/raw/*`, `ComposeKeyData.java`,
|
||||
`res/xml/method.xml`).
|
||||
|
||||
## Always do
|
||||
|
||||
- Run `./gradlew testDebugUnitTest assembleDebug` before reporting done.
|
||||
- Keep user-visible text in `res/values/strings.xml`.
|
||||
- Keep all network access off the UI thread.
|
||||
|
||||
## Ask first
|
||||
|
||||
- Adding any dependency (prefer the framework: `org.json`, `HttpURLConnection`).
|
||||
- Changing the package id, signing config or versionCode.
|
||||
|
||||
## Never do
|
||||
|
||||
- Commit or print secrets/tokens; no credentials in code, XML, tests or logs.
|
||||
- Touch `.git` internals, force-push, or edit CI workflows.
|
||||
- Enable cleartext HTTP globally (only a per-host network security config).
|
||||
- Change the space-bar peak-colour behaviour (a separate, deliberate feature).
|
||||
|
||||
## Definition of done
|
||||
|
||||
`./gradlew testDebugUnitTest assembleDebug` exits 0, new behaviour is covered by unit tests,
|
||||
and the tree has no generated-file diffs beyond what a normal build produces.
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:hardwareAccelerated="false">
|
||||
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:hardwareAccelerated="false" android:networkSecurityConfig="@xml/network_security_config">
|
||||
<service android:name="juloo.keyboard2.Keyboard2" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD" android:exported="true" android:directBootAware="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.view.InputMethod"/>
|
||||
|
||||
Binary file not shown.
+2
-3
@@ -17,7 +17,7 @@ android {
|
||||
compileSdkVersion = "android-36"
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "juloo.keyboard2"
|
||||
applicationId = "harley.keyboard"
|
||||
minSdk = 21
|
||||
targetSdk { version = release(36) }
|
||||
versionCode = 55
|
||||
@@ -82,7 +82,6 @@ android {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
isDebuggable = true
|
||||
applicationIdSuffix = ".debug"
|
||||
resValue("string", "app_name", "@string/app_name_debug")
|
||||
resValue("bool", "debug_logs", "true")
|
||||
signingConfig = signingConfigs["debug"]
|
||||
@@ -194,4 +193,4 @@ tasks.named("preBuild") {
|
||||
// checked in the repository that don't need to be updated during regular
|
||||
// builds.
|
||||
mustRunAfter(genEmojis, genLayoutsList, compileComposeSequences, genMethodXml)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -25,7 +25,7 @@ latin_kbdtuf_tr: These keys are now added automatically, unexpected: f11_placeho
|
||||
latin_kbdtuf_tr: Missing programming keys, missing: loc esc, loc tab
|
||||
latn_colemak: Some keys contain whitespaces, unexpected: ́
|
||||
latn_dvorak: Missing important key, missing: loc capslock
|
||||
latn_neo2: Layout redefines the bottom row but some important keys are missing, missing: loc switch_clipboard
|
||||
latn_neo2: Layout redefines the bottom row but some important keys are missing, missing: alt, loc switch_clipboard, meta, pgdn, pgup, switch_fn
|
||||
latn_qwertz_cz_multifunctional: Layout includes some ASCII punctuation but not all, missing: `
|
||||
latn_qwertz_sk: Layout includes some ASCII punctuation but not all, missing: `
|
||||
latn_qzerty_it: Layout includes some ASCII punctuation but not all, missing: #, $, \, `, ~
|
||||
|
||||
+36
-19
@@ -43,37 +43,50 @@ def unexpected_keys(keys, symbols, msg):
|
||||
if len(unexpected) > 0:
|
||||
warn("%s, unexpected: %s" % (msg, key_list_str(unexpected)))
|
||||
|
||||
# Write to [keys] and [dup].
|
||||
def parse_row_from_et(row, keys, dup):
|
||||
for key in row:
|
||||
for attr in key.keys():
|
||||
def duplicates(keys):
|
||||
dup = [ k for k, key_elts in keys.items() if len(key_elts) >= 2 ]
|
||||
if len(dup) > 0:
|
||||
warn("Duplicate keys: " + key_list_str(dup))
|
||||
|
||||
def should_have_role(keys_map, role, keys):
|
||||
def is_center_key(key):
|
||||
def center(key_elt): return key_elt.get("key0", key_elt.get("c"))
|
||||
return any(( center(key_elt) == key for key_elt in keys_map.get(key, []) ))
|
||||
def key_roles(key):
|
||||
return ( key_elt.get("role", "normal") for key_elt in keys_map[key] )
|
||||
for key in keys:
|
||||
if is_center_key(key) and role not in key_roles(key):
|
||||
warn("Key '%s' is not on a key with role=\"%s\"" % (key, role))
|
||||
|
||||
# Write to [keys], dict of keyvalue to the key elements they appear in
|
||||
def parse_row_from_et(row, keys):
|
||||
for key_elt in row:
|
||||
for attr in key_elt.keys():
|
||||
if attr in KEY_ATTRIBUTES:
|
||||
k = key.get(attr).removeprefix("\\")
|
||||
if k in keys: dup.add(k)
|
||||
keys.add(k)
|
||||
k = key_elt.get(attr).removeprefix("\\")
|
||||
keys.setdefault(k, []).append(key_elt)
|
||||
|
||||
def parse_layout(fname):
|
||||
keys = set()
|
||||
dup = set()
|
||||
keys = {}
|
||||
root = ET.parse(fname).getroot()
|
||||
if root.tag != "keyboard":
|
||||
return None
|
||||
for row in root:
|
||||
parse_row_from_et(row, keys, dup)
|
||||
return root, keys, dup
|
||||
parse_row_from_et(row, keys)
|
||||
return root, keys
|
||||
|
||||
def parse_row(fname):
|
||||
keys = set()
|
||||
dup = set()
|
||||
keys = {}
|
||||
root = ET.parse(fname).getroot()
|
||||
if root.tag != "row":
|
||||
return None
|
||||
parse_row_from_et(root, keys, dup)
|
||||
return root, keys, dup
|
||||
parse_row_from_et(root, keys)
|
||||
return root, keys
|
||||
|
||||
def check_layout(layout):
|
||||
root, keys, dup = layout
|
||||
if len(dup) > 0: warn("Duplicate keys: " + key_list_str(dup))
|
||||
root, keys_map = layout
|
||||
keys = set(keys_map.keys())
|
||||
duplicates(keys_map)
|
||||
missing_some_of(keys, "~!@#$%^&*(){}`[]=\\-_;:/.,?<>'\"+|", "ASCII punctuation")
|
||||
missing_some_of(keys, "0123456789", "digits")
|
||||
missing_required(keys, ["backspace", "delete"], "Layout doesn't define some important keys")
|
||||
@@ -94,8 +107,8 @@ def check_layout(layout):
|
||||
missing_required(keys, ["shift", "loc capslock"], "Missing important key")
|
||||
missing_required(keys, ["loc esc", "loc tab"], "Missing programming keys")
|
||||
|
||||
_, bottom_row_keys, _ = parse_row("res/xml/bottom_row.xml")
|
||||
|
||||
_, bottom_row_keys_map = parse_row("res/xml/bottom_row.xml")
|
||||
bottom_row_keys = set(bottom_row_keys_map.keys())
|
||||
if root.get("bottom_row") == "false":
|
||||
missing_required(keys, bottom_row_keys,
|
||||
"Layout redefines the bottom row but some important keys are missing")
|
||||
@@ -106,6 +119,10 @@ def check_layout(layout):
|
||||
if root.get("script") == None:
|
||||
warn("Layout doesn't specify a script.")
|
||||
|
||||
should_have_role(keys_map, "action",
|
||||
[ "shift", "ctrl", "fn", "backspace", "enter" ])
|
||||
should_have_role(keys_map, "space_bar", [ "space" ])
|
||||
|
||||
keys_without_loc = set(( k.removeprefix("loc ") for k in keys ))
|
||||
# Keys with a len under 3 are often composed characters
|
||||
special_keys = set(( k for k in keys_without_loc if len(k) > 3 and ":" not in k ))
|
||||
|
||||
@@ -190,6 +190,16 @@ Value | Meaning
|
||||
`voice_typing` | Begin voice typing.
|
||||
`voice_typing_chooser` | Shows a menu where you can choose which voice typing provider to use, then begins voice typing when you make a selection.
|
||||
`shareText` | Emit a share Intent for the selected text. **Oddity:** This is in CamelCase.
|
||||
`hide_self` | Hide the keyboard.
|
||||
|
||||
## Suggestions
|
||||
|
||||
Value | Meaning
|
||||
:---- | :------
|
||||
`complete_first` | Enter the best suggestion (the one in the middle)
|
||||
`complete_second` | Enter the second best suggestion (the right one)
|
||||
`complete_third` | Enter the third best suggestion (the left one)
|
||||
`complete_emoji` | Enter the emoji suggestion
|
||||
|
||||
## Unused
|
||||
These keys are known to do nothing.
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ LOCALES = [
|
||||
loc("gl", "latin", "latn_qwerty_us"),
|
||||
loc("ha_NG", "latin", "latn_qwerty_us", extra_keys="₦|ɓ|ɗ|ƙ|’|ƴ|r̃"),
|
||||
loc("haw_US", "latin", "latn_qwerty_haw", extra_keys="ʻ@l|accent_macron:ā:ē:ī:ō:ū@m"),
|
||||
loc("he_IL", "hebrew", "default_layout=hebr_1_il,extra_keys=₪@r|€"),
|
||||
loc("he_IL", "hebrew", "hebr_1_il", extra_keys="₪@r"),
|
||||
loc("hi_IN", "devanagari", "deva_inscript", extra_keys="₹"),
|
||||
loc("hr", "latin", "latn_qwerty_us", extra_keys="č|ć|dž|đ|lj|nj|š|ž"),
|
||||
loc("hu_HU", "latin", "latn_qwertz_hu", extra_keys="accent_aigu:á:é:í:ó:ú@d|accent_trema:ö:ü@u|accent_ogonek@s|accent_double_aigu:ő:ű@k|€"),
|
||||
|
||||
@@ -154,7 +154,6 @@
|
||||
<string name="pref_dialog_edit_text">eigene Definition</string>
|
||||
<string name="dictionaries_from_internet">Lade ein Wörterbuch aus dem Internet</string>
|
||||
<string name="dictionaries_download_success">Wörterbuch installiert</string>
|
||||
<string name="dictionaries_download_failed">Herunterladen fehlgeschlagen</string>
|
||||
<string name="dictionaries_activity_not_enabled">Du musst die Tastatur aktivieren um Wörterbücher herunterzuladen.</string>
|
||||
<string name="pref_portrait_unfolded">im Hochformat aufgeklappt</string>
|
||||
<string name="pref_landscape_unfolded">Im Querformat aufgeklappt</string>
|
||||
|
||||
@@ -159,6 +159,5 @@
|
||||
<string name="pref_dialog_edit_text">Definición personalizada</string>
|
||||
<string name="dictionaries_from_internet">Descargar un diccionario de internet</string>
|
||||
<string name="dictionaries_download_success">Diccionario instalado</string>
|
||||
<string name="dictionaries_download_failed">Falló la descarga</string>
|
||||
<string name="dictionaries_activity_not_enabled">Primero tienes que habilitar al teclado para descargar diccionarios.</string>
|
||||
</resources>
|
||||
|
||||
@@ -144,7 +144,6 @@
|
||||
<string name="key_descr_end">Lõpp</string>
|
||||
<string name="key_descr_ª">Järgarvu tunnus</string>
|
||||
<string name="dictionaries_download_success">Sõnastik on paigaldatud</string>
|
||||
<string name="dictionaries_download_failed">Allalaadimine ei õnnestunud</string>
|
||||
<string name="dictionaries_activity_not_enabled">Sõnastike allalaadimiseks pead esmalt klahvistiku kasutusele võtma.</string>
|
||||
<string name="key_descr_clipboard">Lõikelaua haldur</string>
|
||||
<string name="key_descr_combining">Täpitähemärkide kombineerimine</string>
|
||||
|
||||
@@ -132,6 +132,5 @@
|
||||
<string name="pref_clipboard_history_duration_stop">تا زمان بسته شدن برنامه</string>
|
||||
<string name="dictionaries_from_internet">دانلود دیکشنری از اینترنت</string>
|
||||
<string name="dictionaries_download_success">دیکشنری نصب شد</string>
|
||||
<string name="dictionaries_download_failed">دانلود با خطا مواجه شد</string>
|
||||
<string name="dictionaries_activity_not_enabled">شما ابتدا باید صفحه کلید را برای دانلود دیکشنری ها فعال کنید.</string>
|
||||
</resources>
|
||||
|
||||
@@ -159,7 +159,6 @@
|
||||
<string name="pref_dialog_edit_text">Personnalisée</string>
|
||||
<string name="dictionaries_from_internet">Télécharger un dictionnaire depuis Internet</string>
|
||||
<string name="dictionaries_download_success">Dictionnaire installé</string>
|
||||
<string name="dictionaries_download_failed">Le téléchargement a échoué</string>
|
||||
<string name="dictionaries_activity_not_enabled">Vous devez d\'abord activer le clavier.</string>
|
||||
<string name="candidates_status_click_to_install">Cliquez pour installer un dictionnaire pour le %s</string>
|
||||
</resources>
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
<string name="pref_theme_e_epaperblack">ePapīrs melns</string>
|
||||
<string name="launcher_button_dictionaries">Uzstādīt vārdnīcas</string>
|
||||
<string name="dictionaries_download_success">Vārdnīca uzstādīta</string>
|
||||
<string name="dictionaries_download_failed">Neizdevās lejupielādēt</string>
|
||||
<string name="key_descr_delete_word">Dzēst vārdu</string>
|
||||
<string name="pref_clipboard_history_duration">Starpliktuves glabāšanas ilgums</string>
|
||||
<string name="pref_change_method_key_replacement_e_prev">Pārslēgties uz pēdējo izmantoto</string>
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
<string name="pref_clipboard_history_duration_stop">Do zatrzymania aplikacji</string>
|
||||
<string name="dictionaries_from_internet">Pobierz słownik z internetu</string>
|
||||
<string name="dictionaries_download_success">Słownik zainstalowany</string>
|
||||
<string name="dictionaries_download_failed">Pobieranie nieudane</string>
|
||||
<string name="dictionaries_activity_not_enabled">Aby pobrać słowniki, najpierw włącz klawiaturę.</string>
|
||||
<string name="pref_dialog_edit_text">Własna definicja</string>
|
||||
</resources>
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
<string name="pref_clipboard_history_duration_stop">До остановки приложения</string>
|
||||
<string name="dictionaries_from_internet">Загрузить словарь из Интернета</string>
|
||||
<string name="dictionaries_download_success">Словарь установлен</string>
|
||||
<string name="dictionaries_download_failed">Ошибка при загрузке</string>
|
||||
<string name="dictionaries_activity_not_enabled">Необходимо включить клавиатуру до загрузки словарей.</string>
|
||||
<string name="pref_dialog_edit_text">Собственное определение</string>
|
||||
<string name="candidates_status_click_to_install">Нажмите, чтобы установить словарь для %s</string>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Colors for the Monet themes. -->
|
||||
<color name="system_accent1_100">@android:color/system_accent1_100</color>
|
||||
<color name="system_accent1_200">@android:color/system_accent1_200</color>
|
||||
<color name="system_accent1_400">@android:color/system_accent1_400</color>
|
||||
<color name="system_accent1_600">@android:color/system_accent1_600</color>
|
||||
<color name="system_accent2_900">@android:color/system_accent2_900</color>
|
||||
<color name="system_neutral1_0">@android:color/system_neutral1_0</color>
|
||||
<color name="system_neutral1_100">@android:color/system_neutral1_100</color>
|
||||
<color name="system_neutral1_400">@android:color/system_neutral1_400</color>
|
||||
|
||||
@@ -159,6 +159,5 @@
|
||||
<string name="pref_dialog_edit_text">自定義</string>
|
||||
<string name="dictionaries_from_internet">從網路下載字典</string>
|
||||
<string name="dictionaries_download_success">字典已安裝</string>
|
||||
<string name="dictionaries_download_failed">下載失敗</string>
|
||||
<string name="dictionaries_activity_not_enabled">需要啟用鍵盤才能下載字典。</string>
|
||||
</resources>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<item>@string/pref_theme_e_everforestlight</item>
|
||||
<item>@string/pref_theme_e_cobalt</item>
|
||||
<item>@string/pref_theme_e_pine</item>
|
||||
<item>@string/pref_theme_e_orchid</item>
|
||||
<item>@string/pref_theme_e_epaperblack</item>
|
||||
</string-array>
|
||||
<string-array name="pref_theme_values">
|
||||
@@ -64,6 +65,7 @@
|
||||
<item>everforestlight</item>
|
||||
<item>cobalt</item>
|
||||
<item>pine</item>
|
||||
<item>orchid</item>
|
||||
<item>epaperblack</item>
|
||||
</string-array>
|
||||
<string-array name="pref_swipe_dist_entries">
|
||||
@@ -134,4 +136,22 @@
|
||||
<item>prev</item>
|
||||
<item>next</item>
|
||||
</string-array>
|
||||
<string-array name="pref_physical_keyboard_behavior_entries">
|
||||
<item>@string/pref_physical_keyboard_behavior_hide</item>
|
||||
<item>@string/pref_physical_keyboard_behavior_show</item>
|
||||
</string-array>
|
||||
<string-array name="pref_physical_keyboard_behavior_values">
|
||||
<item>hide</item>
|
||||
<item>show</item>
|
||||
</string-array>
|
||||
<string-array name="pref_split_layout_entries">
|
||||
<item>@string/pref_split_layout_wide</item>
|
||||
<item>@string/pref_split_layout_landscape</item>
|
||||
<item>@string/pref_split_layout_never</item>
|
||||
</string-array>
|
||||
<string-array name="pref_split_layout_values">
|
||||
<item>wide</item>
|
||||
<item>landscape</item>
|
||||
<item>never</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
+14
-3
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name_release">Unexpected Keyboard</string>
|
||||
<string name="app_name_debug">Unexpected Keyboard (Debug)</string>
|
||||
<string name="app_name_release">Harley\'s Keyboard</string>
|
||||
<string name="app_name_debug">Harley\'s Keyboard</string>
|
||||
<string name="short_description">Lightweight and privacy-conscious virtual keyboard for Android.</string>
|
||||
<string name="store_description">The main feature is that you can type more characters by swiping the keys towards the corners.\n\nThis application was originally designed for programmers using Termux.\nNow perfect for everyday use.\n\nThis application contains no ads and is Open Source.</string>
|
||||
<string name="pref_portrait">In portrait mode</string>
|
||||
@@ -9,6 +9,9 @@
|
||||
<string name="pref_landscape">In landscape mode</string>
|
||||
<string name="pref_landscape_unfolded">In landscape mode unfolded</string>
|
||||
<string name="pref_category_layout">Layout</string>
|
||||
<string name="pref_usage_gauge_enabled">Usage gauge key</string>
|
||||
<string name="pref_usage_gauge_url">Usage gauge URL</string>
|
||||
<string name="pref_usage_gauge_token">Usage gauge bearer token</string>
|
||||
<string name="pref_label_brightness">Adjust label brightness</string>
|
||||
<string name="pref_keyboard_opacity">Adjust keyboard background opacity</string>
|
||||
<string name="pref_key_opacity">Adjust key opacity</string>
|
||||
@@ -82,6 +85,7 @@
|
||||
<string name="pref_theme_e_everforestlight">Everforest Light</string>
|
||||
<string name="pref_theme_e_cobalt">Cobalt</string>
|
||||
<string name="pref_theme_e_pine">Pine</string>
|
||||
<string name="pref_theme_e_orchid">Orchid</string>
|
||||
<string name="pref_theme_e_epaperblack">ePaper Black</string>
|
||||
<string name="pref_swipe_dist_e_very_short">Very short</string>
|
||||
<string name="pref_swipe_dist_e_short">Short</string>
|
||||
@@ -159,7 +163,14 @@
|
||||
<string name="pref_dialog_edit_text">Custom definition</string>
|
||||
<string name="dictionaries_from_internet">Download a dictionary from the Internet</string>
|
||||
<string name="dictionaries_download_success">Dictionary installed</string>
|
||||
<string name="dictionaries_download_failed">Download failed</string>
|
||||
<string name="dictionaries_download_failed">Download failed: Please allow internet access</string>
|
||||
<string name="dictionaries_activity_not_enabled">You must first enable the keyboard to download dictionaries.</string>
|
||||
<string name="candidates_status_click_to_install">Click to install a dictionary for %s</string>
|
||||
<string name="pref_physical_keyboard_behavior">When a physical keyboard is connected</string>
|
||||
<string name="pref_physical_keyboard_behavior_hide">Hide everything</string>
|
||||
<string name="pref_physical_keyboard_behavior_show">Show everything</string>
|
||||
<string name="pref_split_layout">Split layout</string>
|
||||
<string name="pref_split_layout_never">Never</string>
|
||||
<string name="pref_split_layout_landscape">In landscape orientation</string>
|
||||
<string name="pref_split_layout_wide">On wide screens</string>
|
||||
</resources>
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<attr name="colorKey" format="color"/>
|
||||
<!-- Background of the keys when pressed -->
|
||||
<attr name="colorKeyActivated" format="color"/>
|
||||
<!-- Adjust the lightness of keys depending on their role. -->
|
||||
<attr name="colorKeyAction" format="color"/>
|
||||
<attr name="colorKeySpaceBar" format="color"/>
|
||||
<!-- Label colors -->
|
||||
<attr name="colorLabel" format="color"/>
|
||||
<attr name="colorLabelPressed" format="color"/> <!-- defaults to colorLabel -->
|
||||
@@ -20,6 +23,8 @@
|
||||
<attr name="keyBorderRadius" format="dimension"/>
|
||||
<attr name="keyBorderWidth" format="dimension"/>
|
||||
<attr name="keyBorderWidthActivated" format="dimension"/>
|
||||
<attr name="keyBorderWidthAction" format="dimension"/>
|
||||
<attr name="keyBorderWidthSpaceBar" format="dimension"/>
|
||||
<attr name="keyBorderColorLeft" format="color"/>
|
||||
<attr name="keyBorderColorTop" format="color"/>
|
||||
<attr name="keyBorderColorRight" format="color"/>
|
||||
@@ -46,6 +51,8 @@
|
||||
<item name="keyBorderRadius">5dp</item>
|
||||
<item name="keyBorderWidth">0dp</item>
|
||||
<item name="keyBorderWidthActivated">0dp</item>
|
||||
<item name="keyBorderWidthAction">?attr/keyBorderWidth</item>
|
||||
<item name="keyBorderWidthSpaceBar">?attr/keyBorderWidth</item>
|
||||
<item name="secondaryDimming">0.25</item>
|
||||
<item name="greyedDimming">0.5</item>
|
||||
<item name="emoji_key_bg" type="color">?attr/emoji_button_bg</item>
|
||||
@@ -60,8 +67,12 @@
|
||||
<item name="colorKeyboard">#1b1b1b</item>
|
||||
<item name="colorKey">#333333</item>
|
||||
<item name="colorKeyActivated">#1b1b1b</item>
|
||||
<item name="colorKeyAction">#262626</item>
|
||||
<item name="colorKeySpaceBar">#2b2b2b</item>
|
||||
<item name="keyBorderWidth">1.2dp</item>
|
||||
<item name="keyBorderWidthActivated">0dp</item>
|
||||
<item name="keyBorderWidthAction">0dp</item>
|
||||
<item name="keyBorderWidthSpaceBar">0dp</item>
|
||||
<item name="keyBorderColorBottom">#404040</item>
|
||||
<item name="colorLabel">#ffffff</item>
|
||||
<item name="colorLabelActivated">#3399ff</item>
|
||||
@@ -75,8 +86,12 @@
|
||||
<item name="colorKeyboard">#e3e3e3</item>
|
||||
<item name="colorKey">#cccccc</item>
|
||||
<item name="colorKeyActivated">#e3e3e3</item>
|
||||
<item name="colorKeyAction">#d9d9d9</item>
|
||||
<item name="colorKeySpaceBar">#dedede</item>
|
||||
<item name="keyBorderWidth">0.6dp</item>
|
||||
<item name="keyBorderWidthActivated">0dp</item>
|
||||
<item name="keyBorderWidthAction">0dp</item>
|
||||
<item name="keyBorderWidthSpaceBar">0dp</item>
|
||||
<item name="keyBorderColorLeft">#cccccc</item>
|
||||
<item name="keyBorderColorTop">#eeeeee</item>
|
||||
<item name="keyBorderColorRight">#cccccc</item>
|
||||
@@ -93,6 +108,8 @@
|
||||
<item name="colorKeyboard">#000000</item>
|
||||
<item name="colorKey">#000000</item>
|
||||
<item name="colorKeyActivated">#333333</item>
|
||||
<item name="colorKeyAction">#000000</item>
|
||||
<item name="colorKeySpaceBar">#000000</item>
|
||||
<item name="keyBorderWidth">0dp</item>
|
||||
<item name="keyBorderWidthActivated">1dp</item>
|
||||
<item name="keyBorderColorLeft">#2a2a2a</item>
|
||||
@@ -114,6 +131,8 @@
|
||||
<item name="android:isLightTheme">true</item>
|
||||
<item name="colorKeyboard">#ffffff</item>
|
||||
<item name="colorKey">#ffffff</item>
|
||||
<item name="colorKeyAction">#ffffff</item>
|
||||
<item name="colorKeySpaceBar">#ffffff</item>
|
||||
<item name="keyBorderWidth">1dp</item>
|
||||
<item name="keyBorderWidthActivated">1dp</item>
|
||||
<item name="keyBorderColorLeft">#f0f0f0</item>
|
||||
@@ -133,6 +152,8 @@
|
||||
<item name="android:isLightTheme">true</item>
|
||||
<item name="colorKeyboard">#ffffff</item>
|
||||
<item name="colorKey">#ffffff</item>
|
||||
<item name="colorKeyAction">#ffffff</item>
|
||||
<item name="colorKeySpaceBar">#ffffff</item>
|
||||
<item name="keyBorderWidth">2dp</item>
|
||||
<item name="keyBorderWidthActivated">5dp</item>
|
||||
<item name="keyBorderColorLeft">#000000</item>
|
||||
@@ -154,6 +175,8 @@
|
||||
<item name="colorKeyboard">#ffe0b2</item>
|
||||
<item name="colorKey">#fff3e0</item>
|
||||
<item name="colorKeyActivated">#ffcc80</item>
|
||||
<item name="colorKeyAction">#ffe9c6</item>
|
||||
<item name="colorKeySpaceBar">#ffedd0</item>
|
||||
<item name="colorLabel">#000000</item>
|
||||
<item name="colorLabelActivated">#ffffff</item>
|
||||
<item name="colorLabelLocked">#e65100</item>
|
||||
@@ -172,6 +195,8 @@
|
||||
<item name="colorKeyboard">#4db6ac</item>
|
||||
<item name="colorKey">#e0f2f1</item>
|
||||
<item name="colorKeyActivated">#00695c</item>
|
||||
<item name="colorKeyAction">#b8e3de</item>
|
||||
<item name="colorKeySpaceBar">#c3e7e3</item>
|
||||
<item name="colorLabel">#000000</item>
|
||||
<item name="colorLabelActivated">#ffffff</item>
|
||||
<item name="colorLabelLocked">#64ffda</item>
|
||||
@@ -190,6 +215,8 @@
|
||||
<item name="colorKeyboard">@color/system_neutral1_100</item>
|
||||
<item name="colorKey">@color/system_neutral1_50</item>
|
||||
<item name="colorKeyActivated">?colorKeyboard</item>
|
||||
<item name="colorKeyAction">@color/system_accent1_100</item>
|
||||
<item name="colorKeySpaceBar">@color/system_accent1_200</item>
|
||||
<item name="colorLabel">@color/system_neutral1_800</item>
|
||||
<item name="colorLabelActivated">@color/system_accent1_400</item>
|
||||
<item name="colorLabelLocked">@color/system_accent1_600</item>
|
||||
@@ -202,6 +229,7 @@
|
||||
<item name="colorKeyboard">@color/system_neutral1_900</item>
|
||||
<item name="colorKey">@color/system_neutral1_800</item>
|
||||
<item name="colorKeyActivated">?colorKeyboard</item>
|
||||
<item name="colorKeyAction">@color/system_accent2_900</item>
|
||||
<item name="colorLabel">@color/system_neutral1_0</item>
|
||||
<item name="colorLabelActivated">@color/system_accent1_400</item>
|
||||
<item name="colorLabelLocked">@color/system_accent1_600</item>
|
||||
@@ -214,6 +242,8 @@
|
||||
<item name="colorKeyboard">#191724</item>
|
||||
<item name="colorKey">#26233a</item>
|
||||
<item name="colorKeyActivated">#403d52</item>
|
||||
<item name="colorKeyAction">#2a2740</item>
|
||||
<item name="colorKeySpaceBar">#2e2b47</item>
|
||||
<item name="keyBorderWidth">0dp</item>
|
||||
<item name="keyBorderWidthActivated">1dp</item>
|
||||
<item name="keyBorderColorLeft">#6e6a86</item>
|
||||
@@ -281,6 +311,25 @@
|
||||
<item name="emoji_color">?colorLabel</item>
|
||||
<item name="clipboard_divider_color">?colorKey</item>
|
||||
</style>
|
||||
<style name="Orchid" parent="BaseTheme">
|
||||
<item name="android:isLightTheme">false</item>
|
||||
<item name="colorKeyboard">#100a1c</item>
|
||||
<item name="colorKey">?colorKeyboard</item>
|
||||
<item name="colorKeyActivated">#a855f7</item>
|
||||
<item name="colorLabel">#ff8ad8</item>
|
||||
<item name="colorLabelActivated">?colorKey</item>
|
||||
<item name="colorLabelLocked">#9db8ff</item>
|
||||
<item name="colorSubLabel">#c67dff</item>
|
||||
<item name="keyBorderWidth">0.0dip</item>
|
||||
<item name="keyBorderWidthActivated">0.0dip</item>
|
||||
<item name="keyBorderColorLeft">#241734</item>
|
||||
<item name="keyBorderColorTop">#241734</item>
|
||||
<item name="keyBorderColorRight">#241734</item>
|
||||
<item name="keyBorderColorBottom">#241734</item>
|
||||
<item name="emoji_button_bg">?colorKeyboard</item>
|
||||
<item name="emoji_color">?colorLabel</item>
|
||||
<item name="clipboard_divider_color">?colorKey</item>
|
||||
</style>
|
||||
<style name="ePaperBlack" parent="BaseTheme">
|
||||
<item name="android:isLightTheme">false</item>
|
||||
<item name="colorKeyboard">#000000</item>
|
||||
|
||||
@@ -15,8 +15,13 @@
|
||||
<bool name="debug_logs">false</bool>
|
||||
<!-- Color fallback for the Monet themes on Android API < 31. This makes the
|
||||
Monet themes very similar to the "Dark" and "Light" themes. -->
|
||||
<color name="system_accent1_100">#3333ff</color>
|
||||
<color name="system_accent1_200">#3366ff</color>
|
||||
<color name="system_accent1_400">#3399ff</color>
|
||||
<color name="system_accent1_600">#33cc33</color>
|
||||
<color name="system_accent1_600">#33ccff</color>
|
||||
<color name="system_accent1_900">#33ffff</color>
|
||||
<!-- accent2 is inverted accent1-->
|
||||
<color name="system_accent2_900">#009999</color>
|
||||
<color name="system_neutral1_0">#ffffff</color>
|
||||
<color name="system_neutral1_100">#e3e3e3</color>
|
||||
<color name="system_neutral1_400">#cccccc</color>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<row height="0.95">
|
||||
<key width="1.7" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key3="loc switch_clipboard" key4="switch_numeric"/>
|
||||
<key width="1.1" key0="fn" key1="loc alt" key2="loc change_method" key3="switch_emoji" key4="config"/>
|
||||
<key width="4.4" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right"/>
|
||||
<key width="1.1" key0="loc compose" key7="up" key6="right" key5="left" key8="down" key1="loc home" key2="loc page_up" key3="loc end" key4="loc page_down"/>
|
||||
<key width="1.7" key0="enter" key1="loc voice_typing" key2="action"/>
|
||||
<key width="1.5" role="action" key0="ctrl" key1="loc meta" key3="loc switch_clipboard"/>
|
||||
<key width="1.3" role="action" key0="alt" key2="switch_emoji" key3="config"/>
|
||||
<key width="1.0" role="action" key7="pgup" key8="pgdn"/>
|
||||
<key width="4.5" role="space_bar" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right"/>
|
||||
<key width="1.0" role="action" key7="up" key8="down"/>
|
||||
<key width="1.4" role="action" key0="switch_numeric" key1="meta" key2="loc change_method" key3="loc voice_typing" key4="switch_fn"/>
|
||||
<key width="1.5" role="action" key0="enter" key4="loc compose" key2="action"/>
|
||||
</row>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<!-- The bottom row used in the clipboard history pane. -->
|
||||
<keyboard bottom_row="false">
|
||||
<row height="0.95">
|
||||
<key key0="switch_back_clipboard"/>
|
||||
<key width="3" key0="space" key5="cursor_left" key6="cursor_right"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key key0="enter" key2="action"/>
|
||||
<key role="action" key0="switch_back_clipboard"/>
|
||||
<key width="3" role="space_bar" key0="space" key5="cursor_left" key6="cursor_right"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="enter" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<!-- The bottom row used in the emoji pane. -->
|
||||
<keyboard bottom_row="false">
|
||||
<row height="0.95">
|
||||
<key key0="switch_back_emoji"/>
|
||||
<key width="3" key0="space" key5="cursor_left" key6="cursor_right"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key key0="enter" key2="action"/>
|
||||
<key role="action" key0="switch_back_emoji"/>
|
||||
<key role="space_bar" width="3" key0="space" key5="cursor_left" key6="cursor_right"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="enter" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard bottom_row="false">
|
||||
<row>
|
||||
<key key0="f1"/>
|
||||
<key key0="f2"/>
|
||||
<key key0="f3"/>
|
||||
<key key0="f4"/>
|
||||
<key key0="f5"/>
|
||||
<key key0="f6"/>
|
||||
<key key0="f7"/>
|
||||
<key key0="f8"/>
|
||||
<key key0="f9"/>
|
||||
<key key0="f10"/>
|
||||
<key key0="f11"/>
|
||||
<key key0="f12"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.5" role="action" key0="shift"/>
|
||||
<key width="1.5" role="action" key0="ctrl"/>
|
||||
<key width="1.3" role="action" key0="alt"/>
|
||||
<key width="1.4" role="action" key0="meta"/>
|
||||
<key width="4.2" role="space_bar" key0="space"/>
|
||||
<key width="1.4" role="action" key0="switch_text"/>
|
||||
<key width="1.5" role="action" key0="enter" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
@@ -25,7 +25,7 @@
|
||||
<key key0="ϡ" key1="⌀"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ζ" key3="⇌" key4="√"/>
|
||||
<key key0="χ" key3="accent_arrow_right" key4="∪"/>
|
||||
<key key0="ϛ" key4="∩"/>
|
||||
@@ -33,15 +33,15 @@
|
||||
<key key0="β" key1="≤" key3="ℤ" key4="1"/>
|
||||
<key key0="ν" key1="≠" key3="ℚ" key4="2"/>
|
||||
<key key0="μ" key1="≥" key3="×" key4="3"/>
|
||||
<key width="1.5" key0="backspace" key3="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key3="delete"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.2" key0="switch_text" key2="loc esc"/>
|
||||
<key width="1.2" key0="switch_numeric" key2="loc tab"/>
|
||||
<key width="1.2" key0="fn"/>
|
||||
<key width="2.8" key0="space" key1="superscript" key3="subscript"/>
|
||||
<key width="1.2" key0="0" key2="."/>
|
||||
<key width="1.2" key0="loc compose" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key width="1.2" key0="enter" key1="=" key2="action"/>
|
||||
<key width="1.2" role="action" key0="switch_text" key2="loc esc"/>
|
||||
<key width="1.2" role="action" key0="switch_numeric" key2="loc tab"/>
|
||||
<key width="1.2" role="action" key0="fn"/>
|
||||
<key width="2.8" role="space_bar" key0="space" key1="superscript" key3="subscript"/>
|
||||
<key width="1.2" role="action" key0="0" key2="."/>
|
||||
<key width="1.2" role="action" key0="loc compose" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key width="1.2" role="action" key0="enter" key1="=" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
<subtype android:label="%s" android:languageTag="gl" android:imeSubtypeLocale="gl" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us,dictionary=gl" />
|
||||
<subtype android:label="%s" android:languageTag="ha" android:imeSubtypeLocale="ha_NG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us,extra_keys=₦|ɓ|ɗ|ƙ|’|ƴ|r̃" />
|
||||
<subtype android:label="%s" android:languageTag="haw" android:imeSubtypeLocale="haw_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_haw,extra_keys=ʻ@l|accent_macron:ā:ē:ī:ō:ū@m" />
|
||||
<subtype android:label="%s" android:languageTag="he" android:imeSubtypeLocale="he_IL" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=hebrew,default_layout=default_layout=hebr_1_il,extra_keys=₪@r|€" />
|
||||
<subtype android:label="%s" android:languageTag="he" android:imeSubtypeLocale="he_IL" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=hebrew,default_layout=hebr_1_il,extra_keys=₪@r" />
|
||||
<subtype android:label="%s" android:languageTag="hi" android:imeSubtypeLocale="hi_IN" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=devanagari,default_layout=deva_inscript,dictionary=hi,extra_keys=₹" />
|
||||
<subtype android:label="%s" android:languageTag="hr" android:imeSubtypeLocale="hr" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwerty_us,dictionary=hr,extra_keys=č|ć|dž|đ|lj|nj|š|ž" />
|
||||
<subtype android:label="%s" android:languageTag="hu" android:imeSubtypeLocale="hu_HU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="script=latin,default_layout=latn_qwertz_hu,dictionary=hu,extra_keys=accent_aigu:á:é:í:ó:ú@d|accent_trema:ö:ü@u|accent_ogonek@s|accent_double_aigu:ő:ű@k|€" />
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="false"/>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="false">10.10.10.1</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- See [number_row_no_symbols.xml] for the number row with no symbols. -->
|
||||
<row height="0.75">
|
||||
<key key0="1" se="!"/>
|
||||
<key key0="2" se="@"/>
|
||||
<key key0="3" se="#"/>
|
||||
<key key0="4" se="$"/>
|
||||
<key key0="5" se="%"/>
|
||||
<key key0="6" sw="^"/>
|
||||
<key key0="7" sw="&"/>
|
||||
<key key0="8" sw="*"/>
|
||||
<key key0="9" sw="("/>
|
||||
<key key0="0" sw=")"/>
|
||||
<key role="action" key0="1" se="!"/>
|
||||
<key role="action" key0="2" se="@"/>
|
||||
<key role="action" key0="3" se="#"/>
|
||||
<key role="action" key0="4" se="$"/>
|
||||
<key role="action" key0="5" se="%"/>
|
||||
<key role="action" key0="6" sw="^"/>
|
||||
<key role="action" key0="7" sw="&"/>
|
||||
<key role="action" key0="8" sw="*"/>
|
||||
<key role="action" key0="9" sw="("/>
|
||||
<key role="action" key0="0" sw=")"/>
|
||||
</row>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<row height="0.75">
|
||||
<key key0="1"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key key0="4"/>
|
||||
<key key0="5"/>
|
||||
<key key0="6"/>
|
||||
<key key0="7"/>
|
||||
<key key0="8"/>
|
||||
<key key0="9"/>
|
||||
<key key0="0"/>
|
||||
<key role="action" key0="1"/>
|
||||
<key role="action" key0="2"/>
|
||||
<key role="action" key0="3"/>
|
||||
<key role="action" key0="4"/>
|
||||
<key role="action" key0="5"/>
|
||||
<key role="action" key0="6"/>
|
||||
<key role="action" key0="7"/>
|
||||
<key role="action" key0="8"/>
|
||||
<key role="action" key0="9"/>
|
||||
<key role="action" key0="0"/>
|
||||
</row>
|
||||
|
||||
+15
-15
@@ -1,36 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard bottom_row="false">
|
||||
<row>
|
||||
<key width="0.75" key0="loc esc" key2="~" key4="!"/>
|
||||
<key width="0.75" key0="(" key2="[" key4="{"/>
|
||||
<key width="0.75" role="action" key0="loc esc" key2="~" key4="!"/>
|
||||
<key width="0.75" role="action" key0="(" key2="[" key4="{"/>
|
||||
<key key0="7" key1="<" key2=">"/>
|
||||
<key key0="8" key2="∞"/>
|
||||
<key key0="9" key2="π"/>
|
||||
<key width="0.75" key0="*" key1="√" key2="×" key3="\#"/>
|
||||
<key width="0.75" key0="/" key1="%" key3="÷"/>
|
||||
<key width="0.75" role="action" key0="*" key1="√" key2="×" key3="\#"/>
|
||||
<key width="0.75" role="action" key0="/" key1="%" key3="÷"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="0.75" key0="loc tab" key2="|" key4="\\"/>
|
||||
<key width="0.75" key0=")" key2="]" key4="}"/>
|
||||
<key width="0.75" role="action" key0="loc tab" key2="|" key4="\\"/>
|
||||
<key width="0.75" role="action" key0=")" key2="]" key4="}"/>
|
||||
<key key0="4" key1="box" key3="arrows"/>
|
||||
<key key0="5" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key key0="6"/>
|
||||
<key width="0.75" key0="+" key1="Σ" key2="$"/>
|
||||
<key width="0.75" key0="-" key1="^"/>
|
||||
<key width="0.75" role="action" key0="+" key1="Σ" key2="$"/>
|
||||
<key width="0.75" role="action" key0="-" key1="^"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="0.75" key0="switch_greekmath"/>
|
||||
<key width="0.75" key0="shift" key2="fn" key4="loc alt"/>
|
||||
<key width="0.75" role="action" key0="switch_greekmath"/>
|
||||
<key width="0.75" role="action" key0="shift" key2="fn" key4="loc alt"/>
|
||||
<key key0="1" key1="superscript" key2="ordinal" key3="subscript"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.5" key0="switch_text" key2="ctrl"/>
|
||||
<key width="1.5" role="action" key0="switch_text" key2="ctrl"/>
|
||||
<key width="1.5" key0="0"/>
|
||||
<key width="0.75" key0="." key1=":" key2="," key3=";"/>
|
||||
<key width="0.75" key0="space" key1=""" key2="'" key3="loc compose" key4="_"/>
|
||||
<key width="1.5" key0="enter" key1="±" key2="action" key3="="/>
|
||||
<key width="0.75" role="action" key0="." key1=":" key2="," key3=";"/>
|
||||
<key width="0.75" role="action" key0="action" key1=""" key2="'" key3="loc compose" key4="_"/>
|
||||
<key width="1.5" role="action" key0="enter" key1="±" key2="action" key3="="/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard bottom_row="false">
|
||||
<row>
|
||||
<key width="0.75" role="action" key0="loc esc" key2="~" key4="!"/>
|
||||
<key width="0.75" role="action" key0="(" key2="[" key4="{"/>
|
||||
<key key0="7"/>
|
||||
<key key0="8"/>
|
||||
<key key0="9"/>
|
||||
<key shift="4" key0="7" key1="<" key2=">"/>
|
||||
<key key0="8" key2="∞"/>
|
||||
<key key0="9" key2="π"/>
|
||||
<key width="0.75" role="action" key0="*" key1="√" key2="×" key3="\#"/>
|
||||
<key width="0.75" role="action" key0="/" key1="%" key3="÷"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="0.75" role="action" key0="loc tab" key2="|" key4="\\"/>
|
||||
<key width="0.75" role="action" key0=")" key2="]" key4="}"/>
|
||||
<key key0="4"/>
|
||||
<key key0="5"/>
|
||||
<key key0="6"/>
|
||||
<key shift="4" key0="4" key1="box" key3="arrows"/>
|
||||
<key key0="5" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key key0="6"/>
|
||||
<key width="0.75" role="action" key0="+" key1="Σ" key2="$"/>
|
||||
<key width="0.75" role="action" key0="-" key1="^"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="0.75" role="action" key0="switch_greekmath"/>
|
||||
<key width="0.75" role="action" key0="shift" key2="fn" key4="loc alt"/>
|
||||
<key key0="1"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key shift="4" key0="1" key1="superscript" key2="ordinal" key3="subscript"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.5" role="action" key0="switch_text" key2="ctrl"/>
|
||||
<key width="2" key0="0"/>
|
||||
<key role="action" key0="." key1=":" key2="," key3=";"/>
|
||||
<key width="1.5" shift="4" role="action" key0="space" key1=""" key2="'" key3="loc compose" key4="_"/>
|
||||
<key width="1.5" key0="0"/>
|
||||
<key width="1.5" role="action" key0="enter" key1="±" key2="action" key3="="/>
|
||||
</row>
|
||||
</keyboard>
|
||||
+17
-17
@@ -1,27 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard bottom_row="false">
|
||||
<row>
|
||||
<key key0="7"/>
|
||||
<key key0="8"/>
|
||||
<key key0="9"/>
|
||||
<key key0="/"/>
|
||||
<key role="action" key0="7"/>
|
||||
<key role="action" key0="8"/>
|
||||
<key role="action" key0="9"/>
|
||||
<key role="action" key0="/"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="4"/>
|
||||
<key key0="5"/>
|
||||
<key key0="6"/>
|
||||
<key key0="*"/>
|
||||
<key role="action" key0="4"/>
|
||||
<key role="action" key0="5"/>
|
||||
<key role="action" key0="6"/>
|
||||
<key role="action" key0="*"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="1"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key key0="-"/>
|
||||
<key role="action" key0="1"/>
|
||||
<key role="action" key0="2"/>
|
||||
<key role="action" key0="3"/>
|
||||
<key role="action" key0="-"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key key0="0"/>
|
||||
<key key0="."/>
|
||||
<key key0="="/>
|
||||
<key key0="+"/>
|
||||
<key role="action" key0="0"/>
|
||||
<key role="action" key0="."/>
|
||||
<key role="action" key0="="/>
|
||||
<key role="action" key0="+"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
</keyboard>
|
||||
|
||||
+6
-6
@@ -4,24 +4,24 @@
|
||||
<key shift="1.0" key0="1"/>
|
||||
<key key0="2" indication="ABC"/>
|
||||
<key key0="3" indication="DEF"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1.0" key0="4" indication="GHI"/>
|
||||
<key key0="5" indication="JKL"/>
|
||||
<key key0="6" indication="MNO"/>
|
||||
<key key0="(" key1="paste" key2="=" key3=":" key4="-"/>
|
||||
<key role="action" key0="(" key1="paste" key2="=" key3=":" key4="-"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1.0" key0="7" indication="PQRS"/>
|
||||
<key key0="8" indication="TUV"/>
|
||||
<key key0="9" indication="WXYZ"/>
|
||||
<key key0=")" key2="," key3="/" key4="."/>
|
||||
<key role="action" key0=")" key2="," key3="/" key4="."/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/>
|
||||
<key role="action" shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/>
|
||||
<key key0="0" key3="+" key4="space"/>
|
||||
<key key0="\#" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key key0="action" key2="enter"/>
|
||||
<key role="action" key0="\#" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key role="action" key0="action" key2="enter"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard width="13.0" bottom_row="false">
|
||||
<row>
|
||||
<key shift="1" key0="1"/>
|
||||
<key key0="2"/>
|
||||
<key key0="3"/>
|
||||
<key shift="5" key0="1"/>
|
||||
<key key0="2" indication="ABC"/>
|
||||
<key key0="3" indication="DEF"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1" key0="4"/>
|
||||
<key key0="5"/>
|
||||
<key key0="6"/>
|
||||
<key shift="5" key0="4" indication="GHI"/>
|
||||
<key key0="5" indication="JKL"/>
|
||||
<key key0="6" indication="MNO"/>
|
||||
<key role="action" key0="(" key1="paste" key2="=" key3=":" key4="-"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1" key0="7"/>
|
||||
<key key0="8"/>
|
||||
<key key0="9"/>
|
||||
<key shift="5" key0="7" indication="PQRS"/>
|
||||
<key key0="8" indication="TUV"/>
|
||||
<key key0="9" indication="WXYZ"/>
|
||||
<key role="action" key0=")" key2="," key3="/" key4="."/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="1" width="1.5" key0="0"/>
|
||||
<key width="1.5" role="action" key0="space"/>
|
||||
<key shift="5" role="action" key0="*" key1="switch_text" key3="switch_numeric"/>
|
||||
<key key0="0" key3="+" key4="space"/>
|
||||
<key role="action" key0="\#" key7="up" key6="right" key5="left" key8="down"/>
|
||||
<key role="action" key0="action" key2="enter"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
@@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceCategory android:title="@string/pref_category_layout">
|
||||
<CheckBoxPreference android:key="usage_gauge_enabled" android:title="@string/pref_usage_gauge_enabled" android:defaultValue="true"/>
|
||||
<EditTextPreference android:key="usage_gauge_url" android:title="@string/pref_usage_gauge_url" android:defaultValue="http://10.10.10.1:8771/usage" android:inputType="textUri"/>
|
||||
<EditTextPreference android:key="usage_gauge_token" android:title="@string/pref_usage_gauge_token" android:defaultValue="" android:inputType="textPassword"/>
|
||||
<juloo.keyboard2.prefs.LayoutsPreference/>
|
||||
<PreferenceScreen android:title="@string/pref_extra_keys_title">
|
||||
<PreferenceCategory android:title="@string/pref_extra_keys_custom">
|
||||
@@ -11,6 +14,7 @@
|
||||
<ListPreference android:key="number_row" android:title="@string/pref_number_row_title" android:summary="%s" android:defaultValue="no_number_row" android:entries="@array/pref_show_number_row_entries" android:entryValues="@array/pref_show_number_row_values"/>
|
||||
<ListPreference android:key="show_numpad" android:title="@string/pref_show_numpad_title" android:summary="%s" android:defaultValue="1" android:entries="@array/pref_show_numpad_entries" android:entryValues="@array/pref_show_numpad_values"/>
|
||||
<ListPreference android:key="numpad_layout" android:title="@string/pref_numpad_layout" android:summary="%s" android:defaultValue="high_first" android:entries="@array/pref_numpad_layout_entries" android:entryValues="@array/pref_numpad_layout_values"/>
|
||||
<ListPreference android:key="split_layout" android:title="@string/pref_split_layout" android:summary="%s" android:defaultValue="wide" android:entries="@array/pref_split_layout_entries" android:entryValues="@array/pref_split_layout_values"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/pref_category_suggestions">
|
||||
<CheckBoxPreference android:key="suggestions" android:title="@string/pref_suggestions_title" android:summary="@string/pref_suggestions_summary" android:defaultValue="true"/>
|
||||
@@ -24,6 +28,7 @@
|
||||
<CheckBoxPreference android:key="keyrepeat_enabled" android:title="@string/pref_keyrepeat_enabled" android:defaultValue="true"/>
|
||||
<juloo.keyboard2.prefs.IntSlideBarPreference android:key="longpress_interval" android:dependency="keyrepeat_enabled" android:title="@string/pref_long_interval_title" android:summary="%sms" android:defaultValue="25" min="5" max="100"/>
|
||||
<CheckBoxPreference android:key="lock_double_tap" android:title="@string/pref_lock_double_tap_title" android:summary="@string/pref_lock_double_tap_summary" android:defaultValue="false"/>
|
||||
<ListPreference android:key="physical_keyboard_behavior" android:title="@string/pref_physical_keyboard_behavior" android:summary="%s" android:defaultValue="hide" android:entries="@array/pref_physical_keyboard_behavior_entries" android:entryValues="@array/pref_physical_keyboard_behavior_values"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/pref_category_behavior">
|
||||
<CheckBoxPreference android:key="autocapitalisation" android:title="@string/pref_autocapitalisation_title" android:summary="@string/pref_autocapitalisation_summary" android:defaultValue="true"/>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file define a row but it's layed out as a column instead in
|
||||
[LayoutLandscapeModifier]. -->
|
||||
<row>
|
||||
<key role="suggestion" width="1" c="complete_emoji"/>
|
||||
<key role="suggestion" width="3" c="complete_first"/>
|
||||
<key role="suggestion" width="3" c="complete_second"/>
|
||||
<key role="suggestion" width="3" c="complete_third"/>
|
||||
</row>
|
||||
@@ -1,4 +1,8 @@
|
||||
{
|
||||
" ": {
|
||||
// Override the default space-space sequence to show the nbsp symbol
|
||||
" ": "nbsp"
|
||||
},
|
||||
"V": {
|
||||
"~": "Ṽ",
|
||||
"s": "Š",
|
||||
|
||||
@@ -114,11 +114,11 @@ public final class ClipboardHistoryService
|
||||
if (!Config.globalConfig().clipboard_history_enabled)
|
||||
return;
|
||||
int size = _history.size();
|
||||
if (clip.equals("") || (size > 0 && _history.get(size - 1).content.equals(clip)))
|
||||
if (clip.equals("") || (size > 0 && _history.get(0).content.equals(clip)))
|
||||
return;
|
||||
if (size >= MAX_HISTORY_SIZE)
|
||||
_history.remove(0);
|
||||
_history.add(new HistoryEntry(clip));
|
||||
_history.remove(size - 1);
|
||||
_history.add(0,new HistoryEntry(clip));
|
||||
if (_listener != null)
|
||||
_listener.on_clipboard_history_change();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public final class ClipboardPinView extends NonScrollListView
|
||||
/** Pin a clipboard and persist the change. */
|
||||
public void add_entry(String text)
|
||||
{
|
||||
_entries.add(text);
|
||||
_entries.add(0,text);
|
||||
_adapter.notifyDataSetChanged();
|
||||
persist();
|
||||
invalidate();
|
||||
|
||||
@@ -43,7 +43,12 @@ public final class ComposeKey
|
||||
new String(states, next + 1, next_length - 1));
|
||||
}
|
||||
else // Character final state.
|
||||
{
|
||||
// Preserve the named-key identity used by compose sequences for NBSP.
|
||||
if (next_header == '\u00a0')
|
||||
return KeyValue.getKeyByName("nbsp");
|
||||
return KeyValue.makeCharKey((char)next_header);
|
||||
}
|
||||
}
|
||||
|
||||
/** Apply char [c] to the pending compose sequence. If the application resolves
|
||||
|
||||
@@ -75,6 +75,10 @@ public final class Config
|
||||
public boolean clipboard_history_enabled;
|
||||
public int clipboard_history_duration;
|
||||
public boolean space_bar_auto_complete;
|
||||
public boolean physical_keyboard_hide;
|
||||
public boolean usageGaugeEnabled;
|
||||
public String usageGaugeUrl;
|
||||
public String usageGaugeToken;
|
||||
|
||||
// Dynamically set
|
||||
/** Configuration options implied by the connected editor. */
|
||||
@@ -94,6 +98,8 @@ public final class Config
|
||||
[get_current_layout()] and [set_current_layout()]. */
|
||||
int current_layout_narrow;
|
||||
int current_layout_wide;
|
||||
/** Whether to automatically split the layout. */
|
||||
public boolean split_layout;
|
||||
|
||||
private Config(SharedPreferences prefs, Resources res,
|
||||
Boolean foldableUnfolded, Dictionaries dicts)
|
||||
@@ -104,7 +110,7 @@ public final class Config
|
||||
marginTop = res.getDimension(R.dimen.margin_top);
|
||||
keyPadding = res.getDimension(R.dimen.key_padding);
|
||||
labelTextSize = 0.33f;
|
||||
sublabelTextSize = 0.22f;
|
||||
sublabelTextSize = 0.20f;
|
||||
// from prefs
|
||||
refresh(res, foldableUnfolded, dicts);
|
||||
// initialized later
|
||||
@@ -158,8 +164,8 @@ public final class Config
|
||||
longPressInterval = _prefs.getInt("longpress_interval", 65);
|
||||
keyrepeat_enabled = _prefs.getBoolean("keyrepeat_enabled", true);
|
||||
margin_bottom = get_dip_pref_oriented(dm, "margin_bottom", 7, 3);
|
||||
key_vertical_margin = get_dip_pref(dm, "key_vertical_margin", 1.5f) / 100;
|
||||
key_horizontal_margin = get_dip_pref(dm, "key_horizontal_margin", 2) / 100;
|
||||
key_vertical_margin = get_dip_pref(dm, "key_vertical_margin", 6f) / 100;
|
||||
key_horizontal_margin = get_dip_pref(dm, "key_horizontal_margin", 13) / 100;
|
||||
// Label brightness is used as the alpha channel
|
||||
labelBrightness = _prefs.getInt("label_brightness", 100) * 255 / 100;
|
||||
// Keyboard opacity
|
||||
@@ -176,7 +182,7 @@ public final class Config
|
||||
// a layout in KeyboardData unit. The keyboard will be higher if the layout
|
||||
// has more rows and smaller if it has less because rows stay the same
|
||||
// height.
|
||||
keyboard_rows_height_pixels = screenHeightPixels * keyboardHeightPercent / 395;
|
||||
keyboard_rows_height_pixels = (int)(screenHeightPixels * keyboardHeightPercent / 395 * 0.81f);
|
||||
horizontal_margin =
|
||||
get_dip_pref_oriented(dm, "horizontal_margin", 3, 28);
|
||||
double_tap_lock_shift = _prefs.getBoolean("lock_double_tap", false);
|
||||
@@ -195,9 +201,13 @@ public final class Config
|
||||
clipboard_history_enabled = _prefs.getBoolean("clipboard_history_enabled", false);
|
||||
clipboard_history_duration = Integer.parseInt(_prefs.getString("clipboard_history_duration", "5"));
|
||||
space_bar_auto_complete = _prefs.getBoolean("space_bar_auto_complete", false);
|
||||
|
||||
physical_keyboard_hide = _prefs.getString("physical_keyboard_behavior", "hide").equals("hide");
|
||||
usageGaugeEnabled = _prefs.getBoolean("usage_gauge_enabled", true);
|
||||
usageGaugeUrl = _prefs.getString("usage_gauge_url", "http://10.10.10.1:8771/usage");
|
||||
usageGaugeToken = _prefs.getString("usage_gauge_token", "");
|
||||
float screen_width_dp = dm.widthPixels / dm.density;
|
||||
wide_screen = screen_width_dp >= WIDE_DEVICE_THRESHOLD;
|
||||
split_layout = get_split_layout();
|
||||
}
|
||||
|
||||
public int get_current_layout()
|
||||
@@ -272,6 +282,7 @@ public final class Config
|
||||
case "everforestlight": return R.style.EverforestLight;
|
||||
case "cobalt": return R.style.Cobalt;
|
||||
case "pine": return R.style.Pine;
|
||||
case "orchid": return R.style.Orchid;
|
||||
case "epaperblack": return R.style.ePaperBlack;
|
||||
default:
|
||||
case "system":
|
||||
@@ -292,6 +303,16 @@ public final class Config
|
||||
}
|
||||
}
|
||||
|
||||
final boolean get_split_layout()
|
||||
{
|
||||
switch (_prefs.getString("split_layout", "wide"))
|
||||
{
|
||||
case "wide": return wide_screen;
|
||||
case "landscape": return orientation_landscape;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static Config _globalConfig = null;
|
||||
|
||||
public static void initGlobalConfig(SharedPreferences prefs, Resources res,
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package juloo.keyboard2;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class DeepSeekPeak
|
||||
{
|
||||
/**
|
||||
* Peak is Monday through Friday from 01:00 to 04:00 UTC or from 06:00 to
|
||||
* 10:00 UTC. DeepSeek additionally excludes Chinese public holidays; this
|
||||
* helper deliberately ignores that exception.
|
||||
*/
|
||||
public static boolean isPeak(long epochMillis)
|
||||
{
|
||||
Calendar utc = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||
utc.setTimeInMillis(epochMillis);
|
||||
int day = utc.get(Calendar.DAY_OF_WEEK);
|
||||
if (day == Calendar.SATURDAY || day == Calendar.SUNDAY)
|
||||
return false;
|
||||
|
||||
int hour = utc.get(Calendar.HOUR_OF_DAY);
|
||||
return (hour >= 1 && hour < 4) || (hour >= 6 && hour < 10);
|
||||
}
|
||||
|
||||
public static int colorFor(long epochMillis)
|
||||
{
|
||||
return isPeak(epochMillis) ? 0xFFFF2D95 : 0xFF00E5FF;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
long[] samples = {
|
||||
1704675540000L, // Monday 00:59 UTC
|
||||
1704675600000L, // Monday 01:00 UTC
|
||||
1704700800000L, // Monday 08:00 UTC
|
||||
1704711600000L // Monday 11:00 UTC
|
||||
};
|
||||
for (long sample : samples)
|
||||
System.out.println(sample + ": " + (isPeak(sample) ? "peak" : "off-peak"));
|
||||
}
|
||||
}
|
||||
@@ -36,14 +36,14 @@ public final class KeyEventHandler
|
||||
LastAction _last_action = null;
|
||||
LastAction _next_last_action = null;
|
||||
|
||||
public KeyEventHandler(IReceiver recv, Config config)
|
||||
public KeyEventHandler(IReceiver recv, Suggestions sg)
|
||||
{
|
||||
_recv = recv;
|
||||
Handler handler = recv.getHandler();
|
||||
_autocap = new Autocapitalisation(handler,
|
||||
this.new Autocapitalisation_callback());
|
||||
_mods = Pointers.Modifiers.EMPTY;
|
||||
_suggestions = new Suggestions(recv, config);
|
||||
_suggestions = sg;
|
||||
_typedword = new CurrentlyTypedWord(handler, this);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ public final class KeyEventHandler
|
||||
case Compose_pending: _recv.set_compose_pending(true); break;
|
||||
case Slider: handle_slider(key.getSlider(), key.getSliderRepeat(), false); break;
|
||||
case Macro: evaluate_macro(key.getMacro()); break;
|
||||
case Stateful: handle_stateful(key.getStateful()); break;
|
||||
}
|
||||
update_meta_state(old_mods);
|
||||
_last_action = _next_last_action;
|
||||
@@ -334,6 +335,19 @@ public final class KeyEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
void handle_stateful(KeyValue.Stateful st)
|
||||
{
|
||||
switch (st)
|
||||
{
|
||||
case Complete_first:
|
||||
case Complete_second:
|
||||
case Complete_third:
|
||||
case Complete_emoji:
|
||||
suggestion_entered(st.toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Move the cursor right or left, if possible without sending key events.
|
||||
Unlike arrow keys, the selection is not removed even if shift is not on.
|
||||
Falls back to sending arrow keys events if the editor do not support
|
||||
|
||||
@@ -141,23 +141,19 @@ public final class KeyModifier
|
||||
{
|
||||
switch (kv.getKind())
|
||||
{
|
||||
case Char:
|
||||
case String:
|
||||
/* These keys are not greyed. */
|
||||
case Event:
|
||||
case Modifier:
|
||||
return kv;
|
||||
/* Tapping compose again exits the pending sequence. */
|
||||
case Compose_pending:
|
||||
return KeyValue.COMPOSE_CANCEL;
|
||||
default:
|
||||
KeyValue res = ComposeKey.apply(state, kv);
|
||||
// Grey-out characters not part of any sequence.
|
||||
if (res == null)
|
||||
return kv.withFlags(kv.getFlags() | KeyValue.FLAG_GREYED);
|
||||
return res;
|
||||
/* Tapping compose again exits the pending sequence. */
|
||||
case Compose_pending:
|
||||
return KeyValue.COMPOSE_CANCEL;
|
||||
/* These keys are not greyed. */
|
||||
case Event:
|
||||
case Modifier:
|
||||
return kv;
|
||||
/* Other keys cannot be part of sequences. */
|
||||
default:
|
||||
return kv.withFlags(kv.getFlags() | KeyValue.FLAG_GREYED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
{
|
||||
CONFIG,
|
||||
SWITCH_TEXT,
|
||||
SWITCH_FN,
|
||||
SWITCH_NUMERIC,
|
||||
SWITCH_EMOJI,
|
||||
SWITCH_BACK_EMOJI,
|
||||
@@ -24,6 +25,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
CAPS_LOCK,
|
||||
SWITCH_VOICE_TYPING,
|
||||
SWITCH_VOICE_TYPING_CHOOSER,
|
||||
HIDE_SELF,
|
||||
}
|
||||
|
||||
// Must be evaluated in the reverse order of their values.
|
||||
@@ -104,6 +106,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
String, // [_payload] is also the string to output, value is unused.
|
||||
Slider, // [_payload] is a [KeyValue.Slider], value is slider repeatition.
|
||||
Macro, // [_payload] is a [KeyValue.Macro], value is unused.
|
||||
Stateful, // [_payload] is a [KeyValue.Stateful], value is the query.
|
||||
}
|
||||
|
||||
private static final int FLAGS_OFFSET = 20;
|
||||
@@ -238,6 +241,12 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
return ((Macro)_payload).keys;
|
||||
}
|
||||
|
||||
/** Defined only when [getKind() == Kind.Stateful]. */
|
||||
public Stateful getStateful()
|
||||
{
|
||||
return (Stateful)_payload;
|
||||
}
|
||||
|
||||
/* Update the char and the symbol. */
|
||||
public KeyValue withChar(char c)
|
||||
{
|
||||
@@ -422,6 +431,11 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
id.ordinal(), flags | FLAG_KEY_FONT);
|
||||
}
|
||||
|
||||
private static KeyValue statefulKey(Stateful st)
|
||||
{
|
||||
return new KeyValue(st, Kind.Stateful, 0, FLAG_SMALLER_FONT | FLAG_SPECIAL);
|
||||
}
|
||||
|
||||
public static KeyValue makeStringKey(String str)
|
||||
{
|
||||
return makeStringKey(str, 0);
|
||||
@@ -576,6 +590,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
case "box": return modifierKey("Box", Modifier.BOX, 0);
|
||||
case "fn": return modifierKey("Fn", Modifier.FN, 0);
|
||||
case "meta": return modifierKey("Meta", Modifier.META, 0);
|
||||
case "tux": return modifierKey("Meta", Modifier.META, 0);
|
||||
|
||||
/* Combining diacritics */
|
||||
/* Glyphs is the corresponding dead-key + 0x0100. */
|
||||
@@ -628,8 +643,9 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
/* Special event keys */
|
||||
case "config": return CONFIG;
|
||||
case "switch_text": return eventKey("ABC", Event.SWITCH_TEXT, FLAG_SMALLER_FONT);
|
||||
case "switch_fn": return eventKey("Fn", Event.SWITCH_FN, FLAG_SMALLER_FONT);
|
||||
case "switch_numeric": return eventKey("123+", Event.SWITCH_NUMERIC, FLAG_SMALLER_FONT);
|
||||
case "switch_emoji": return eventKey(0xE001, Event.SWITCH_EMOJI, FLAG_SMALLER_FONT);
|
||||
case "switch_emoji": return eventKey(0xE01D, Event.SWITCH_EMOJI, FLAG_SMALLER_FONT);
|
||||
case "switch_back_emoji": return eventKey("ABC", Event.SWITCH_BACK_EMOJI, 0);
|
||||
case "switch_clipboard": return eventKey(0xE017, Event.SWITCH_CLIPBOARD, 0);
|
||||
case "switch_back_clipboard": return eventKey("ABC", Event.SWITCH_BACK_CLIPBOARD, 0);
|
||||
@@ -643,6 +659,11 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
case "capslock": return eventKey(0xE012, Event.CAPS_LOCK, 0);
|
||||
case "voice_typing": return eventKey(0xE015, Event.SWITCH_VOICE_TYPING, FLAG_SMALLER_FONT);
|
||||
case "voice_typing_chooser": return VOICE_TYPING_CHOOSER;
|
||||
case "complete_first": return statefulKey(Stateful.Complete_first);
|
||||
case "complete_second": return statefulKey(Stateful.Complete_second);
|
||||
case "complete_third": return statefulKey(Stateful.Complete_third);
|
||||
case "complete_emoji": return statefulKey(Stateful.Complete_emoji);
|
||||
case "hide_self": return eventKey("⊻", Event.HIDE_SELF, FLAG_SMALLER_FONT);
|
||||
|
||||
/* Key events */
|
||||
case "esc": return keyeventKey("Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
|
||||
@@ -653,6 +674,8 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
case "left": return keyeventKey(0xE008, KeyEvent.KEYCODE_DPAD_LEFT, FLAG_SMALLER_FONT);
|
||||
case "page_up": return keyeventKey(0xE002, KeyEvent.KEYCODE_PAGE_UP, 0);
|
||||
case "page_down": return keyeventKey(0xE003, KeyEvent.KEYCODE_PAGE_DOWN, 0);
|
||||
case "pgup": return keyeventKey("pgup", KeyEvent.KEYCODE_PAGE_UP, FLAG_SMALLER_FONT);
|
||||
case "pgdn": return keyeventKey("pgdn", KeyEvent.KEYCODE_PAGE_DOWN, FLAG_SMALLER_FONT);
|
||||
case "home": return keyeventKey(0xE00B, KeyEvent.KEYCODE_MOVE_HOME, FLAG_SMALLER_FONT);
|
||||
case "end": return keyeventKey(0xE00C, KeyEvent.KEYCODE_MOVE_END, FLAG_SMALLER_FONT);
|
||||
case "delete": return keyeventKey(0xE010, KeyEvent.KEYCODE_FORWARD_DEL, 0);
|
||||
@@ -676,7 +699,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
/* Spaces */
|
||||
case "\\t": return charKey("\\t", '\t', 0); // Send the tab character
|
||||
case "\\n": return charKey("\\n", '\n', 0); // Send the newline character
|
||||
case "space": return editingKey(0xE00D, Editing.SPACE_BAR, FLAG_SMALLER_FONT | FLAG_GREYED);
|
||||
case "space": return editingKey(0xE001, Editing.SPACE_BAR, FLAG_SMALLER_FONT | FLAG_GREYED);
|
||||
case "nbsp": return charKey("\u237d", '\u00a0', FLAG_SMALLER_FONT);
|
||||
case "nnbsp": return charKey("\u2423", '\u202F', FLAG_SMALLER_FONT);
|
||||
|
||||
@@ -740,6 +763,7 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
case "cursor_right": return sliderKey(Slider.Cursor_right, 1);
|
||||
case "cursor_up": return sliderKey(Slider.Cursor_up, 1);
|
||||
case "cursor_down": return sliderKey(Slider.Cursor_down, 1);
|
||||
case "cursor_joystick": return sliderKey(Slider.Cursor_joystick, 1);
|
||||
case "selection_cancel": return editingKey("Esc", Editing.SELECTION_CANCEL, FLAG_SMALLER_FONT | FLAG_SPECIAL);
|
||||
case "selection_cursor_left": return sliderKey(Slider.Selection_cursor_left, -1); // Move the left side of the selection
|
||||
case "selection_cursor_right": return sliderKey(Slider.Selection_cursor_right, 1);
|
||||
@@ -852,7 +876,8 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
Cursor_up(0xE005, true),
|
||||
Cursor_down(0xE007, true),
|
||||
Selection_cursor_left(0xE008, false),
|
||||
Selection_cursor_right(0xE006, false);
|
||||
Selection_cursor_right(0xE006, false),
|
||||
Cursor_joystick(0xE001, false);
|
||||
|
||||
final String symbol;
|
||||
final boolean vertical;
|
||||
@@ -867,6 +892,10 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
return vertical;
|
||||
}
|
||||
|
||||
public boolean isJoystick() {
|
||||
return this == Cursor_joystick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() { return symbol; }
|
||||
|
||||
@@ -912,4 +941,33 @@ public final class KeyValue implements Comparable<KeyValue>
|
||||
return _symbol.compareTo(snd._symbol);
|
||||
}
|
||||
};
|
||||
|
||||
/** Stateful keys are keys whose symbol must be constantly computed from the
|
||||
app's state. */
|
||||
public static enum Stateful implements Describe
|
||||
{
|
||||
Complete_first,
|
||||
Complete_second,
|
||||
Complete_third,
|
||||
Complete_emoji;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (_handler == null)
|
||||
return "";
|
||||
String s = _handler.provide_stateful_key_symbol(this);
|
||||
return (s == null) ? "" : s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() { return name(); }
|
||||
|
||||
public static Symbol_provider _handler = null;
|
||||
|
||||
public static interface Symbol_provider
|
||||
{
|
||||
public String provide_stateful_key_symbol(Stateful q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class Keyboard2 extends InputMethodService
|
||||
private ViewGroup _keyboard_container_view;
|
||||
private Keyboard2View _keyboard_layout_view;
|
||||
private CandidatesView _candidates_view;
|
||||
private Suggestions _suggestions;
|
||||
private KeyEventHandler _keyeventhandler;
|
||||
/** If not 'null', the layout to use instead of [_config.current_layout]. */
|
||||
private KeyboardData _currentSpecialLayout;
|
||||
@@ -49,6 +50,16 @@ public class Keyboard2 extends InputMethodService
|
||||
private ViewGroup _emojiPane = null;
|
||||
private ViewGroup _clipboard_pane = null;
|
||||
private Handler _handler;
|
||||
private final Runnable _peakIndicatorRefresh = new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (_keyboard_layout_view != null)
|
||||
_keyboard_layout_view.invalidate();
|
||||
_handler.postDelayed(this, 60000);
|
||||
}
|
||||
};
|
||||
|
||||
private Config _config;
|
||||
|
||||
@@ -109,6 +120,18 @@ public class Keyboard2 extends InputMethodService
|
||||
current_layout_unmodified());
|
||||
}
|
||||
|
||||
KeyboardData loadNumericLayout()
|
||||
{
|
||||
return loadNumpad(_config.orientation_landscape ?
|
||||
R.xml.numeric_landscape : R.xml.numeric);
|
||||
}
|
||||
|
||||
KeyboardData loadFnLayout()
|
||||
{
|
||||
return LayoutModifier.modify_layout(
|
||||
KeyboardData.load(getResources(), R.xml.fn));
|
||||
}
|
||||
|
||||
KeyboardData loadPinentry(int layout_id)
|
||||
{
|
||||
return LayoutModifier.modify_pinentry(KeyboardData.load(getResources(), layout_id),
|
||||
@@ -126,7 +149,10 @@ public class Keyboard2 extends InputMethodService
|
||||
Config.initGlobalConfig(prefs, getResources(),
|
||||
_foldStateTracker.isUnfolded(), _dictionaries);
|
||||
_config = Config.globalConfig();
|
||||
_keyeventhandler = new KeyEventHandler(this.new Receiver(), _config);
|
||||
Receiver recvr = this.new Receiver();
|
||||
_suggestions = new Suggestions(recvr, _config);
|
||||
_keyeventhandler = new KeyEventHandler(recvr, _suggestions);
|
||||
KeyValue.Stateful._handler = recvr;
|
||||
_config.handler = _keyeventhandler;
|
||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||
Logs.set_debug_logs(getResources().getBoolean(R.bool.debug_logs));
|
||||
@@ -138,6 +164,7 @@ public class Keyboard2 extends InputMethodService
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
_handler.removeCallbacks(_peakIndicatorRefresh);
|
||||
super.onDestroy();
|
||||
|
||||
_foldStateTracker.close();
|
||||
@@ -192,7 +219,8 @@ public class Keyboard2 extends InputMethodService
|
||||
{
|
||||
boolean should_show =
|
||||
_config.suggestions_enabled
|
||||
&& _config.editor_config.should_show_candidates_view;
|
||||
&& _config.editor_config.should_show_candidates_view
|
||||
&& !_config.split_layout;
|
||||
if (should_show)
|
||||
_candidates_view.refresh_config(_config);
|
||||
_candidates_view.setVisibility(should_show ? View.VISIBLE : View.GONE);
|
||||
@@ -227,8 +255,11 @@ public class Keyboard2 extends InputMethodService
|
||||
{
|
||||
switch (_config.selected_number_layout)
|
||||
{
|
||||
case PIN: return loadPinentry(R.xml.pin);
|
||||
case NUMBER: return loadNumpad(R.xml.numeric);
|
||||
case PIN:
|
||||
return loadPinentry(_config.orientation_landscape ?
|
||||
R.xml.pin_landscape : R.xml.pin);
|
||||
case NUMBER:
|
||||
return loadNumericLayout();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -244,6 +275,11 @@ public class Keyboard2 extends InputMethodService
|
||||
_keyeventhandler.started(_config);
|
||||
setInputView(_keyboard_container_view);
|
||||
Logs.debug_startup_input_view(info, _config);
|
||||
_handler.removeCallbacks(_peakIndicatorRefresh);
|
||||
_handler.postDelayed(_peakIndicatorRefresh, 60000);
|
||||
if (_config.usageGaugeEnabled)
|
||||
UsageGauge.fetchIfNeeded(_config.usageGaugeUrl, _config.usageGaugeToken,
|
||||
() -> _handler.post(() -> _keyboard_layout_view.invalidate()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -343,6 +379,7 @@ public class Keyboard2 extends InputMethodService
|
||||
@Override
|
||||
public void onFinishInputView(boolean finishingInput)
|
||||
{
|
||||
_handler.removeCallbacks(_peakIndicatorRefresh);
|
||||
super.onFinishInputView(finishingInput);
|
||||
_keyboard_layout_view.reset();
|
||||
}
|
||||
@@ -368,7 +405,8 @@ public class Keyboard2 extends InputMethodService
|
||||
if (super.onEvaluateInputViewShown())
|
||||
return true;
|
||||
if (getResources().getConfiguration().hardKeyboardHidden
|
||||
== Configuration.HARDKEYBOARDHIDDEN_NO)
|
||||
== Configuration.HARDKEYBOARDHIDDEN_NO
|
||||
&& _config.physical_keyboard_hide)
|
||||
{
|
||||
Logs.debug("Physical keyboard is present");
|
||||
return false;
|
||||
@@ -390,7 +428,8 @@ public class Keyboard2 extends InputMethodService
|
||||
}
|
||||
|
||||
/** Not static */
|
||||
public class Receiver implements KeyEventHandler.IReceiver
|
||||
public class Receiver implements KeyEventHandler.IReceiver,
|
||||
KeyValue.Stateful.Symbol_provider
|
||||
{
|
||||
public void handle_event_key(KeyValue.Event ev)
|
||||
{
|
||||
@@ -406,7 +445,11 @@ public class Keyboard2 extends InputMethodService
|
||||
break;
|
||||
|
||||
case SWITCH_NUMERIC:
|
||||
setSpecialLayout(loadNumpad(R.xml.numeric));
|
||||
setSpecialLayout(loadNumericLayout());
|
||||
break;
|
||||
|
||||
case SWITCH_FN:
|
||||
setSpecialLayout(loadFnLayout());
|
||||
break;
|
||||
|
||||
case SWITCH_EMOJI:
|
||||
@@ -476,6 +519,9 @@ public class Keyboard2 extends InputMethodService
|
||||
VoiceImeSwitcher.choose_voice_ime(Keyboard2.this, get_imm(),
|
||||
Config.globalPrefs());
|
||||
break;
|
||||
case HIDE_SELF:
|
||||
Keyboard2.this.requestHideSelf(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,6 +554,18 @@ public class Keyboard2 extends InputMethodService
|
||||
{
|
||||
_candidates_view.set_candidates(suggestions);
|
||||
}
|
||||
|
||||
public String provide_stateful_key_symbol(KeyValue.Stateful q)
|
||||
{
|
||||
switch (q)
|
||||
{
|
||||
case Complete_first: return _suggestions.suggestions[0];
|
||||
case Complete_second: return _suggestions.suggestions[1];
|
||||
case Complete_third: return _suggestions.suggestions[2];
|
||||
case Complete_emoji: return _suggestions.emoji_suggestion;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private IBinder getConnectionToken()
|
||||
|
||||
@@ -2,13 +2,20 @@ package juloo.keyboard2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Shader;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
import android.net.Uri;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.MotionEvent;
|
||||
@@ -19,6 +26,7 @@ import android.view.WindowManager;
|
||||
import android.view.WindowMetrics;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Keyboard2View extends View
|
||||
implements View.OnTouchListener, Pointers.IPointerEventHandler
|
||||
@@ -36,6 +44,11 @@ public class Keyboard2View extends View
|
||||
|
||||
private Pointers.Modifiers _mods;
|
||||
|
||||
/** Long-pressing the usage gauge key opens the usage page; a tap stays inert. */
|
||||
private final Handler _gaugeHandler = new Handler(Looper.getMainLooper());
|
||||
private Runnable _gaugeLongPress;
|
||||
private boolean _gaugePressed;
|
||||
|
||||
private static int _currentWhat = 0;
|
||||
|
||||
private Config _config;
|
||||
@@ -54,6 +67,8 @@ public class Keyboard2View extends View
|
||||
private Theme.Computed _tc;
|
||||
|
||||
private static RectF _tmpRect = new RectF();
|
||||
private static final Paint GAUGE_PAINT = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private static final Path GAUGE_PATH = new Path();
|
||||
|
||||
enum Vertical
|
||||
{
|
||||
@@ -199,6 +214,7 @@ public class Keyboard2View extends View
|
||||
{
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
cancelGaugePress();
|
||||
_pointers.onTouchUp(event.getPointerId(event.getActionIndex()));
|
||||
break;
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
@@ -207,14 +223,23 @@ public class Keyboard2View extends View
|
||||
float tx = event.getX(p);
|
||||
float ty = event.getY(p);
|
||||
KeyboardData.Key key = getKeyAtPosition(tx, ty);
|
||||
if (key != null)
|
||||
if (key != null && UsageGauge.isGaugeKey(key))
|
||||
startGaugePress();
|
||||
else if (key != null)
|
||||
_pointers.onTouchDown(tx, ty, event.getPointerId(p), key);
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (_gaugePressed)
|
||||
{
|
||||
KeyboardData.Key moved = getKeyAtPosition(event.getX(0), event.getY(0));
|
||||
if (moved == null || !UsageGauge.isGaugeKey(moved))
|
||||
cancelGaugePress(); // slid off the gauge: no longer a press on it
|
||||
}
|
||||
for (p = 0; p < event.getPointerCount(); p++)
|
||||
_pointers.onTouchMove(event.getX(p), event.getY(p), event.getPointerId(p));
|
||||
break;
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
cancelGaugePress();
|
||||
_pointers.onTouchCancel();
|
||||
break;
|
||||
default:
|
||||
@@ -294,7 +319,9 @@ public class Keyboard2View extends View
|
||||
{
|
||||
if (!changed)
|
||||
return;
|
||||
if (VERSION.SDK_INT >= 29)
|
||||
// Since SDK 30, this is done automatically:
|
||||
// https://android.googlesource.com/platform/frameworks/base/+/android11-release/core/java/android/inputmethodservice/InputMethodService.java#852
|
||||
if (VERSION.SDK_INT == 29)
|
||||
{
|
||||
// Disable the back-gesture on the keyboard area
|
||||
_cached_exclusion_rect.set(
|
||||
@@ -349,22 +376,150 @@ public class Keyboard2View extends View
|
||||
x += k.shift * _keyWidth;
|
||||
float keyW = _keyWidth * k.width - _tc.horizontal_margin;
|
||||
boolean isKeyDown = _pointers.isKeyDown(k);
|
||||
Theme.Computed.Key tc_key = isKeyDown ? _tc.key_activated : _tc.key;
|
||||
Theme.Computed.Key tc_key;
|
||||
if (isKeyDown)
|
||||
tc_key = _tc.key_activated;
|
||||
else
|
||||
switch (k.role)
|
||||
{
|
||||
case Action: tc_key = _tc.key_action; break;
|
||||
case Space_bar: tc_key = _tc.key_space_bar; break;
|
||||
case Suggestion: tc_key = _tc.key_suggestion; break;
|
||||
default:
|
||||
case Normal: tc_key = _tc.key; break;
|
||||
}
|
||||
drawKeyFrame(canvas, x, y, keyW, keyH, tc_key);
|
||||
if (k.keys[0] != null)
|
||||
if (UsageGauge.isGaugeKey(k))
|
||||
drawUsageGauge(canvas, x, y, keyW, keyH, tc_key);
|
||||
else if (k.keys[0] != null)
|
||||
drawLabel(canvas, k.keys[0], keyW / 2f + x, y, keyH, isKeyDown, tc_key);
|
||||
for (int i = 1; i < 9; i++)
|
||||
{
|
||||
if (k.keys[i] != null)
|
||||
drawSubLabel(canvas, k.keys[i], x, y, keyW, keyH, i, isKeyDown, tc_key);
|
||||
}
|
||||
drawIndication(canvas, k, x, y, keyW, keyH, _tc);
|
||||
if (!UsageGauge.isGaugeKey(k))
|
||||
drawIndication(canvas, k, x, y, keyW, keyH, _tc);
|
||||
x += _keyWidth * k.width;
|
||||
}
|
||||
y += row.height * _tc.row_height;
|
||||
}
|
||||
}
|
||||
|
||||
/** Holding the gauge key opens the usage page. Short taps do nothing: the key never types. */
|
||||
private void startGaugePress()
|
||||
{
|
||||
cancelGaugePress();
|
||||
_gaugePressed = true;
|
||||
_gaugeLongPress = new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (!_gaugePressed)
|
||||
return;
|
||||
_gaugePressed = false;
|
||||
_gaugeLongPress = null;
|
||||
openUsagePage();
|
||||
}
|
||||
};
|
||||
// Same delay the keyboard uses for every other long press, so it feels like the rest of it.
|
||||
_gaugeHandler.postDelayed(_gaugeLongPress, _config != null ? _config.longPressTimeout : 600L);
|
||||
}
|
||||
|
||||
private void cancelGaugePress()
|
||||
{
|
||||
_gaugePressed = false;
|
||||
if (_gaugeLongPress != null)
|
||||
{
|
||||
_gaugeHandler.removeCallbacks(_gaugeLongPress);
|
||||
_gaugeLongPress = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void openUsagePage()
|
||||
{
|
||||
try
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(UsageGauge.USAGE_PAGE_URL));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getContext().startActivity(intent);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// No browser, or the launcher refused: the keyboard must never crash over a long press.
|
||||
}
|
||||
}
|
||||
|
||||
private void drawUsageGauge(Canvas canvas, float x, float y, float keyW,
|
||||
float keyH, Theme.Computed.Key tc)
|
||||
{
|
||||
UsageGauge.Reading reading = UsageGauge.cachedReading();
|
||||
boolean stale = !_config.usageGaugeEnabled
|
||||
|| UsageGauge.isStaleNow(_config.usageGaugeToken);
|
||||
float inset = Math.max(1.f, tc.border_width);
|
||||
RectF bounds = new RectF(x + inset, y + inset, x + keyW - inset, y + keyH - inset);
|
||||
GAUGE_PATH.reset();
|
||||
GAUGE_PATH.addRoundRect(bounds, tc.border_radius, tc.border_radius, Path.Direction.CW);
|
||||
canvas.save();
|
||||
canvas.clipPath(GAUGE_PATH);
|
||||
if (stale || reading == null)
|
||||
{
|
||||
GAUGE_PAINT.setShader(null);
|
||||
GAUGE_PAINT.setColor(0xff55585e);
|
||||
canvas.drawRect(bounds, GAUGE_PAINT);
|
||||
}
|
||||
else
|
||||
{
|
||||
float level = UsageGauge.fillFraction(reading);
|
||||
int hue = UsageGauge.hueColor(level);
|
||||
GAUGE_PAINT.setColor(tc.bg_paint.getColor());
|
||||
canvas.drawRect(bounds, GAUGE_PAINT);
|
||||
if (level > 0)
|
||||
{
|
||||
float fillTop = bounds.bottom - bounds.height() * level;
|
||||
int darker = blendColor(hue, 0xff000000, 0.22f);
|
||||
GAUGE_PAINT.setShader(new LinearGradient(0, bounds.bottom, 0, fillTop,
|
||||
darker, hue, Shader.TileMode.CLAMP));
|
||||
canvas.drawRect(bounds.left, fillTop, bounds.right, bounds.bottom, GAUGE_PAINT);
|
||||
GAUGE_PAINT.setShader(null);
|
||||
}
|
||||
}
|
||||
String label = reading == null ? "—" : String.format(Locale.US, "%.1f", reading.spentTodayUsd);
|
||||
float size = Math.min(_subLabelSize, keyW * 0.40f);
|
||||
GAUGE_PAINT.setTextSize(size);
|
||||
GAUGE_PAINT.setTypeface(android.graphics.Typeface.DEFAULT);
|
||||
GAUGE_PAINT.setTextAlign(Paint.Align.CENTER);
|
||||
// Stale hides the number behind a dash; a partial day keeps the number but dims it, so a
|
||||
// floor can never be read as the day's total. A low balance stays red: that reading is live.
|
||||
int labelColor = stale ? 0xff92949a :
|
||||
(UsageGauge.isLowBalance(reading) ? 0xffe53935 :
|
||||
(reading.partial ? 0xff92949a : _theme.labelColor));
|
||||
if (!stale)
|
||||
{
|
||||
int luminance = (android.graphics.Color.red(labelColor) * 299
|
||||
+ android.graphics.Color.green(labelColor) * 587
|
||||
+ android.graphics.Color.blue(labelColor) * 114) / 1000;
|
||||
GAUGE_PAINT.setStyle(Paint.Style.STROKE);
|
||||
GAUGE_PAINT.setStrokeWidth(Math.max(1.f, size * 0.12f));
|
||||
GAUGE_PAINT.setColor(luminance > 140 ? 0xff202020 : 0xfff5f5f5);
|
||||
canvas.drawText(label, bounds.centerX(),
|
||||
(keyH - GAUGE_PAINT.ascent() - GAUGE_PAINT.descent()) / 2f + y, GAUGE_PAINT);
|
||||
GAUGE_PAINT.setStyle(Paint.Style.FILL);
|
||||
}
|
||||
GAUGE_PAINT.setColor(labelColor);
|
||||
canvas.drawText(label, bounds.centerX(),
|
||||
(keyH - GAUGE_PAINT.ascent() - GAUGE_PAINT.descent()) / 2f + y, GAUGE_PAINT);
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
private static int blendColor(int from, int to, float amount)
|
||||
{
|
||||
return android.graphics.Color.rgb(
|
||||
(int)(android.graphics.Color.red(from) * (1 - amount) + android.graphics.Color.red(to) * amount),
|
||||
(int)(android.graphics.Color.green(from) * (1 - amount) + android.graphics.Color.green(to) * amount),
|
||||
(int)(android.graphics.Color.blue(from) * (1 - amount) + android.graphics.Color.blue(to) * amount));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow()
|
||||
{
|
||||
@@ -431,7 +586,19 @@ public class Keyboard2View extends View
|
||||
if (kv == null)
|
||||
return;
|
||||
float textSize = scaleTextSize(kv, true);
|
||||
Paint p = tc.label_paint(kv.hasFlagsAny(KeyValue.FLAG_KEY_FONT), labelColor(kv, isKeyDown, false), textSize);
|
||||
// DeepSeek peak/off-peak: the space bar's joystick glyph doubles as the rate
|
||||
// indicator (neon blue = off-peak, neon pink = peak).
|
||||
int color = kv.getKind() == KeyValue.Kind.Editing
|
||||
&& KeyValue.Editing.SPACE_BAR.equals(kv.getEditing())
|
||||
? DeepSeekPeak.colorFor(System.currentTimeMillis())
|
||||
: labelColor(kv, isKeyDown, false);
|
||||
// The emoji badge (0xE01D, Alt's top-right corner) sits in a corner slot,
|
||||
// which labelColor() would dim to secondaryLabelColor. Draw it in labelColor
|
||||
// so it matches the rest of the keyboard's labels.
|
||||
String glyph = kv.getString();
|
||||
if (glyph != null && glyph.length() == 1 && glyph.charAt(0) == 0xE01D)
|
||||
color = _theme.labelColor;
|
||||
Paint p = tc.label_paint(kv.hasFlagsAny(KeyValue.FLAG_KEY_FONT), color, textSize);
|
||||
canvas.drawText(kv.getString(), x, (keyH - p.ascent() - p.descent()) / 2f + y, p);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class KeyboardData
|
||||
ArrayList<Row> rows_ = new ArrayList<Row>();
|
||||
for (Row r : rows)
|
||||
rows_.add(r.mapKeys(f));
|
||||
return new KeyboardData(this, rows_);
|
||||
return with_rows(rows_);
|
||||
}
|
||||
|
||||
/** Add keys from the given iterator into the keyboard. Preferred position is
|
||||
@@ -61,7 +61,7 @@ public final class KeyboardData
|
||||
}
|
||||
for (KeyValue kv : unplaced_keys)
|
||||
add_key_to_preferred_pos(rows, kv, PreferredPos.ANYWHERE);
|
||||
return new KeyboardData(this, rows);
|
||||
return with_rows(rows);
|
||||
}
|
||||
|
||||
/** Place a key on the keyboard according to its preferred position. Mutates
|
||||
@@ -141,9 +141,9 @@ public final class KeyboardData
|
||||
keys.add(nps.get(i));
|
||||
}
|
||||
}
|
||||
extendedRows.add(new Row(keys, row.height, row.shift));
|
||||
extendedRows.add(row.with_keys(keys));
|
||||
}
|
||||
return new KeyboardData(this, extendedRows);
|
||||
return with_rows(extendedRows);
|
||||
}
|
||||
|
||||
/** Insert the given row at the given indice. The row is scaled so that the
|
||||
@@ -152,7 +152,7 @@ public final class KeyboardData
|
||||
{
|
||||
ArrayList<Row> rows_ = new ArrayList<Row>(this.rows);
|
||||
rows_.add(i, row.updateWidth(keysWidth));
|
||||
return new KeyboardData(this, rows_);
|
||||
return with_rows(rows_);
|
||||
}
|
||||
|
||||
public Key findKeyWithValue(KeyValue kv)
|
||||
@@ -304,10 +304,11 @@ public final class KeyboardData
|
||||
}
|
||||
|
||||
/** Copies the fields of a keyboard, with rows changed. */
|
||||
protected KeyboardData(KeyboardData src, List<Row> rows)
|
||||
public KeyboardData with_rows(List<Row> rows_)
|
||||
{
|
||||
this(rows, compute_max_width(rows), src.modmap, src.script,
|
||||
src.numpad_script, src.name, src.bottom_row, src.embedded_number_row, src.locale_extra_keys);
|
||||
return new KeyboardData(rows_, compute_max_width(rows_), modmap, script,
|
||||
numpad_script, name, bottom_row, embedded_number_row,
|
||||
locale_extra_keys);
|
||||
}
|
||||
|
||||
public static class Row
|
||||
@@ -347,7 +348,14 @@ public final class KeyboardData
|
||||
|
||||
public Row copy()
|
||||
{
|
||||
return new Row(new ArrayList<Key>(keys), height, shift);
|
||||
return with_keys(new ArrayList<Key>(keys));
|
||||
}
|
||||
|
||||
/** Copy the row with the keys changed. The list [keys] is not copied and
|
||||
should be immutable. */
|
||||
public Row with_keys(List<Key> keys)
|
||||
{
|
||||
return new Row(keys, height, shift);
|
||||
}
|
||||
|
||||
public void getKeys(Map<KeyValue, KeyPos> dst, int row)
|
||||
@@ -368,7 +376,7 @@ public final class KeyboardData
|
||||
ArrayList<Key> keys_ = new ArrayList<Key>();
|
||||
for (Key k : keys)
|
||||
keys_.add(f.apply(k));
|
||||
return new Row(keys_, height, shift);
|
||||
return with_keys(keys_);
|
||||
}
|
||||
|
||||
/** Change the width of every keys so that the row is 's' units wide. */
|
||||
@@ -406,12 +414,14 @@ public final class KeyboardData
|
||||
public final float shift;
|
||||
/** String printed on the keys. It has no other effect. */
|
||||
public final String indication;
|
||||
/** Keys are rendered differently according to their role. */
|
||||
public final Role role;
|
||||
|
||||
/** Whether a key was declared with the 'loc' prefix. */
|
||||
public static final int F_LOC = 1;
|
||||
public static final int ALL_FLAGS = F_LOC;
|
||||
|
||||
protected Key(KeyValue[] ks, KeyValue antic, int f, float w, float s, String i)
|
||||
protected Key(KeyValue[] ks, KeyValue antic, int f, float w, float s, String i, Role role_)
|
||||
{
|
||||
keys = ks;
|
||||
anticircle = antic;
|
||||
@@ -419,9 +429,11 @@ public final class KeyboardData
|
||||
width = Math.max(w, 0f);
|
||||
shift = Math.max(s, 0f);
|
||||
indication = i;
|
||||
role = role_;
|
||||
}
|
||||
|
||||
static final Key EMPTY = new Key(new KeyValue[9], null, 0, 1.f, 1.f, null);
|
||||
static final Key EMPTY =
|
||||
new Key(new KeyValue[9], null, 0, 1.f, 1.f, null, Role.Normal);
|
||||
|
||||
/** Read a key value attribute that have a synonym. Having both synonyms
|
||||
present at the same time is an error.
|
||||
@@ -489,9 +501,11 @@ public final class KeyboardData
|
||||
float width = attribute_float(parser, "width", 1f);
|
||||
float shift = attribute_float(parser, "shift", 0.f);
|
||||
String indication = parser.getAttributeValue(null, "indication");
|
||||
String role_str = parser.getAttributeValue(null, "role");
|
||||
Role role = (role_str == null) ? Role.Normal : Role.parse(role_str);
|
||||
while (parser.next() != XmlPullParser.END_TAG)
|
||||
continue;
|
||||
return new Key(ks, anticircle, keysflags, width, shift, indication);
|
||||
return new Key(ks, anticircle, keysflags, width, shift, indication, role);
|
||||
}
|
||||
|
||||
/** Whether key at [index] as [flag]. */
|
||||
@@ -503,7 +517,7 @@ public final class KeyboardData
|
||||
/** New key with the width multiplied by 's'. */
|
||||
public Key scaleWidth(float s)
|
||||
{
|
||||
return new Key(keys, anticircle, keysflags, width * s, shift, indication);
|
||||
return new Key(keys, anticircle, keysflags, width * s, shift, indication, role);
|
||||
}
|
||||
|
||||
public void getKeys(Map<KeyValue, KeyPos> dst, int row, int col)
|
||||
@@ -524,12 +538,22 @@ public final class KeyboardData
|
||||
for (int j = 0; j < keys.length; j++) ks[j] = keys[j];
|
||||
ks[i] = kv;
|
||||
int flags = (keysflags & ~(ALL_FLAGS << i));
|
||||
return new Key(ks, anticircle, flags, width, shift, indication);
|
||||
return new Key(ks, anticircle, flags, width, shift, indication, role);
|
||||
}
|
||||
|
||||
public Key withWidth(float w)
|
||||
{
|
||||
return withWidthAndShift(w, shift);
|
||||
}
|
||||
|
||||
public Key withShift(float s)
|
||||
{
|
||||
return new Key(keys, anticircle, keysflags, width, s, indication);
|
||||
return withWidthAndShift(width, s);
|
||||
}
|
||||
|
||||
public Key withWidthAndShift(float w, float s)
|
||||
{
|
||||
return new Key(keys, anticircle, keysflags, w, s, indication, role);
|
||||
}
|
||||
|
||||
public boolean hasValue(KeyValue kv)
|
||||
@@ -539,6 +563,25 @@ public final class KeyboardData
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static enum Role
|
||||
{
|
||||
Normal,
|
||||
Action, // Generally Shift, Delete and keys on the bottom row
|
||||
Space_bar,
|
||||
Suggestion;
|
||||
|
||||
public static Role parse(String str)
|
||||
{
|
||||
switch (str)
|
||||
{
|
||||
case "action": return Action;
|
||||
case "space_bar": return Space_bar;
|
||||
case "suggestion": return Suggestion;
|
||||
default: case "normal": return Normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Not using Function<KeyValue, KeyValue> to keep compatibility with Android 6.
|
||||
@@ -555,7 +598,7 @@ public final class KeyboardData
|
||||
for (int i = 0; i < ks.length; i++)
|
||||
if (k.keys[i] != null)
|
||||
ks[i] = apply(k.keys[i], k.keyHasFlag(i, Key.F_LOC));
|
||||
return new Key(ks, k.anticircle, k.keysflags, k.width, k.shift, k.indication);
|
||||
return new Key(ks, k.anticircle, k.keysflags, k.width, k.shift, k.indication, k.role);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package juloo.keyboard2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public final class LayoutLandscapeModifier
|
||||
{
|
||||
/** Width added to the layout, in the key width unit of the layout. */
|
||||
public static final int ADDED_WIDTH = 5;
|
||||
|
||||
public static KeyboardData transform_to_landscape(KeyboardData kw)
|
||||
{
|
||||
ArrayList<KeyboardData.Row> new_rows = new ArrayList<KeyboardData.Row>();
|
||||
// Bottom row as index 0. Used by [add_middle_column] below.
|
||||
int row_index = kw.rows.size() - 1;
|
||||
for (KeyboardData.Row r : kw.rows)
|
||||
new_rows.add(split_row(r, row_index--));
|
||||
return kw.with_rows(new_rows);
|
||||
}
|
||||
|
||||
public static KeyboardData.Row transform_number_row(KeyboardData.Row r)
|
||||
{
|
||||
return split_row(r, -1);
|
||||
}
|
||||
|
||||
static KeyboardData.Row split_row(KeyboardData.Row r, int row_index)
|
||||
{
|
||||
if (r.keys.size() < 2)
|
||||
return r;
|
||||
// Split the row at the key that overlaps that mid region. If the mid
|
||||
// region is entirely covered by one key, it is duplicated.
|
||||
float mid_start = r.keysWidth / 2 - 0.25f;
|
||||
float mid_end = mid_start + 0.5f;
|
||||
float off = 0f;
|
||||
int i = 0;
|
||||
int end = r.keys.size() - 1; // Exclude the last key to force a split
|
||||
for (; true; i++)
|
||||
{
|
||||
KeyboardData.Key k = r.keys.get(i);
|
||||
off += k.shift + k.width;
|
||||
if (off > mid_start || i == end)
|
||||
{
|
||||
if (off > mid_end)
|
||||
return duplicate_at_index(r, i, off, row_index);
|
||||
return split_at_index(r, i + 1, row_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Insert [ADDED_WIDTH] empty space before the key at index [i]. */
|
||||
static KeyboardData.Row split_at_index(KeyboardData.Row r, int i,
|
||||
int row_index)
|
||||
{
|
||||
List<KeyboardData.Key> new_keys = new ArrayList<KeyboardData.Key>(r.keys);
|
||||
KeyboardData.Key k = new_keys.get(i);
|
||||
new_keys.set(i, k.withShift(k.shift + ADDED_WIDTH));
|
||||
add_middle_key(new_keys, i, row_index);
|
||||
return r.with_keys(new_keys);
|
||||
}
|
||||
|
||||
/** Duplicate the key at index [i] and insert [ADDED_WIDTH] empty space in
|
||||
between. */
|
||||
static KeyboardData.Row duplicate_at_index(KeyboardData.Row r, int i,
|
||||
float off, int row_index)
|
||||
{
|
||||
List<KeyboardData.Key> new_keys = new ArrayList<KeyboardData.Key>(r.keys);
|
||||
KeyboardData.Key k = new_keys.get(i);
|
||||
// Reduce the size of the duplicated keys if they would add more than 1 to
|
||||
// the width.
|
||||
float k_width = (k.width + 1.f) / 2;
|
||||
// Adjust the size on each sides when the key is not totally centered.
|
||||
float mid_d = Math.min(off - (r.keysWidth + k.width) / 2, k_width - 1);
|
||||
new_keys.add(i + 1, k.withWidthAndShift(k_width + mid_d, ADDED_WIDTH - 1));
|
||||
new_keys.set(i, k.withWidth(k_width - mid_d));
|
||||
add_middle_key(new_keys, i + 1, row_index);
|
||||
return r.with_keys(new_keys);
|
||||
}
|
||||
|
||||
/** Add the middle column defined in [split_middle_column.xml]. */
|
||||
static void add_middle_key(List<KeyboardData.Key> new_keys, int i,
|
||||
int row_index)
|
||||
{
|
||||
List<KeyboardData.Key> mid_keys = LayoutModifier.split_middle_column.keys;
|
||||
if (row_index >= mid_keys.size())
|
||||
return;
|
||||
KeyboardData.Key mid_key = mid_keys.get(row_index);
|
||||
KeyboardData.Key right_key = new_keys.get(i);
|
||||
float shift = (right_key.shift - mid_key.width) / 2.f;
|
||||
new_keys.set(i, right_key.withShift(shift));
|
||||
new_keys.add(i, mid_key.withShift(shift));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,8 @@ public final class LayoutModifier
|
||||
static KeyboardData.Row number_row_no_symbols;
|
||||
static KeyboardData.Row number_row_symbols;
|
||||
static KeyboardData num_pad;
|
||||
// Not used in this file but defined here for convenience.
|
||||
public static KeyboardData.Row split_middle_column;
|
||||
|
||||
/** Update the layout according to the configuration.
|
||||
* - Remove the switching key if it isn't needed
|
||||
@@ -46,11 +48,16 @@ public final class LayoutModifier
|
||||
else if (globalConfig.add_number_row && !kw.embedded_number_row) // The numpad removes the number row
|
||||
{
|
||||
added_number_row = modify_number_row(globalConfig.number_row_symbols ? number_row_symbols : number_row_no_symbols, kw);
|
||||
if (globalConfig.split_layout)
|
||||
added_number_row = LayoutLandscapeModifier.transform_number_row(added_number_row);
|
||||
remove_keys.addAll(added_number_row.getKeys(0).keySet());
|
||||
}
|
||||
// Add the bottom row before computing the extra keys
|
||||
if (kw.bottom_row)
|
||||
kw = kw.insert_row(bottom_row, kw.rows.size());
|
||||
// Split the layout in landscape orientation
|
||||
if (globalConfig.split_layout)
|
||||
kw = LayoutLandscapeModifier.transform_to_landscape(kw);
|
||||
// Compose keys to add to the layout
|
||||
// 'extra_keys_keyset' reflects changes made to 'extra_keys'
|
||||
Set<KeyValue> extra_keys_keyset = extra_keys.keySet();
|
||||
@@ -204,6 +211,7 @@ public final class LayoutModifier
|
||||
number_row_symbols = KeyboardData.load_row(res, R.xml.number_row);
|
||||
bottom_row = KeyboardData.load_row(res, R.xml.bottom_row);
|
||||
num_pad = KeyboardData.load_num_pad(res);
|
||||
split_middle_column = KeyboardData.load_row(res, R.xml.split_middle_column);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,10 @@ public final class Pointers implements Handler.Callback
|
||||
if (ptr.hasFlagsAny(FLAG_P_SLIDING))
|
||||
{
|
||||
clearLatched();
|
||||
ptr.sliding.onTouchUp(ptr);
|
||||
if (ptr.joypad != null)
|
||||
ptr.joypad.onTouchUp(ptr);
|
||||
else
|
||||
ptr.sliding.onTouchUp(ptr);
|
||||
return;
|
||||
}
|
||||
stopLongPress(ptr);
|
||||
@@ -211,7 +214,13 @@ public final class Pointers implements Handler.Callback
|
||||
KeyValue value = _handler.modifyKey(key.keys[0], mods);
|
||||
Pointer ptr = make_pointer(pointerId, key, value, x, y, mods);
|
||||
_ptrs.add(ptr);
|
||||
startLongPress(ptr);
|
||||
// Space bar gets a slightly shorter long-press (500ms) so the joypad
|
||||
// activates quickly when holding space
|
||||
if (value != null && value.getKind() == KeyValue.Kind.Editing
|
||||
&& value.getEditing() == KeyValue.Editing.SPACE_BAR)
|
||||
startLongPress(ptr, 500);
|
||||
else
|
||||
startLongPress(ptr);
|
||||
_handler.onPointerDown(value, false);
|
||||
}
|
||||
|
||||
@@ -267,7 +276,14 @@ public final class Pointers implements Handler.Callback
|
||||
return;
|
||||
if (ptr.hasFlagsAny(FLAG_P_SLIDING))
|
||||
{
|
||||
ptr.sliding.onTouchMove(ptr, x, y);
|
||||
if (ptr.joypad != null)
|
||||
{
|
||||
ptr.joypad.onTouchMove(ptr, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr.sliding.onTouchMove(ptr, x, y);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,6 +328,13 @@ public final class Pointers implements Handler.Callback
|
||||
startSliding(ptr, x, y, dx, dy, new_value);
|
||||
_handler.onPointerDown(new_value, true);
|
||||
}
|
||||
else if (ptr.value != null
|
||||
&& ptr.value.getKind() == KeyValue.Kind.Slider
|
||||
&& ptr.value.getSlider().isJoystick())
|
||||
{
|
||||
// Joystick: swipe in any direction activates it
|
||||
startSliding(ptr, x, y, dx, dy, ptr.value);
|
||||
}
|
||||
|
||||
}
|
||||
else if (ptr.gesture.changed_direction(direction))
|
||||
@@ -401,7 +424,15 @@ public final class Pointers implements Handler.Callback
|
||||
{
|
||||
if (ptr.timeoutWhat == msg.what)
|
||||
{
|
||||
handleLongPress(ptr);
|
||||
// Joypad auto-repeat takes priority over long-press/hold
|
||||
if (ptr.joypad != null && ptr.hasFlagsAny(FLAG_P_SLIDING))
|
||||
{
|
||||
ptr.joypad.doRepeat(ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
handleLongPress(ptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -417,6 +448,14 @@ public final class Pointers implements Handler.Callback
|
||||
_longpress_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout);
|
||||
}
|
||||
|
||||
/** Start long-press timer with a custom timeout override (ms). */
|
||||
private void startLongPress(Pointer ptr, long timeoutMs)
|
||||
{
|
||||
int what = (uniqueTimeoutWhat++);
|
||||
ptr.timeoutWhat = what;
|
||||
_longpress_handler.sendEmptyMessageDelayed(what, timeoutMs);
|
||||
}
|
||||
|
||||
private void stopLongPress(Pointer ptr)
|
||||
{
|
||||
_longpress_handler.removeMessages(ptr.timeoutWhat);
|
||||
@@ -449,6 +488,16 @@ public final class Pointers implements Handler.Callback
|
||||
_handler.onPointerDown(kv, true);
|
||||
return;
|
||||
}
|
||||
// Space bar long-press: enter joypad cursor mode
|
||||
if (ptr.value.getKind() == KeyValue.Kind.Editing
|
||||
&& ptr.value.getEditing() == KeyValue.Editing.SPACE_BAR)
|
||||
{
|
||||
stopLongPress(ptr);
|
||||
ptr.flags |= FLAG_P_SLIDING;
|
||||
ptr.joypad = new Joypad(ptr.downX, ptr.downY,
|
||||
KeyValue.Slider.Cursor_joystick);
|
||||
return;
|
||||
}
|
||||
// Special keys
|
||||
if (kv.hasFlagsAny(KeyValue.FLAG_SPECIAL))
|
||||
return;
|
||||
@@ -472,7 +521,15 @@ public final class Pointers implements Handler.Callback
|
||||
int diry = dy < 0 ? -r : r;
|
||||
stopLongPress(ptr);
|
||||
ptr.flags |= FLAG_P_SLIDING;
|
||||
ptr.sliding = new Sliding(x, y, dirx, diry, kv.getSlider());
|
||||
KeyValue.Slider s = kv.getSlider();
|
||||
if (s.isJoystick())
|
||||
{
|
||||
ptr.joypad = new Joypad(x, y, s);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr.sliding = new Sliding(x, y, dirx, diry, s);
|
||||
}
|
||||
}
|
||||
|
||||
/** Return the [FLAG_P_*] flags that correspond to pressing [kv]. */
|
||||
@@ -556,6 +613,8 @@ public final class Pointers implements Handler.Callback
|
||||
public int timeoutWhat;
|
||||
/** [null] when not in sliding mode. */
|
||||
public Sliding sliding;
|
||||
/** [null] when not in joypad mode. */
|
||||
public Joypad joypad;
|
||||
|
||||
public Pointer(int p, KeyboardData.Key k, KeyValue v, float x, float y, Modifiers m, int f)
|
||||
{
|
||||
@@ -569,6 +628,7 @@ public final class Pointers implements Handler.Callback
|
||||
flags = f;
|
||||
timeoutWhat = -1;
|
||||
sliding = null;
|
||||
joypad = null;
|
||||
}
|
||||
|
||||
public boolean hasFlagsAny(int has)
|
||||
@@ -672,6 +732,122 @@ public final class Pointers implements Handler.Callback
|
||||
}
|
||||
}
|
||||
|
||||
/** Joypad: direction-lock + auto-repeat cursor control with speed curve.
|
||||
Designed for the space bar (limited room for finger travel).
|
||||
|
||||
Once the finger moves past the dead zone, the dominant direction is
|
||||
locked and cursor events auto-repeat at a rate and step count that
|
||||
increase with finger distance from origin (farther = faster). */
|
||||
public final class Joypad
|
||||
{
|
||||
/** The last locked direction, or null if inactive. */
|
||||
KeyValue.Slider _activeDir = null;
|
||||
/** Position of the finger when joypad was activated (down point). */
|
||||
float _originX;
|
||||
float _originY;
|
||||
/** The slider this joypad delegates to. */
|
||||
KeyValue.Slider slider;
|
||||
/** Current speed: steps per auto-repeat tick [1..5]. */
|
||||
int _stepsPerTick = 1;
|
||||
/** Current interval between ticks (ms). */
|
||||
int _repeatMs;
|
||||
|
||||
public Joypad(float x, float y, KeyValue.Slider s)
|
||||
{
|
||||
_originX = x;
|
||||
_originY = y;
|
||||
slider = s;
|
||||
_repeatMs = (int)_config.longPressInterval;
|
||||
}
|
||||
|
||||
/** Pick the dominant direction from a finger offset deltas. */
|
||||
KeyValue.Slider pickDirection(float dx, float dy)
|
||||
{
|
||||
if (Math.abs(dx) >= Math.abs(dy))
|
||||
return (dx > 0) ? KeyValue.Slider.Cursor_right
|
||||
: KeyValue.Slider.Cursor_left;
|
||||
else
|
||||
return (dy > 0) ? KeyValue.Slider.Cursor_down
|
||||
: KeyValue.Slider.Cursor_up;
|
||||
}
|
||||
|
||||
/** Compute speed curve from finger displacement.
|
||||
[dist] = Manhattan distance from origin.
|
||||
Returns [stepsPerTick, repeatIntervalMs]. */
|
||||
void computeSpeed(float dist)
|
||||
{
|
||||
float d = dist - _config.swipe_dist_px; // distance beyond dead zone
|
||||
if (d < 1f) d = 1f;
|
||||
float maxD = _config.swipe_dist_px * 6f; // ~6x dead zone = max speed
|
||||
float t = Math.min(d / maxD, 1f); // 0..1
|
||||
// Quadratic curve: gentle near center, faster at extremes
|
||||
float curve = t * t;
|
||||
_stepsPerTick = 1 + (int)(curve * 4f); // 1..5 steps/tick
|
||||
int base = (int)_config.longPressInterval;
|
||||
_repeatMs = Math.max(30, base - (int)((base - 30) * curve));
|
||||
}
|
||||
|
||||
public void onTouchMove(Pointer ptr, float x, float y)
|
||||
{
|
||||
float dx = x - _originX;
|
||||
float dy = y - _originY;
|
||||
float dist = Math.abs(dx) + Math.abs(dy);
|
||||
|
||||
// Dead zone: finger hasn't moved far enough from origin
|
||||
if (dist < _config.swipe_dist_px)
|
||||
{
|
||||
if (_activeDir != null)
|
||||
{
|
||||
// Returned to center → stop auto-repeat
|
||||
_activeDir = null;
|
||||
_longpress_handler.removeMessages(ptr.timeoutWhat);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Update speed curve from current distance
|
||||
computeSpeed(dist);
|
||||
|
||||
KeyValue.Slider newDir = pickDirection(dx, dy);
|
||||
|
||||
if (newDir != _activeDir)
|
||||
{
|
||||
// Direction changed (or first lock) → fire and start/restart auto-repeat
|
||||
_activeDir = newDir;
|
||||
_longpress_handler.removeMessages(ptr.timeoutWhat);
|
||||
_handler.onPointerHold(
|
||||
KeyValue.sliderKey(newDir, _stepsPerTick), ptr.modifiers);
|
||||
// Schedule next repeat with computed interval
|
||||
_longpress_handler.sendEmptyMessageDelayed(
|
||||
ptr.timeoutWhat, _repeatMs);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Same direction: don't reschedule timer (touch events come faster
|
||||
// than the timer, which would keep pushing it out). The pending
|
||||
// doRepeat tick will pick up the updated _stepsPerTick / _repeatMs.
|
||||
}
|
||||
}
|
||||
|
||||
/** Called by Pointers.handleMessage for auto-repeat ticks. */
|
||||
public void doRepeat(Pointer ptr)
|
||||
{
|
||||
if (_activeDir == null) return;
|
||||
_handler.onPointerHold(
|
||||
KeyValue.sliderKey(_activeDir, _stepsPerTick), ptr.modifiers);
|
||||
_longpress_handler.sendEmptyMessageDelayed(
|
||||
ptr.timeoutWhat, _repeatMs);
|
||||
}
|
||||
|
||||
public void onTouchUp(Pointer ptr)
|
||||
{
|
||||
_activeDir = null;
|
||||
_longpress_handler.removeMessages(ptr.timeoutWhat);
|
||||
removePtr(ptr);
|
||||
_handler.onPointerFlagsChanged(false);
|
||||
}
|
||||
}
|
||||
|
||||
/** Represent modifiers currently activated.
|
||||
Sorted in the order they should be evaluated. */
|
||||
public static final class Modifiers
|
||||
|
||||
@@ -12,6 +12,8 @@ public class Theme
|
||||
// Key colors
|
||||
public final int colorKey;
|
||||
public final int colorKeyActivated;
|
||||
public final int colorKeyAction;
|
||||
public final int colorKeySpaceBar;
|
||||
|
||||
// Label colors
|
||||
public final int lockedColor;
|
||||
@@ -26,6 +28,8 @@ public class Theme
|
||||
public final float keyBorderRadius;
|
||||
public final float keyBorderWidth;
|
||||
public final float keyBorderWidthActivated;
|
||||
public final float keyBorderWidthAction;
|
||||
public final float keyBorderWidthSpaceBar;
|
||||
public final int keyBorderColorLeft;
|
||||
public final int keyBorderColorTop;
|
||||
public final int keyBorderColorRight;
|
||||
@@ -40,6 +44,8 @@ public class Theme
|
||||
TypedArray s = context.getTheme().obtainStyledAttributes(attrs, R.styleable.keyboard, 0, 0);
|
||||
colorKey = s.getColor(R.styleable.keyboard_colorKey, 0);
|
||||
colorKeyActivated = s.getColor(R.styleable.keyboard_colorKeyActivated, 0);
|
||||
colorKeyAction = s.getColor(R.styleable.keyboard_colorKeyAction, colorKey);
|
||||
colorKeySpaceBar = s.getColor(R.styleable.keyboard_colorKeySpaceBar, colorKey);
|
||||
// colorKeyboard = s.getColor(R.styleable.keyboard_colorKeyboard, 0);
|
||||
colorNavBar = s.getColor(R.styleable.keyboard_navigationBarColor, 0);
|
||||
isLightNavBar = s.getBoolean(R.styleable.keyboard_windowLightNavigationBar, false);
|
||||
@@ -55,6 +61,8 @@ public class Theme
|
||||
keyBorderRadius = s.getDimension(R.styleable.keyboard_keyBorderRadius, 0);
|
||||
keyBorderWidth = s.getDimension(R.styleable.keyboard_keyBorderWidth, 0);
|
||||
keyBorderWidthActivated = s.getDimension(R.styleable.keyboard_keyBorderWidthActivated, 0);
|
||||
keyBorderWidthAction = s.getDimension(R.styleable.keyboard_keyBorderWidthAction, 0);
|
||||
keyBorderWidthSpaceBar = s.getDimension(R.styleable.keyboard_keyBorderWidthSpaceBar, 0);
|
||||
keyBorderColorLeft = s.getColor(R.styleable.keyboard_keyBorderColorLeft, colorKey);
|
||||
keyBorderColorTop = s.getColor(R.styleable.keyboard_keyBorderColorTop, colorKey);
|
||||
keyBorderColorRight = s.getColor(R.styleable.keyboard_keyBorderColorRight, colorKey);
|
||||
@@ -63,7 +71,7 @@ public class Theme
|
||||
}
|
||||
|
||||
/** Interpolate the 'value' component toward its opposite by 'alpha'. */
|
||||
int adjustLight(int color, float alpha)
|
||||
static int adjustLight(int color, float alpha)
|
||||
{
|
||||
float[] hsv = new float[3];
|
||||
Color.colorToHSV(color, hsv);
|
||||
@@ -101,6 +109,9 @@ public class Theme
|
||||
|
||||
public final Key key;
|
||||
public final Key key_activated;
|
||||
public final Key key_action;
|
||||
public final Key key_space_bar;
|
||||
public final Key key_suggestion;
|
||||
|
||||
public Computed(Theme theme, Config config, float keyWidth, KeyboardData layout)
|
||||
{
|
||||
@@ -114,8 +125,11 @@ public class Theme
|
||||
// added on the right and on the bottom of every keys.
|
||||
margin_top = config.marginTop + vertical_margin / 2;
|
||||
margin_left = horizontal_margin / 2;
|
||||
key = new Key(theme, config, keyWidth, false);
|
||||
key_activated = new Key(theme, config, keyWidth, true);
|
||||
key = new Key(theme, config, keyWidth, false, KeyboardData.Key.Role.Normal);
|
||||
key_action = new Key(theme, config, keyWidth, false, KeyboardData.Key.Role.Action);
|
||||
key_space_bar = new Key(theme, config, keyWidth, false, KeyboardData.Key.Role.Space_bar);
|
||||
key_activated = new Key(theme, config, keyWidth, true, KeyboardData.Key.Role.Normal);
|
||||
key_suggestion = new Key(theme, config, keyWidth, false, KeyboardData.Key.Role.Suggestion);
|
||||
indication_paint = init_label_paint(config, null);
|
||||
indication_paint.setColor(theme.subLabelColor);
|
||||
}
|
||||
@@ -135,20 +149,41 @@ public class Theme
|
||||
final Paint _special_sublabel_paint;
|
||||
final int _label_alpha_bits;
|
||||
|
||||
public Key(Theme theme, Config config, float keyWidth, boolean activated)
|
||||
public Key(Theme theme, Config config, float keyWidth, boolean activated,
|
||||
KeyboardData.Key.Role role)
|
||||
{
|
||||
bg_paint.setColor(activated ? theme.colorKeyActivated : theme.colorKey);
|
||||
if (config.borderConfig)
|
||||
border_radius = config.borderConfig ? config.customBorderRadius * keyWidth : theme.keyBorderRadius;
|
||||
int bg_color;
|
||||
if (activated)
|
||||
{
|
||||
border_radius = config.customBorderRadius * keyWidth;
|
||||
border_width = config.customBorderLineWidth;
|
||||
bg_color = theme.colorKeyActivated;
|
||||
border_width = theme.keyBorderWidthActivated;
|
||||
bg_paint.setAlpha(config.keyActivatedOpacity);
|
||||
}
|
||||
else
|
||||
{
|
||||
border_radius = theme.keyBorderRadius;
|
||||
border_width = activated ? theme.keyBorderWidthActivated : theme.keyBorderWidth;
|
||||
switch (role)
|
||||
{
|
||||
case Action:
|
||||
bg_color = theme.colorKeyAction;
|
||||
border_width = theme.keyBorderWidthAction;
|
||||
break;
|
||||
case Space_bar:
|
||||
bg_color = theme.colorKeySpaceBar;
|
||||
border_width = theme.keyBorderWidthSpaceBar;
|
||||
break;
|
||||
case Suggestion:
|
||||
bg_color = 0;
|
||||
border_width = 0;
|
||||
break;
|
||||
default:
|
||||
bg_color = theme.colorKey;
|
||||
border_width = config.borderConfig ? config.customBorderLineWidth : theme.keyBorderWidth;
|
||||
break;
|
||||
}
|
||||
bg_paint.setAlpha(config.keyOpacity);
|
||||
}
|
||||
bg_paint.setAlpha(activated ? config.keyActivatedOpacity : config.keyOpacity);
|
||||
bg_paint.setColor(bg_color);
|
||||
border_left_paint = init_border_paint(config, border_width, theme.keyBorderColorLeft);
|
||||
border_top_paint = init_border_paint(config, border_width, theme.keyBorderColorTop);
|
||||
border_right_paint = init_border_paint(config, border_width, theme.keyBorderColorRight);
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
package juloo.keyboard2;
|
||||
|
||||
import android.graphics.Color;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/** Data and rendering logic for the display-only usage gauge. */
|
||||
public final class UsageGauge
|
||||
{
|
||||
// The layout stores this marker in 'indication', so it identifies the key
|
||||
// without adding a character to the generated compose table.
|
||||
public static final String KEY_MARKER = "usage_gauge";
|
||||
/** Long-pressing the gauge key opens this in the browser. */
|
||||
public static final String USAGE_PAGE_URL = "https://platform.deepseek.com/usage";
|
||||
public static final long REFRESH_AFTER_MS = 5 * 60 * 1000L;
|
||||
// The sampler publishes every 15 minutes, so one missed tick must not read as stale: three
|
||||
// do. A threshold equal to the interval makes the gauge blink to '--' on every cycle.
|
||||
public static final long STALE_AFTER_MS = 45 * 60 * 1000L;
|
||||
|
||||
public static final class Reading
|
||||
{
|
||||
public final double h5Pct;
|
||||
public final double weeklyPct;
|
||||
public final double spentTodayUsd;
|
||||
public final double balance;
|
||||
/** True when the server's spend window opened mid-day: the total is a floor, not the day. */
|
||||
public final boolean partial;
|
||||
/** True when the server says the reading it sent is too old to present as current. */
|
||||
public final boolean serverStale;
|
||||
|
||||
Reading(double h5, double weekly, double spent, double balance_)
|
||||
{
|
||||
this(h5, weekly, spent, balance_, false, false);
|
||||
}
|
||||
|
||||
Reading(double h5, double weekly, double spent, double balance_, boolean partial_,
|
||||
boolean serverStale_)
|
||||
{
|
||||
h5Pct = h5;
|
||||
weeklyPct = weekly;
|
||||
spentTodayUsd = spent;
|
||||
balance = balance_;
|
||||
partial = partial_;
|
||||
serverStale = serverStale_;
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile Reading _cached;
|
||||
private static volatile long _cachedAt;
|
||||
private static volatile boolean _failed;
|
||||
private static boolean _inFlight;
|
||||
|
||||
private UsageGauge() {}
|
||||
|
||||
public static boolean isGaugeKey(KeyboardData.Key key)
|
||||
{
|
||||
return key != null && KEY_MARKER.equals(key.indication);
|
||||
}
|
||||
|
||||
/** Returns null when any value needed for a trustworthy display is absent or invalid. */
|
||||
public static Reading parse(String json)
|
||||
{
|
||||
try
|
||||
{
|
||||
JSONObject root = new JSONObject(json);
|
||||
JSONObject codex = root.getJSONObject("codex");
|
||||
JSONObject deepseek = root.getJSONObject("deepseek");
|
||||
double h5 = requiredNumber(codex.getJSONObject("h5"), "pct");
|
||||
double weekly = requiredNumber(codex.getJSONObject("weekly"), "pct");
|
||||
double spent = requiredNumber(deepseek, "spent_today_usd");
|
||||
double balance = requiredNumber(deepseek, "balance");
|
||||
if (!finite(h5) || !finite(weekly) || !finite(spent) || !finite(balance)
|
||||
|| h5 < 0 || weekly < 0 || spent < 0)
|
||||
return null;
|
||||
boolean partial = deepseek.optBoolean("partial", false);
|
||||
boolean serverStale = codex.optBoolean("stale", false)
|
||||
|| deepseek.optBoolean("stale", false);
|
||||
return new Reading(h5, weekly, spent, balance, partial, serverStale);
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
// The local JVM test runner replaces Android's org.json methods with
|
||||
// throwing stubs. Keep the same defensive behavior testable there.
|
||||
return parseJsonFallback(json);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Reading parseJsonFallback(String json)
|
||||
{
|
||||
try
|
||||
{
|
||||
String codex = objectForKey(json, "codex");
|
||||
String deepseek = objectForKey(json, "deepseek");
|
||||
double h5 = numberForKey(objectForKey(codex, "h5"), "pct");
|
||||
double weekly = numberForKey(objectForKey(codex, "weekly"), "pct");
|
||||
double spent = numberForKey(deepseek, "spent_today_usd");
|
||||
double balance = numberForKey(deepseek, "balance");
|
||||
if (!finite(h5) || !finite(weekly) || !finite(spent) || !finite(balance)
|
||||
|| h5 < 0 || weekly < 0 || spent < 0)
|
||||
return null;
|
||||
boolean partial = booleanForKey(deepseek, "partial");
|
||||
boolean serverStale = booleanForKey(codex, "stale") || booleanForKey(deepseek, "stale");
|
||||
return new Reading(h5, weekly, spent, balance, partial, serverStale);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String objectForKey(String json, String key) throws Exception
|
||||
{
|
||||
Matcher matcher = Pattern.compile("\\\"" + Pattern.quote(key)
|
||||
+ "\\\"\\s*:\\s*\\{").matcher(json);
|
||||
if (!matcher.find())
|
||||
throw new Exception("Missing object " + key);
|
||||
int start = matcher.end() - 1;
|
||||
int depth = 0;
|
||||
boolean quoted = false;
|
||||
boolean escaped = false;
|
||||
for (int i = start; i < json.length(); i++)
|
||||
{
|
||||
char c = json.charAt(i);
|
||||
if (quoted)
|
||||
{
|
||||
if (escaped) escaped = false;
|
||||
else if (c == '\\') escaped = true;
|
||||
else if (c == '"') quoted = false;
|
||||
}
|
||||
else if (c == '"') quoted = true;
|
||||
else if (c == '{') depth++;
|
||||
else if (c == '}' && --depth == 0)
|
||||
return json.substring(start, i + 1);
|
||||
}
|
||||
throw new Exception("Unclosed object " + key);
|
||||
}
|
||||
|
||||
private static double numberForKey(String json, String key) throws Exception
|
||||
{
|
||||
Matcher matcher = Pattern.compile("\\\"" + Pattern.quote(key)
|
||||
+ "\\\"\\s*:\\s*(-?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][+-]?[0-9]+)?)")
|
||||
.matcher(json);
|
||||
if (!matcher.find())
|
||||
throw new Exception("Missing numeric field " + key);
|
||||
return Double.parseDouble(matcher.group(1));
|
||||
}
|
||||
|
||||
/** Only a literal true counts: an absent or malformed flag must never claim confidence. */
|
||||
private static boolean booleanForKey(String json, String key)
|
||||
{
|
||||
try
|
||||
{
|
||||
int at = json.indexOf("\"" + key + "\"");
|
||||
if (at < 0)
|
||||
return false;
|
||||
int colon = json.indexOf(':', at);
|
||||
if (colon < 0)
|
||||
return false;
|
||||
int i = colon + 1;
|
||||
while (i < json.length() && Character.isWhitespace(json.charAt(i)))
|
||||
i++;
|
||||
return json.startsWith("true", i);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static double requiredNumber(JSONObject object, String key) throws Exception
|
||||
{
|
||||
Object value = object.get(key);
|
||||
if (!(value instanceof Number))
|
||||
throw new Exception("Missing numeric field " + key);
|
||||
return ((Number)value).doubleValue();
|
||||
}
|
||||
|
||||
private static boolean finite(double value)
|
||||
{
|
||||
return !Double.isNaN(value) && !Double.isInfinite(value);
|
||||
}
|
||||
|
||||
public static float fillFraction(Reading reading)
|
||||
{
|
||||
if (reading == null)
|
||||
return 0;
|
||||
return (float)(Math.max(0, Math.min(100,
|
||||
Math.max(reading.h5Pct, reading.weeklyPct))) / 100.0);
|
||||
}
|
||||
|
||||
public static boolean isStale(long fetchedAt, long now, boolean failed,
|
||||
String token)
|
||||
{
|
||||
return token == null || token.trim().isEmpty() || failed || fetchedAt <= 0
|
||||
|| now < fetchedAt || now - fetchedAt > STALE_AFTER_MS;
|
||||
}
|
||||
|
||||
public static boolean isLowBalance(Reading reading)
|
||||
{
|
||||
return reading == null || reading.balance < 1.00;
|
||||
}
|
||||
|
||||
public static synchronized void fetchIfNeeded(String url, String token,
|
||||
Runnable onComplete)
|
||||
{
|
||||
long now = System.currentTimeMillis();
|
||||
if (token == null || token.trim().isEmpty() || _inFlight
|
||||
|| (_cached != null && now - _cachedAt <= REFRESH_AFTER_MS))
|
||||
return;
|
||||
_inFlight = true;
|
||||
Thread worker = new Thread(() -> {
|
||||
Reading reading = fetch(url, token);
|
||||
synchronized (UsageGauge.class)
|
||||
{
|
||||
// A reading the server itself flags as too old is as unusable as a failed fetch:
|
||||
// presenting it as current is the exact lie the gauge is built to avoid.
|
||||
if (reading == null || reading.serverStale)
|
||||
_failed = true;
|
||||
else
|
||||
{
|
||||
_cached = reading;
|
||||
_cachedAt = System.currentTimeMillis();
|
||||
_failed = false;
|
||||
}
|
||||
_inFlight = false;
|
||||
}
|
||||
if (onComplete != null)
|
||||
onComplete.run();
|
||||
}, "UsageGauge");
|
||||
worker.setDaemon(true);
|
||||
worker.start();
|
||||
}
|
||||
|
||||
private static Reading fetch(String url, String token)
|
||||
{
|
||||
HttpURLConnection connection = null;
|
||||
try
|
||||
{
|
||||
connection = (HttpURLConnection)new URL(url).openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setConnectTimeout(3000);
|
||||
connection.setReadTimeout(5000);
|
||||
connection.setRequestProperty("Authorization", "Bearer " + token);
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
if (connection.getResponseCode() != HttpURLConnection.HTTP_OK)
|
||||
return null;
|
||||
try (InputStream input = connection.getInputStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(input,
|
||||
StandardCharsets.UTF_8)))
|
||||
{
|
||||
StringBuilder body = new StringBuilder();
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
body.append(line);
|
||||
return parse(body.toString());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (connection != null)
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static Reading cachedReading()
|
||||
{
|
||||
return _cached;
|
||||
}
|
||||
|
||||
public static boolean isStaleNow(String token)
|
||||
{
|
||||
return isStale(_cachedAt, System.currentTimeMillis(), _failed, token);
|
||||
}
|
||||
|
||||
public static long cachedAt()
|
||||
{
|
||||
return _cachedAt;
|
||||
}
|
||||
|
||||
public static int hueColor(float fraction)
|
||||
{
|
||||
float level = Math.max(0, Math.min(1, fraction));
|
||||
if (level < 0.5f)
|
||||
// Low usage borrows the space bar button's own colour rather than a hand-matched shade, so
|
||||
// the gauge and the button can never drift apart. Amber and red still mark high usage: the
|
||||
// height carries the level, the colour carries the alarm.
|
||||
return blend(DeepSeekPeak.colorFor(System.currentTimeMillis()), Color.rgb(245, 178, 45), level * 2);
|
||||
return blend(Color.rgb(245, 178, 45), Color.rgb(235, 55, 55), (level - 0.5f) * 2);
|
||||
}
|
||||
|
||||
private static int blend(int a, int b, float t)
|
||||
{
|
||||
return Color.rgb((int)(Color.red(a) + (Color.red(b) - Color.red(a)) * t),
|
||||
(int)(Color.green(a) + (Color.green(b) - Color.green(a)) * t),
|
||||
(int)(Color.blue(a) + (Color.blue(b) - Color.blue(a)) * t));
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class CandidatesView extends LinearLayout
|
||||
}
|
||||
}
|
||||
|
||||
public void clear_candidates()
|
||||
void clear_candidates()
|
||||
{
|
||||
for (int i = 0; i < _item_views.length; i++)
|
||||
{
|
||||
@@ -101,10 +101,10 @@ public class CandidatesView extends LinearLayout
|
||||
float row_height = config.keyboard_rows_height_pixels * (1 - config.key_vertical_margin);
|
||||
ViewGroup.MarginLayoutParams p =
|
||||
(ViewGroup.MarginLayoutParams)getLayoutParams();
|
||||
p.height = (int)row_height;
|
||||
p.height = (int)(row_height * 0.637f);
|
||||
setLayoutParams(p);
|
||||
// Match the size of labels on the keyboard.
|
||||
float text_size = row_height * config.characterSize * config.labelTextSize;
|
||||
float text_size = row_height * config.characterSize * config.labelTextSize * 0.85f;
|
||||
for (int i = 0; i < NUM_CANDIDATES; i++)
|
||||
{
|
||||
TextView v = _item_views[i];
|
||||
|
||||
@@ -45,13 +45,14 @@ public final class Suggestions
|
||||
clear();
|
||||
else
|
||||
query_suggestions(word);
|
||||
set_suggestions();
|
||||
_callback.set_suggestions(this);
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
count = 0;
|
||||
suggestions[0] = null;
|
||||
for (int i = 0; i < MAX_COUNT; i++)
|
||||
suggestions[i] = null;
|
||||
emoji_suggestion = null;
|
||||
}
|
||||
|
||||
@@ -120,11 +121,6 @@ public final class Suggestions
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
void set_suggestions()
|
||||
{
|
||||
_callback.set_suggestions(this);
|
||||
}
|
||||
|
||||
static final int[] NO_RESULTS = new int[0];
|
||||
|
||||
public static interface Callback
|
||||
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="ز" key3="."/>
|
||||
<key key0="ظ" key3="؟"/>
|
||||
<key key0="د"/>
|
||||
<key width="1.0" key0="backspace" key2="delete"/>
|
||||
<key width="1.0" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="و" key1="ۋ" key4="ۊ"/>
|
||||
<key key0="چ"/>
|
||||
<key key0="ٚ" key1="ٛ"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
<key key0="و" key1=","/>
|
||||
<key key0="ز" key1="."/>
|
||||
<key key0="ظ" key1="؟"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -34,6 +34,6 @@
|
||||
<key key0="ب" key1="ٮ" />
|
||||
<key key0="ن" key2="،" key3="؛"/>
|
||||
<key key0="م" key2="." key3=":" />
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
<key key0="و" key1=","/>
|
||||
<key key0="ز" key1="."/>
|
||||
<key key0="ظ" key1="؟"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -36,6 +36,6 @@
|
||||
<key key0="پ" key2="؟"/>
|
||||
<key key0="و"/>
|
||||
<key key0="چ"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<key key0="պ" key4=":"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="shift" key2="loc capslock"/>
|
||||
<key role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="դ"/>
|
||||
<key key0="չ"/>
|
||||
<key key0="յ"/>
|
||||
@@ -46,6 +46,6 @@
|
||||
<key key0="ք"/>
|
||||
<key key0="խ"/>
|
||||
<key key0="շ" key4="."/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<key key0="ե" key2="և" key4=":"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="shift" key2="loc capslock"/>
|
||||
<key role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ց"/>
|
||||
<key key0="զ"/>
|
||||
<key key0="չ"/>
|
||||
@@ -46,6 +46,6 @@
|
||||
<key key0="ն"/>
|
||||
<key key0="մ"/>
|
||||
<key key0="շ" key4="."/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
</keyboard>
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
<key c="," sw="ষ" ne="("/>
|
||||
<key c="." sw="।" ne=")"/>
|
||||
<key c="য়" sw="য"/>
|
||||
<key width="1.5" c="backspace" ne="delete"/>
|
||||
<key role="action" width="1.5" c="backspace" ne="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="দ" key1="_" key2="ধ" key3="(" key4=")"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.4" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.4" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key shift="0.1" key0="্র" key2="্য" key3="\#" key4="*"/>
|
||||
<key key0="ো" key1="ৌ" key2="ও" key3="ঔ" key4="\@"/>
|
||||
<key key0="ে" key1="ৈ" key2="এ" key3="ঐ" key4="%"/>
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="ন" key1="৳" key2="ণ" key3=";" key4="."/>
|
||||
<key key0="স" key1=""" key2="ষ" key3="!" key4=","/>
|
||||
<key key0="ম" key1="'" key2="শ" key3="\?" key4="।"/>
|
||||
<key shift="0.1" width="1.4" key0="backspace" key2="delete"/>
|
||||
<key shift="0.1" width="1.4" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="ল" key1="ং" key2="॥" key3="halfspace" />
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" />
|
||||
<key width="1.5" role="action" key0="shift" />
|
||||
<key key0="য়" key1="য" />
|
||||
<key key0="শ" key1="ঢ়" />
|
||||
<key key0="চ" key1="ছ" key2="ৃ" key3="," />
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="ব" key1="ভ" key2="\?" key3="্" />
|
||||
<key key0="ন" key1="ণ" key2=":" key3=";" />
|
||||
<key key0="ম" key1="ঙ" key2=""" key3="'" />
|
||||
<key width="1.5" key0="backspace" key2="delete" />
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete" />
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="п" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="shift" key2="loc capslock"/>
|
||||
<key role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="я"/>
|
||||
<key key0="ч"/>
|
||||
<key key0="ё" key1="е"/>
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="т" key1="₮" key2="\?" key3="/"/>
|
||||
<key key0="ь" key1="ъ" key2=":" key3=";"/>
|
||||
<key key0="в" key1="ю" key2=""" key3="'"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="ѣ" key1="ԑ" key2="/" key3="\\" key4="|" />
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.18" key0="shift" key2="loc capslock" key3="loc tab" key4="loc esc"
|
||||
<key role="action" width="1.18" key0="shift" key2="loc capslock" key3="loc tab" key4="loc esc"
|
||||
/>
|
||||
<key width="0.96" key0="я" key1="ꙗ" key2="ꙝ" key4="combining_titlo" />
|
||||
<key width="0.96" key0="ч" key1="ћ" key2="ќ" key4="combining_breve" />
|
||||
@@ -38,6 +38,6 @@
|
||||
<key width="0.96" key0="ь" key1="ѧ" key2="<" key3="⁙" />
|
||||
<key width="0.96" key0="б" key1="ђ" key2=">" key3="⁘" />
|
||||
<key width="0.96" key0="ю" key1="ꙛ" key2="·" key3="⁖"/>
|
||||
<key width="1.18" key0="backspace" key2="delete"/>
|
||||
<key role="action" width="1.18" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<key key0="э" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key key0="shift" key2="loc capslock"/>
|
||||
<key role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="я"/>
|
||||
<key key0="ч"/>
|
||||
<key key0="с"/>
|
||||
@@ -50,6 +50,6 @@
|
||||
<key key0="ь" key2="\?" key3="/"/>
|
||||
<key key0="б" key2=":" key3=";"/>
|
||||
<key key0="ю" key2=""" key3="'"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="э" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row scale="11">
|
||||
<key width="1.22" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.22" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="я"/>
|
||||
<key key0="ч"/>
|
||||
<key key0="с"/>
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="ь" key1="ъ" key2="\?" key3="/"/>
|
||||
<key key0="б" key2=":" key3=";"/>
|
||||
<key key0="ю" key2=""" key3="'"/>
|
||||
<key width="1.22" key0="backspace" key2="delete"/>
|
||||
<key width="1.22" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="є" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.1" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.1" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="я"/>
|
||||
<key key0="ч" />
|
||||
<key key0="с" />
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="ь" key2=":" key3=";"/>
|
||||
<key key0="б" key2=""" key3="'"/>
|
||||
<key key0="ю" key1="«" key2="»"/>
|
||||
<key width="1.1" key0="backspace" key2="delete"/>
|
||||
<key width="1.1" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<key key0="ж" key2=")" key3="("/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key role="action" width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key key0="я"/>
|
||||
<key key0="ч"/>
|
||||
<key key0="ѣ"/>
|
||||
@@ -40,6 +40,6 @@
|
||||
<key key0="ь"/>
|
||||
<key key0="б" key2="«"/>
|
||||
<key key0="ю" key2="»"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key role="action" width="1.5" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="ќ" key2="=" key3="+"/>
|
||||
</row>
|
||||
<row scale="11">
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key role="action" width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key key0="з"/>
|
||||
<key key0="џ"/>
|
||||
<key key0="ц"/>
|
||||
@@ -37,7 +37,7 @@
|
||||
<key key0="м" key2=":" key3=";"/>
|
||||
<key key0="ѓ" key2="`" key3="'"/>
|
||||
<key key0="ж" key2="“" key3="„"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key role="action" width="1.5" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<key key0="ћ" ne="`" sw="|"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" nw="loc superscript" ne="loc capslock" sw="loc subscript"/>
|
||||
<key width="1.5" role="action" key0="shift" nw="loc superscript" ne="loc capslock" sw="loc subscript"/>
|
||||
<key key0="ж" nw="loc undo" ne="loc redo" sw="<" se=">"/>
|
||||
<key key0="џ" ne="loc cut"/>
|
||||
<key key0="ц" ne="loc copy"/>
|
||||
@@ -71,6 +71,6 @@
|
||||
<key key0="н" nw="!" ne="\?" sw="/"/>
|
||||
<key key0="м" ne=";" sw=","/>
|
||||
<key key0="ђ" ne=":" sw="."/>
|
||||
<key width="1.5" key0="backspace" ne="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" ne="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="ч" key1="„" key2="“"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ю"/>
|
||||
<key key0="й"/>
|
||||
<key key0="ъ" key1="loc accent_cedille" key2="<" key4=">"/>
|
||||
@@ -36,6 +36,6 @@
|
||||
<key key0="п" key2=""" key3="'"/>
|
||||
<key key0="р" key3=","/>
|
||||
<key key0="л" key3="."/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="л" key1="щ" key2="|" key3="\\" key4="ю"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="з"/>
|
||||
<key key0="ь" key3="ѝ"/>
|
||||
<key key0="ц" key2="<" key3="."/>
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="б" key2="\?" key3="/"/>
|
||||
<key key0="н" key2=":" key3=";"/>
|
||||
<key key0="м" key2=""" key3="'"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<key key0="щ" key2="/" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="2" key0="shift" key2="loc capslock"/>
|
||||
<key role="action" width="2" key0="shift" key2="loc capslock"/>
|
||||
<key key0="э"/>
|
||||
<key key0="з"/>
|
||||
<key key0="ь" key1="ъ"/>
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="б"/>
|
||||
<key key0="н" key2="«" key3=","/>
|
||||
<key key0="м" key2="»" key3="."/>
|
||||
<key width="2" key0="backspace" key2="delete"/>
|
||||
<key role="action" width="2" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="э" key7="\?" key3="/" />
|
||||
</row>
|
||||
<row scale="11">
|
||||
<key width="1.22" key0="shift" key2="loc capslock" />
|
||||
<key width="1.22" role="action" key0="shift" key2="loc capslock" />
|
||||
<key key0="я" key7="`" key8=";" />
|
||||
<key key0="ч" key7="*" key8=":" />
|
||||
<key key0="с" key7="&" key8="\#" />
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="ӣ" key3="<" key2=">" />
|
||||
<key key0="б" key7="ъ" key8="ы" />
|
||||
<key key0="ю" key7=""" key8="'"/>
|
||||
<key width="1.22" key0="." key7="," />
|
||||
<key width="1.22" role="action" key0="." key7="," />
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<key key0="э" key7="/" key8="|" />
|
||||
</row>
|
||||
<row scale="11">
|
||||
<key width="1.22" key0="shift" />
|
||||
<key width="1.22" role="action" key0="shift" />
|
||||
<key key0="ꙗ" key7="combining_breve" key8=";" />
|
||||
<key key0="ч" key7="combining_pokrytie" key8=":" />
|
||||
<key key0="с" key7="combining_inverted_breve" key8="`" />
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
<key c="ं" nw="ॐ" ne="।" sw="ः" se=""" anticircle="१" indication="१"/>
|
||||
<key c="्" nw="," ne=";" sw="!" se="\?" anticircle="२" indication="२"/>
|
||||
<key c="़" nw="॰" sw="-" se="॒" anticircle="३" indication="३"/>
|
||||
<key width="2" c="backspace" ne="delete"/>
|
||||
<key width="2" role="action" c="backspace" ne="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="त" key1="थ" key2="ख़" key3="(" key4=")"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.4" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.4" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key shift="0.1" key0="ट" key1="ठ" key2="ड़" key3="\#" key4="*"/>
|
||||
<key key0="ं" key1="ँ" key3="ॐ" key4="\@"/>
|
||||
<key key0="म" key1="ण" key2="य" key3="य़" key4="%"/>
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="व" key2="ढ़" key3=";" key4="."/>
|
||||
<key key0="ल" key1="ळ" key2="फ़" key3="!" key4=","/>
|
||||
<key key0="स" key1="श" key2="ष" key3="\?"/>
|
||||
<key shift="0.1" width="1.4" key0="backspace" key2="delete"/>
|
||||
<key shift="0.1" width="1.4" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<key key0="ल" key1="ऌ" key2="।" key3 ="ॢ" key4="॥"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ज्ञ" key2="|" key3="\\" key4="ऍ"/>
|
||||
<key key0="ष" key1="क्ष" key3 ="ॅ" key4="ॉ"/>
|
||||
<key key0="च" key2="<" key3=","/>
|
||||
@@ -37,6 +37,6 @@
|
||||
<key key0="ब" key2="\?" key3="/"/>
|
||||
<key key0="न" key1="ङ" key2=":" key3=";" key4="ऽ"/>
|
||||
<key key0="म" key1="ॐ" key2=""" key3="'" key4="ँ"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<key key0="ჩ" key1="ჭ"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ზ" key1="ჵ"/>
|
||||
<key key0="ხ" key1="ჴ" key2="loc †"/>
|
||||
<key key0="ც" key2="<" key3="."/>
|
||||
@@ -38,6 +38,6 @@
|
||||
<key key0="მ" key2=""" key3="'"/>
|
||||
<key key0="ძ"/>
|
||||
<key key0="ჟ"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="ლ" key1="₾" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ზ" key1="ძ" key2="ჵ"/>
|
||||
<key key0="ხ" key2="ჴ" key3="loc †"/>
|
||||
<key key0="ც" key1="ჩ" key3="<" key4="."/>
|
||||
@@ -32,7 +32,7 @@
|
||||
<key key0="ბ" key2="\?" key3="/"/>
|
||||
<key key0="ნ" key1="ჼ" key2="`" key3=":" key4=";"/>
|
||||
<key key0="მ" key2=""" key3="'"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<key key0="accent_aigu" key1="accent_trema" key3="accent_grave"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ζ"/>
|
||||
<key key0="χ"/>
|
||||
<key key0="ψ" key2="<" key3="."/>
|
||||
@@ -33,6 +33,6 @@
|
||||
<key key0="β" key2="\?" key3="/"/>
|
||||
<key key0="ν" key2=":"/>
|
||||
<key key0="μ" key2=""" key3="'"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="લ" key1="।" key2="|" key3="\\" key4="॥"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ઞ" key1="જ્ઞ" key2="ૅ" key3="ઙ" key4="ઍ"/>
|
||||
<key key0="ષ" key1="ક્ષ" key2="ૉ" key3="઼" key4="ઑ"/>
|
||||
<key key0="ચ" key2="<" key3="."/>
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="બ" key2="\?" key3="/"/>
|
||||
<key key0="ન" key2=":" key3=";"/>
|
||||
<key key0="મ" key1="ૐ" key2=""" key3="'" key4="॑" key6="ઽ"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<key key0="ㅣ" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="ㅋ"/>
|
||||
<key key0="ㅌ" key1="ㄾ" key3="<" key4=">"/>
|
||||
<key key0="ㅊ" key3="."/>
|
||||
@@ -32,6 +32,6 @@
|
||||
<key key0="ㅠ" key1="ㅞ" key2="ㅝ" key3="/" key4="\?"/>
|
||||
<key key0="ㅜ" key2="ㅟ" key3=";" key4=":"/>
|
||||
<key key0="ㅡ" key2="ㅢ" key3="'" key4="""/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<key key0="ן" key2="8" key3="*"/>
|
||||
<key key0="ם" key2="9" key3="b(" key4="lrm"/>
|
||||
<key key0="פ" key2="0" key3="b)" key4="rlm"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row scale="11">
|
||||
<key key0="ש" key2="`" key1="loc tab" key3="sindot_placeholder" key4="shindot_placeholder" width="1.30"/>
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
<key key0="מ" key1="blt" key2=","/>
|
||||
<key key0="צ" key1="bgt" key2="."/>
|
||||
<key key0="/" key1="\?"/>
|
||||
<key key0="backspace" key2="delete" width="1.333"/>
|
||||
<key role="action" key0="backspace" key2="delete" width="1.333"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
<key key0="।" key1="'" key2=""" key3="." key4="," key6="॥"/>
|
||||
<key key0="೦" key1=":" key2=";" key3="-" key4="_"/>
|
||||
<key key0="೫" key1="೧" key2="೩" key3="೭" key4="೯" key5="೪" key6="೬" key7="೨" key8="೮"/>
|
||||
<key key0="backspace" key2="delete"/>
|
||||
<key role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<key key0="ş" key1="x"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key role="action" width="1.5" key0="shift" key2="loc capslock"/>
|
||||
<key key0="j" key2="«"/>
|
||||
<key key0="ö" key2="»"/>
|
||||
<key key0="v" key2="<" key3="."/>
|
||||
@@ -39,6 +39,6 @@
|
||||
<key key0="z" key2=":" key3=";"/>
|
||||
<key key0="s" key2=""" key3="'"/>
|
||||
<key key0="b" key2="×"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
<key role="action" width="1.5" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
</keyboard>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<key key0="m" key1="£" key3="µ"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="2.0" key0="shift" key2="loc capslock"/>
|
||||
<key width="2.0" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="w" key1="\\" key2="`" key3="<" key4=">"/>
|
||||
<key key0="x" key1="loc †"/>
|
||||
<key key0="c" key2="\?" key3=","/>
|
||||
<key key0="v" key2="." key3=";"/>
|
||||
<key key0="b" key2="/" key3=":"/>
|
||||
<key key0="n" key2="+" key3="="/>
|
||||
<key width="2.0" key0="backspace" key2="delete"/>
|
||||
<key width="2.0" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
<key key0="m" key3="*"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="2.0" key0="shift" key2="loc capslock"/>
|
||||
<key width="2.0" role="action" key0="shift" key2="loc capslock"/>
|
||||
<key key0="w" key3="<" key4=">"/>
|
||||
<key key0="x" key1="loc †"/>
|
||||
<key key0="c" key1="loc accent_cedille" key2="ç" key3="," key4="\?"/>
|
||||
<key key0="v" key3=";" key4="."/>
|
||||
<key key0="b" key3=":" key4="/"/>
|
||||
<key key0="n" key1="loc accent_tilde" key2="§" key4="!"/>
|
||||
<key width="2.0" key0="backspace" key2="delete"/>
|
||||
<key width="2.0" role="action" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<key key0="m" key2="""/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key2="loc capslock" key3="<"/>
|
||||
<key width="1.5" role="action" key0="shift" key2="loc capslock" key3="<"/>
|
||||
<key key0="y" key4="%"/>
|
||||
<key key0="x" key4="\@"/>
|
||||
<key key0="k" key4="~"/>
|
||||
@@ -35,6 +35,6 @@
|
||||
<key key0="g" key3="/" key4="\\"/>
|
||||
<key key0="h"/>
|
||||
<key key0="f"/>
|
||||
<key width="1.5" key0="backspace" key2="delete" key3=">"/>
|
||||
<key width="1.5" role="action" key0="backspace" key2="delete" key3=">"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
-->
|
||||
<row>
|
||||
<!--left side-->
|
||||
<key width="1.5" key0="shift" ne="loc capslock"
|
||||
<key width="1.5" role="action" key0="shift" ne="loc capslock"
|
||||
se="\#"/>
|
||||
<key key0="f" se="$"/>
|
||||
<key key0="v" se="|"/>
|
||||
@@ -125,7 +125,7 @@
|
||||
<key key0="y" sw="%"/>
|
||||
<key key0="z" sw="," nw="""/>
|
||||
<key key0="k" sw="." nw="'"/>
|
||||
<key width="1.5" key0="backspace"
|
||||
<key width="1.5" role="action" key0="backspace"
|
||||
sw=";" nw="delete"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
</row>
|
||||
<row>
|
||||
<key key0="shift" key2="loc capslock" width="1.5" />
|
||||
<key key0="shift" key2="loc capslock" width="1.5" role="action"/>
|
||||
<key key0="z" key1="," key2="."/>
|
||||
<key key0="x" key1=">" key2="<"/>
|
||||
<key key0="c" key1="{" key2="}" key3="loc accent_cedille"/>
|
||||
@@ -35,7 +35,6 @@
|
||||
<key key0="b" key1="(" key2=")"/>
|
||||
<key key0="k" key1=";" key2=":"/>
|
||||
<key key0="m" key1="!" key2="\?" />
|
||||
<key key0="backspace" key1="delete" shift="0.25" width="1.25"/>
|
||||
|
||||
<key key0="backspace" key1="delete" shift="0.25" width="1.25" role="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user