mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-18 12:01:07 +02:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
93b4cc2e7b | ||
|
7a451d5a36 | ||
|
2d2f0dd51d | ||
|
8631dfb723 | ||
|
c9f7f2cfc8 | ||
|
f2893437d2 | ||
|
2f47d2400b | ||
|
348c278eae | ||
|
7af579a1bc | ||
|
4333575bb9 | ||
|
e0217c650d | ||
|
1723288f5d | ||
|
88e21758bc | ||
|
e031de6b57 | ||
|
baf867a9f9 | ||
|
04f15fbfee | ||
|
cb95e99f50 | ||
|
28f98cc129 | ||
|
3ab2228065 | ||
|
eda171d57a | ||
|
0bf7ff5f34 |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="15" android:versionName="1.11.1" android:hardwareAccelerated="false">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="16" android:versionName="1.12.0" android:hardwareAccelerated="false">
|
||||
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="30"/>
|
||||
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:hardwareAccelerated="false">
|
||||
<service android:name="juloo.keyboard2.Keyboard2" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD">
|
||||
|
@@ -57,3 +57,29 @@ The application must be enabled again in the settings.
|
||||
adb uninstall juloo.keyboard2.debug
|
||||
make installd
|
||||
```
|
||||
|
||||
## Guidelines
|
||||
|
||||
### Add a localized layout
|
||||
|
||||
Localized layouts (a layout specific to a language) are generally accepted.
|
||||
See for example: 4333575 (Bulgarian), 88e2175 (Latvian), 133b6ec (German).
|
||||
|
||||
This keyboard is intended for programmers. If your language uses the Latin script, make sure it is possible to type every letters on the QWERTY keyboard.
|
||||
This is generally done using dead-keys, for example: 0bf7ff5 (Latvian), 573c13f (Swedish).
|
||||
It is also possible to add some characters that are hidden in other languages, for example 93e84ba (ß), though the space is limited.
|
||||
|
||||
### Add a programming layout
|
||||
|
||||
A programming layout must contains every ASCII characters as well as every dead-keys.
|
||||
Currently, the only example is QWERTY.
|
||||
|
||||
### Translations
|
||||
|
||||
Translations are always welcome ! See for example: 1723288 (Latvian), baf867a (French).
|
||||
The app can be translated by writing `res/values-<language code>/strings.xml` (for example `values-fr`, `values-lv`), based on the default: `res/values/strings.xml` (English).
|
||||
|
||||
The store description is found in `metadata/android/<locale>/`, `short_description.txt` and `full_description.txt`.
|
||||
The full description changes very infrequently (it was changed once in 6 years). But if it changes too much, outdated translation might be removed.
|
||||
|
||||
Translating changelogs is not useful because they evolve too fast. Changelogs are generally written entirely just before a release, translating them would delay releases too much. Old changelogs are not shown to anyone currently.
|
||||
|
@@ -26,6 +26,9 @@ System > Languages & input > On-screen keyboard > Manage on-screen keyboards.
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||
alt="Get it on F-Droid"
|
||||
height="80">](https://f-droid.org/packages/juloo.keyboard2/)
|
||||
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
|
||||
alt="Get it on Google Play"
|
||||
height="80">](https://play.google.com/store/apps/details?id=juloo.keyboard2)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
13
metadata/android/en-US/changelogs/16.txt
Normal file
13
metadata/android/en-US/changelogs/16.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
New languages: Latvian (thanks @eandersons), Bulgarian (thanks Zdravko Iskrenov)
|
||||
New layouts: Bulgarian traditional, Latvian
|
||||
|
||||
The application can now be translated.
|
||||
Translations: French, Latvian (thanks @eandersons)
|
||||
|
||||
Improve the behavior of the Action key.
|
||||
The globe key now opens the keyboard switching dialog.
|
||||
The literal tab character can be typed with Fn+Tab.
|
||||
Add options to control the spacing between the keys.
|
||||
Better integration with the system theme.
|
||||
|
||||
Thanks to all the contributors: @Moini, @sdrapha, @eandersons, @Poussinou, Zdravko Iskrenov
|
Binary file not shown.
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 46 KiB |
12
metadata/android/fr-FR/changelogs/16.txt
Normal file
12
metadata/android/fr-FR/changelogs/16.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
Nouvelles langues: Letton (merci @eandersons), Bulgare (merci Zdravko Iskrenov)
|
||||
Nouvelles dispositions: Bulgare, Letton
|
||||
|
||||
L'application est traduite en Français et Letton.
|
||||
|
||||
Amélioration de la touche Action.
|
||||
La touche globe ouvre le menu de sélection des claviers.
|
||||
Fn+Tab pour écrire le charactère Tab littérallement.
|
||||
Nouvelles options pour contrôler l'espacement entre les touches.
|
||||
Meilleure intégration avec le thème système.
|
||||
|
||||
Merci à tous les contributeurs: @Moini, @sdrapha, @eandersons, @Poussinou, Zdravko Iskrenov
|
18
metadata/android/lv-LV/full_description.txt
Normal file
18
metadata/android/lv-LV/full_description.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
Šī lietotne ir tastatūra Android tālruņiem. Galvenās iespējas ir ērta ASCII rakstzīmju ievadīšana ar pavilkšanas kustību, taustiņi piekļūšanai uzsvara zīmēm un pārveidošanas taustiņiem un īpašo taustiņu esamība (Tab, Esc, bultas utt.).
|
||||
|
||||
Tastatūrā ir redzamas līdz 4 papildus rakstzīmēm katra taustiņa stūros. Tām var piekļūt ar pirksta pavilkšanu uz taustiņa attiecīgajā virzienā.
|
||||
|
||||
Izceltās iespējas:
|
||||
|
||||
- Visas rakstzīmes un īpašie taustiņi, kas ir atrodami arī datora tastatūrā. Tas lieliski noder tādās lietotnēs kā, piemēram, Termux.
|
||||
|
||||
- Ir iekļauti Tab, Esc, bultas un darbību taustiņi, kā arī Ctrl un Alt.
|
||||
|
||||
- Uzsvara zīmju taustiņi ir pieejami ar īpašām pogām. Vispirms jāizvēlas uzsvara zīmes veids, tad jāievada vēlamais burts.
|
||||
|
||||
- Ļoti viegla un ātra. Izmanto 500 reižu mazāk vietas kā Google tastatūra un 15 reižu mazāk kā noklusējuma tastatūra. Bez reklāmām un izsekošanas.
|
||||
|
||||
- Dažādi izkārtojumi: QWERTY, QWERTZ, AZERTY. Izskats: Gaišs, Tumšs, OLED melns. Kā arī daudzas citas papildiespējas.
|
||||
|
||||
Kā jebkura cita tālruņa tastatūra, tā ir jāiespējo ierīces iestatījumos. Jāatver Iestatījumi un tad:
|
||||
Sistēma > Valodas un ievade > Virtuālā tastatūra > Pārvaldīt tastatūras.
|
1
metadata/android/lv-LV/short_description.txt
Normal file
1
metadata/android/lv-LV/short_description.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viegla un ātra tālruņa tastatūra izstrādātājiem.
|
48
res/values-fr/strings.xml
Normal file
48
res/values-fr/strings.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Unexpected Keyboard</string>
|
||||
<string name="settings_activity_label">Unexpected Keyboard Paramètres</string>
|
||||
<string name="pref_category_layout">Disposition</string>
|
||||
<string name="pref_layout_title">Disposition des touches</string>
|
||||
<string name="pref_layout_e_system">Paramètre système</string>
|
||||
<string name="pref_accents_title">Accents</string>
|
||||
<string name="pref_accents_e_all_installed">Afficher les accents pour les langues installées</string>
|
||||
<string name="pref_accents_e_selected">Afficher les accents pour la langue sélectionnée</string>
|
||||
<string name="pref_accents_e_all">Afficher tous les accents</string>
|
||||
<string name="pref_accents_e_none">Cacher les accents</string>
|
||||
<string name="pref_category_typing">Saisie</string>
|
||||
<string name="pref_swipe_dist_title">Distance de swipe</string>
|
||||
<string name="pref_swipe_dist_summary">La distance des caractères dans les coins (%s)</string>
|
||||
<string name="pref_long_timeout_title">Délai avant répétition</string>
|
||||
<string name="pref_long_interval_title">Écart entre répétitions</string>
|
||||
<string name="pref_category_vibrate">Vibration</string>
|
||||
<string name="pref_vibrate_title">Vibreur</string>
|
||||
<string name="pref_vibrate_summary">Vibration a chaque touche</string>
|
||||
<string name="pref_vibrate_duration_title">Durée</string>
|
||||
<string name="pref_precise_repeat_title">Mouvement précis du curseur</string>
|
||||
<string name="pref_precise_repeat_summary">Modifier la vitesse de répétition en bougeant le doigt</string>
|
||||
<string name="pref_category_style">Style</string>
|
||||
<string name="pref_margin_bottom_title">Marge du bas</string>
|
||||
<string name="pref_key_height_title">Hauteur des touches</string>
|
||||
<string name="pref_horizontal_margin_title">Marge des côtés</string>
|
||||
<string name="pref_character_size_title">Taille des labels</string>
|
||||
<string name="pref_character_size_summary">Taille des caractères affichés sur les touches (%.2fx)</string>
|
||||
<string name="pref_theme">Thème</string>
|
||||
<string name="pref_theme_e_system">Paramètre système</string>
|
||||
<string name="pref_theme_e_dark">Sombre</string>
|
||||
<string name="pref_theme_e_light">Clair</string>
|
||||
<string name="pref_theme_e_black">Noir</string>
|
||||
<string name="pref_swipe_dist_e_very_short">Très courte</string>
|
||||
<string name="pref_swipe_dist_e_short">Courte</string>
|
||||
<string name="pref_swipe_dist_e_default">Normale</string>
|
||||
<string name="pref_swipe_dist_e_far">Longue</string>
|
||||
<string name="pref_swipe_dist_e_very_far">Très longue</string>
|
||||
<string name="pref_key_horizontal_space">Espacement horizontal entre les touches</string>
|
||||
<string name="pref_key_vertical_space">Espacement vertical entre les touches</string>
|
||||
<string name="key_action_next">Suiv.</string>
|
||||
<string name="key_action_done">Fin</string>
|
||||
<string name="key_action_go">Aller</string>
|
||||
<string name="key_action_prev">Prec.</string>
|
||||
<string name="key_action_search">Chercher</string>
|
||||
<string name="key_action_send">Envoyer</string>
|
||||
</resources>
|
46
res/values-lv/strings.xml
Normal file
46
res/values-lv/strings.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Unexpected Keyboard</string>
|
||||
<string name="settings_activity_label">Unexpected Keyboard iestatījumi</string>
|
||||
<string name="pref_category_layout">Izkārtojums</string>
|
||||
<string name="pref_layout_title">Mainīt tastatūras izkārtojumu</string>
|
||||
<string name="pref_layout_e_system">Ierīces iestatījumi</string>
|
||||
<string name="pref_accents_title">Uzsvara zīmes</string>
|
||||
<string name="pref_accents_e_all_installed">Rādīt uzsvara zīmes visām uzstādītajām valodām</string>
|
||||
<string name="pref_accents_e_selected">Rādīt uzsvara zīmes tikai atlasītajām valodām</string>
|
||||
<string name="pref_accents_e_all">Rādīt visas uzsvara zīmes</string>
|
||||
<string name="pref_accents_e_none">Paslēpt uzsvara zīmes</string>
|
||||
<string name="pref_category_typing">Rakstīšana</string>
|
||||
<string name="pref_swipe_dist_title">Pavilkšanas attālums</string>
|
||||
<string name="pref_swipe_dist_summary">Taustiņu stūros esošo rakstzīmju attālums (%s)</string>
|
||||
<string name="pref_long_timeout_title">Taustiņa atkārtošanās ātrums</string>
|
||||
<string name="pref_long_interval_title">Taustiņa atkārtošanās aizture</string>
|
||||
<string name="pref_category_vibrate">Trīcēšana</string>
|
||||
<string name="pref_vibrate_title">Trīcēšana</string>
|
||||
<string name="pref_vibrate_summary">Iespējot/atspējot taustiņa piespiešanas trīcēšanu</string>
|
||||
<string name="pref_vibrate_duration_title">Ilgums</string>
|
||||
<string name="pref_precise_repeat_title">Pielāgojama kursora kustība</string>
|
||||
<string name="pref_precise_repeat_summary">Mainīt taustiņa atkārtošanās ātrumu ar pavilkšanas attālumu</string>
|
||||
<string name="pref_category_style">Izskata pielāgojumi</string>
|
||||
<string name="pref_margin_bottom_title">Apakšējā apmale</string>
|
||||
<string name="pref_key_height_title">Taustiņa augstums</string>
|
||||
<string name="pref_horizontal_margin_title">Līmeniskā apmale</string>
|
||||
<string name="pref_character_size_title">Iezīmes izmērs</string>
|
||||
<string name="pref_character_size_summary">Tastatūrā attēloto rakstzīmju izmērs (%.2fx)</string>
|
||||
<string name="pref_theme">Izskats</string>
|
||||
<string name="pref_theme_e_system">Ierīces iestatījumi</string>
|
||||
<string name="pref_theme_e_dark">Tumšs</string>
|
||||
<string name="pref_theme_e_light">Gaišs</string>
|
||||
<string name="pref_theme_e_black">Melns</string>
|
||||
<string name="pref_swipe_dist_e_very_short">Ļoti tuvs</string>
|
||||
<string name="pref_swipe_dist_e_short">Tuvs</string>
|
||||
<string name="pref_swipe_dist_e_default">Vidējs</string>
|
||||
<string name="pref_swipe_dist_e_far">Tāls</string>
|
||||
<string name="pref_swipe_dist_e_very_far">Ļoti tāls</string>
|
||||
<string name="key_action_next">Nākamais</string>
|
||||
<string name="key_action_done">Darīts</string>
|
||||
<string name="key_action_go">Aiziet</string>
|
||||
<string name="key_action_prev">Iepriekšējais</string>
|
||||
<string name="key_action_search">Meklēt</string>
|
||||
<string name="key_action_send">Sūtīt</string>
|
||||
</resources>
|
@@ -4,13 +4,17 @@
|
||||
<item>system</item>
|
||||
<item>azerty</item>
|
||||
<item>qwerty</item>
|
||||
<item>qwerty_lv</item>
|
||||
<item>qwertz</item>
|
||||
<item>bgph1</item>
|
||||
</string-array>
|
||||
<string-array name="pref_layout_entries">
|
||||
<item>@string/pref_layout_e_system</item>
|
||||
<item>AZERTY</item>
|
||||
<item>QWERTY</item>
|
||||
<item>QWERTY (Latvian)</item>
|
||||
<item>QWERTZ</item>
|
||||
<item>Bulgarian (Phonetic Traditional)</item>
|
||||
</string-array>
|
||||
<string-array name="pref_accents_entries">
|
||||
<item>@string/pref_accents_e_all_installed</item>
|
||||
@@ -25,11 +29,13 @@
|
||||
<item>4</item>
|
||||
</string-array>
|
||||
<string-array name="pref_theme_entries">
|
||||
<item>@string/pref_theme_e_system</item>
|
||||
<item>@string/pref_theme_e_dark</item>
|
||||
<item>@string/pref_theme_e_light</item>
|
||||
<item>@string/pref_theme_e_black</item>
|
||||
</string-array>
|
||||
<string-array name="pref_theme_values">
|
||||
<item>system</item>
|
||||
<item>dark</item>
|
||||
<item>light</item>
|
||||
<item>black</item>
|
||||
|
@@ -6,21 +6,21 @@
|
||||
<string name="pref_layout_title">Change keyboard layout</string>
|
||||
<string name="pref_layout_e_system">System settings</string>
|
||||
<string name="pref_accents_title">Accents</string>
|
||||
<string name="pref_accents_e_all_installed">Show accents for all the installed languages</string>
|
||||
<string name="pref_accents_e_all_installed">Show accents for all installed languages</string>
|
||||
<string name="pref_accents_e_selected">Only show accents for the selected language</string>
|
||||
<string name="pref_accents_e_all">Show all accents</string>
|
||||
<string name="pref_accents_e_none">Hide accents</string>
|
||||
<string name="pref_category_typing">Typing</string>
|
||||
<string name="pref_swipe_dist_title">Swiping distance</string>
|
||||
<string name="pref_swipe_dist_summary">Distance of characters in the corners of the keys (%s)</string>
|
||||
<string name="pref_long_timeout_title">Long press timeout</string>
|
||||
<string name="pref_long_interval_title">Long press interval</string>
|
||||
<string name="pref_long_timeout_title">Key repeat timeout</string>
|
||||
<string name="pref_long_interval_title">Key repeat interval</string>
|
||||
<string name="pref_category_vibrate">Vibration</string>
|
||||
<string name="pref_vibrate_title">Vibration</string>
|
||||
<string name="pref_vibrate_summary">Enable/disable vibration on keypress</string>
|
||||
<string name="pref_vibrate_duration_title">Duration</string>
|
||||
<string name="pref_precise_repeat_title">Precise cursor movements</string>
|
||||
<string name="pref_precise_repeat_summary">Modulate the speed of movements by swiping more or less</string>
|
||||
<string name="pref_precise_repeat_summary">Modulate key repeat speed by swiping more or less</string>
|
||||
<string name="pref_category_style">Style</string>
|
||||
<string name="pref_margin_bottom_title">Margin bottom</string>
|
||||
<string name="pref_key_height_title">Key height</string>
|
||||
@@ -28,6 +28,7 @@
|
||||
<string name="pref_character_size_title">Label size</string>
|
||||
<string name="pref_character_size_summary">Size of characters displayed on the keyboard (%.2fx)</string>
|
||||
<string name="pref_theme">Theme</string>
|
||||
<string name="pref_theme_e_system">System settings</string>
|
||||
<string name="pref_theme_e_dark">Dark</string>
|
||||
<string name="pref_theme_e_light">Light</string>
|
||||
<string name="pref_theme_e_black">Black</string>
|
||||
@@ -36,4 +37,12 @@
|
||||
<string name="pref_swipe_dist_e_default">Normal</string>
|
||||
<string name="pref_swipe_dist_e_far">Far</string>
|
||||
<string name="pref_swipe_dist_e_very_far">Very far</string>
|
||||
<string name="pref_key_horizontal_space">Horizontal spacing between the keys</string>
|
||||
<string name="pref_key_vertical_space">Vertical spacing between the keys</string>
|
||||
<string name="key_action_next">Next</string>
|
||||
<string name="key_action_done">Done</string>
|
||||
<string name="key_action_go">Go</string>
|
||||
<string name="key_action_prev">Prev</string>
|
||||
<string name="key_action_search">Search</string>
|
||||
<string name="key_action_send">Send</string>
|
||||
</resources>
|
||||
|
@@ -22,6 +22,7 @@
|
||||
<attr name="emoji_key_text" type="color" format="color"/>
|
||||
</declare-styleable>
|
||||
<style name="Dark">
|
||||
<item name="android:isLightTheme">false</item>
|
||||
<item name="colorKeyboard">#1B1B1B</item>
|
||||
<item name="colorKey">#303030</item>
|
||||
<item name="colorKeyActivated">#1B1B1B</item>
|
||||
@@ -36,6 +37,8 @@
|
||||
<item name="emoji_key_text" type="color">?attr/colorLabel</item>
|
||||
</style>
|
||||
<style name="Light">
|
||||
<item name="android:isLightTheme">true</item>
|
||||
<item name="android:forceDarkAllowed">false</item>
|
||||
<item name="colorKeyboard">#e3e3e3</item>
|
||||
<item name="colorKey">#cfcfcf</item>
|
||||
<item name="colorKeyActivated">#e3e3e3</item>
|
||||
@@ -50,6 +53,7 @@
|
||||
<item name="emoji_key_text" type="color">?attr/colorLabel</item>
|
||||
</style>
|
||||
<style name="Black">
|
||||
<item name="android:isLightTheme">false</item>
|
||||
<item name="colorKeyboard">#000000</item>
|
||||
<item name="colorKey">#000000</item>
|
||||
<item name="colorKeyActivated">#333333</item>
|
||||
|
44
res/xml/local_bgph1.xml
Normal file
44
res/xml/local_bgph1.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard>
|
||||
<row>
|
||||
<key key0="я" key1="esc" key2="1" key3="ч" key4="!"/>
|
||||
<key key0="в" key2="2" key3="\@"/>
|
||||
<key key0="е" key2="3" key3="\#" key4="№"/>
|
||||
<key key0="р" key2="4" key3="$"/>
|
||||
<key key0="т" key2="5" key3="%"/>
|
||||
<key key0="ъ" key2="6" key3="^" key4="€"/>
|
||||
<key key0="у" key2="7" key3="&" key4="§"/>
|
||||
<key key0="и" key2="8" key3="*"/>
|
||||
<key key0="о" key1="accent_macron" key2="9" key3="(" key4=")"/>
|
||||
<key key0="п" key2="0" key3="ш" key4="щ"/>
|
||||
</row>
|
||||
<row>
|
||||
<key shift="0.5" key0="а" key1="tab" key2="`"/>
|
||||
<key key0="с"/>
|
||||
<key key0="д" key1="accent_grave" key3="accent_aigu"/>
|
||||
<key key0="ф"/>
|
||||
<key key0="г" key1="accent_caron" key2="-" key3="_"/>
|
||||
<key key0="х" key2="=" key3="+"/>
|
||||
<key key0="й" key1="accent_trema" key2="accent_circonflexe" key4="}" key3="{"/>
|
||||
<key key0="к" key3="[" key4="]"/>
|
||||
<key key0="л" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift"/>
|
||||
<key key0="з"/>
|
||||
<key key0="ь" key1="accent_ring" key3="ѝ"/>
|
||||
<key key0="ц" key1="accent_cedille" key2="<" key3="."/>
|
||||
<key key0="ж" key2=">" key3=","/>
|
||||
<key key0="б" key2="\?" key3="/"/>
|
||||
<key key0="н" key1="accent_tilde" key2=":" key3=";"/>
|
||||
<key key0="м" key2=""" key3="'"/>
|
||||
<key width="1.5" key0="backspace" key2="delete"/>
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.8" key0="ctrl" key3="switch_numeric"/>
|
||||
<key width="1.2" key0="alt" key1="fn" key2="change_method" key3="switch_emoji" key4="config"/>
|
||||
<key width="4.0" key0="space"/>
|
||||
<key width="1.2" key1="up" key2="right" key3="left" key4="down"/>
|
||||
<key width="1.8" key0="enter" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
@@ -1,9 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="juloo.keyboard2.SettingsActivity" android:supportsSwitchingToNextInputMethod="true">
|
||||
<subtype android:label="%s" android:languageTag="en" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty"/>
|
||||
<subtype android:label="%s" android:languageTag="fr" android:imeSubtypeLocale="fr_FR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=grave|aigu|circonflexe|cedille|trema"/>
|
||||
<subtype android:label="%s" android:languageTag="es" android:imeSubtypeLocale="es_ES" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|tilde|trema"/>
|
||||
<subtype android:label="%s" android:languageTag="de" android:imeSubtypeLocale="de_DE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz,extra_keys=trema|szlig"/>
|
||||
<subtype android:label="%s" android:languageTag="en" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty"/>
|
||||
<subtype android:label="%s" android:languageTag="es" android:imeSubtypeLocale="es_ES" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|tilde|trema"/>
|
||||
<subtype android:label="%s" android:languageTag="fr" android:imeSubtypeLocale="fr_FR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=grave|aigu|circonflexe|cedille|trema"/>
|
||||
<subtype android:label="%s" android:languageTag="it" android:imeSubtypeLocale="it_IT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=grave|aigu"/>
|
||||
<subtype android:label="%s" android:languageTag="lv" android:imeSubtypeLocale="lv_LV" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_lv,extra_keys=caron|cedille|macron"/>
|
||||
<subtype android:label="%s" android:languageTag="sv" android:imeSubtypeLocale="sv_SE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|trema|ring"/>
|
||||
<subtype android:label="%s" android:languageTag="bg" android:imeSubtypeLocale="bg_BG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=bgph1"/>
|
||||
</input-method>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<key key0="y" key2="6" key3="^"/>
|
||||
<key key0="u" key2="7" key3="&"/>
|
||||
<key key0="i" key2="8" key3="*"/>
|
||||
<key key0="o" key2="9" key3="(" key4=")"/>
|
||||
<key key0="o" key1="accent_macron" key2="9" key3="(" key4=")"/>
|
||||
<key key0="p" key2="0"/>
|
||||
</row>
|
||||
<row>
|
||||
@@ -17,10 +17,10 @@
|
||||
<key key0="s" key1="accent_ring" key3="ß"/>
|
||||
<key key0="d" key1="accent_grave" key3="accent_aigu"/>
|
||||
<key key0="f"/>
|
||||
<key key0="g" key2="-" key3="_"/>
|
||||
<key key0="g" key1="accent_caron" key2="-" key3="_"/>
|
||||
<key key0="h" key2="=" key3="+"/>
|
||||
<key key0="j" key1="accent_trema" key2="accent_circonflexe" key4="}" key3="{"/>
|
||||
<key key0="k" key4="]" key3="["/>
|
||||
<key key0="k" key3="[" key4="]"/>
|
||||
<key key0="l" key2="|" key3="\\"/>
|
||||
</row>
|
||||
<row>
|
||||
|
44
res/xml/qwerty_lv.xml
Normal file
44
res/xml/qwerty_lv.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<keyboard>
|
||||
<row>
|
||||
<key key0="q" key1="esc" key2="1" key3="~" key4="!" />
|
||||
<key key0="w" key2="2" key3="\@" />
|
||||
<key key0="e" key1="ē" key2="3" key3="\#" />
|
||||
<key key0="r" key1="ŗ" key2="4" key3="$" />
|
||||
<key key0="t" key2="5" key3="%" />
|
||||
<key key0="y" key2="6" key3="^" />
|
||||
<key key0="u" key1="ū" key2="7" key3="&" />
|
||||
<key key0="i" key1="ī" key2="8" key3="*" />
|
||||
<key key0="o" key1="ō" key2="9" key3="(" key4=")" />
|
||||
<key key0="p" key2="0" key3="{" key4="}" />
|
||||
</row>
|
||||
<row>
|
||||
<key shift="0.5" key0="a" key1="ā" />
|
||||
<key key0="s" key1="š" />
|
||||
<key key0="d" />
|
||||
<key key0="f" />
|
||||
<key key0="g" key1="ģ" />
|
||||
<key key0="h" key2="accent_macron" key3="accent_caron" key4="accent_cedille" />
|
||||
<key key0="j" key1="+" key2="=" key3="-" key4="_" />
|
||||
<key key0="k" key1="ķ" key3="[" key4="]" />
|
||||
<key key0="l" key1="ļ" key2="|" key3="/" key4="\\" />
|
||||
</row>
|
||||
<row>
|
||||
<key width="1.5" key0="shift" key1="tab" />
|
||||
<key key0="z" key1="ž" />
|
||||
<key key0="x" />
|
||||
<key key0="c" key1="č" />
|
||||
<key key0="v" />
|
||||
<key key0="b" key3="<" key4=">" />
|
||||
<key key0="n" key1="ņ" key2="`" key3=":" key4=";" />
|
||||
<key key0="m" key1="'" key2=""" key3="," key4="\?" />
|
||||
<key width="1.5" key0="backspace" key2="delete" />
|
||||
</row>
|
||||
<row height="0.95">
|
||||
<key width="1.8" key0="ctrl" key3="switch_numeric" />
|
||||
<key width="1.2" key0="alt" key1="fn" key2="change_method" key3="switch_emoji" key4="config" />
|
||||
<key width="4.0" key0="space" />
|
||||
<key width="1.2" key0="." key1="up" key2="right" key3="left" key4="down" />
|
||||
<key width="1.8" key0="enter" key2="action" />
|
||||
</row>
|
||||
</keyboard>
|
@@ -39,6 +39,6 @@
|
||||
<key width="1.2" key0="alt" key1="fn" key2="change_method" key3="switch_emoji" key4="config"/>
|
||||
<key width="4.0" key0="space"/>
|
||||
<key width="1.2" key1="up" key2="right" key3="left" key4="down"/>
|
||||
<key width="1.8" key0="enter"/>
|
||||
<key width="1.8" key0="enter" key2="action"/>
|
||||
</row>
|
||||
</keyboard>
|
||||
|
@@ -15,10 +15,12 @@
|
||||
<juloo.common.IntSlideBarPreference android:key="vibrate_duration" android:title="@string/pref_vibrate_duration_title" android:summary="%sms" android:defaultValue="20" min="5" max="50"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/pref_category_style">
|
||||
<ListPreference android:key="theme" android:title="@string/pref_theme" android:summary="%s" android:defaultValue="dark" android:entries="@array/pref_theme_entries" android:entryValues="@array/pref_theme_values"/>
|
||||
<ListPreference android:key="theme" android:title="@string/pref_theme" android:summary="%s" android:defaultValue="system" android:entries="@array/pref_theme_entries" android:entryValues="@array/pref_theme_values"/>
|
||||
<juloo.common.IntSlideBarPreference android:key="margin_bottom" android:title="@string/pref_margin_bottom_title" android:summary="%sdp" android:defaultValue="5" min="0" max="100"/>
|
||||
<juloo.common.IntSlideBarPreference android:key="key_height" android:title="@string/pref_key_height_title" android:summary="%sdp" android:defaultValue="50" min="30" max="90"/>
|
||||
<juloo.common.IntSlideBarPreference android:key="horizontal_margin" android:title="@string/pref_horizontal_margin_title" android:summary="%sdp" android:defaultValue="3" min="0" max="20"/>
|
||||
<juloo.common.SlideBarPreference android:key="character_size" android:title="@string/pref_character_size_title" android:summary="@string/pref_character_size_summary" android:defaultValue="1.0" min="0.8" max="1.2"/>
|
||||
<juloo.common.IntSlideBarPreference android:key="key_vertical_space" android:title="@string/pref_key_vertical_space" android:summary="%sdp" android:defaultValue="2" min="0" max="8"/>
|
||||
<juloo.common.IntSlideBarPreference android:key="key_horizontal_space" android:title="@string/pref_key_horizontal_space" android:summary="%sdp" android:defaultValue="2" min="0" max="8"/>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
@@ -2,7 +2,9 @@ package juloo.keyboard2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
@@ -12,8 +14,6 @@ final class Config
|
||||
// From resources
|
||||
public final float marginTop;
|
||||
public final float keyPadding;
|
||||
public final float keyVerticalInterval;
|
||||
public final float keyHorizontalInterval;
|
||||
|
||||
// From preferences
|
||||
public int layout; // Or '-1' for the system defaults
|
||||
@@ -26,6 +26,8 @@ final class Config
|
||||
public float marginBottom;
|
||||
public float keyHeight;
|
||||
public float horizontalMargin;
|
||||
public float keyVerticalInterval;
|
||||
public float keyHorizontalInterval;
|
||||
public boolean preciseRepeat;
|
||||
public float characterSize; // Ratio
|
||||
public int accents; // Values are R.values.pref_accents_v_*
|
||||
@@ -46,8 +48,6 @@ final class Config
|
||||
// static values
|
||||
marginTop = res.getDimension(R.dimen.margin_top);
|
||||
keyPadding = res.getDimension(R.dimen.key_padding);
|
||||
keyVerticalInterval = res.getDimension(R.dimen.key_vertical_interval);
|
||||
keyHorizontalInterval = res.getDimension(R.dimen.key_horizontal_interval);
|
||||
// default values
|
||||
layout = -1;
|
||||
vibrateEnabled = true;
|
||||
@@ -57,6 +57,8 @@ final class Config
|
||||
marginBottom = res.getDimension(R.dimen.margin_bottom);
|
||||
keyHeight = res.getDimension(R.dimen.key_height);
|
||||
horizontalMargin = res.getDimension(R.dimen.horizontal_margin);
|
||||
keyVerticalInterval = res.getDimension(R.dimen.key_vertical_interval);
|
||||
keyHorizontalInterval = res.getDimension(R.dimen.key_horizontal_interval);
|
||||
preciseRepeat = true;
|
||||
characterSize = 1.f;
|
||||
accents = 1;
|
||||
@@ -77,7 +79,8 @@ final class Config
|
||||
public void refresh(Context context)
|
||||
{
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
DisplayMetrics dm = context.getResources().getDisplayMetrics();
|
||||
Resources res = context.getResources();
|
||||
DisplayMetrics dm = res.getDisplayMetrics();
|
||||
layout = layoutId_of_string(prefs.getString("layout", "system"));
|
||||
swipe_dist_dp = Float.valueOf(prefs.getString("swipe_dist", "15"));
|
||||
swipe_dist_px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, swipe_dist_dp, dm);
|
||||
@@ -86,6 +89,8 @@ final class Config
|
||||
longPressTimeout = prefs.getInt("longpress_timeout", (int)longPressTimeout);
|
||||
longPressInterval = prefs.getInt("longpress_interval", (int)longPressInterval);
|
||||
marginBottom = getDipPref(dm, prefs, "margin_bottom", marginBottom);
|
||||
keyVerticalInterval = getDipPref(dm, prefs, "key_vertical_space", keyVerticalInterval);
|
||||
keyHorizontalInterval = getDipPref(dm, prefs, "key_horizontal_space", keyHorizontalInterval);
|
||||
// Add keyVerticalInterval to keyHeight because the space between the keys
|
||||
// is removed from the keys during rendering
|
||||
keyHeight = getDipPref(dm, prefs, "key_height", keyHeight) + keyVerticalInterval;
|
||||
@@ -93,24 +98,47 @@ final class Config
|
||||
preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
|
||||
characterSize = prefs.getFloat("character_size", characterSize);
|
||||
accents = Integer.valueOf(prefs.getString("accents", "1"));
|
||||
theme = themeId_of_string(prefs.getString("theme", ""));
|
||||
theme = getThemeId(res, prefs.getString("theme", ""));
|
||||
}
|
||||
|
||||
private float getDipPref(DisplayMetrics dm, SharedPreferences prefs, String pref_name, float def)
|
||||
{
|
||||
int value = prefs.getInt(pref_name, -1);
|
||||
if (value < 0)
|
||||
float value;
|
||||
try { value = prefs.getInt(pref_name, -1); }
|
||||
catch (Exception e) { value = prefs.getFloat(pref_name, -1f); }
|
||||
if (value < 0f)
|
||||
return (def);
|
||||
return (TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, dm));
|
||||
}
|
||||
|
||||
private int getThemeId(Resources res, String theme_name)
|
||||
{
|
||||
switch (theme_name)
|
||||
{
|
||||
case "light": return R.style.Light;
|
||||
case "black": return R.style.Black;
|
||||
case "dark": return R.style.Dark;
|
||||
default:
|
||||
case "system":
|
||||
if (Build.VERSION.SDK_INT >= 8)
|
||||
{
|
||||
int night_mode = res.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
if ((night_mode & Configuration.UI_MODE_NIGHT_NO) != 0)
|
||||
return R.style.Light;
|
||||
}
|
||||
return R.style.Dark;
|
||||
}
|
||||
}
|
||||
|
||||
public static int layoutId_of_string(String name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "azerty": return R.xml.azerty;
|
||||
case "qwerty": return R.xml.qwerty;
|
||||
case "qwerty_lv": return R.xml.qwerty_lv;
|
||||
case "qwertz": return R.xml.qwertz;
|
||||
case "bgph1": return R.xml.local_bgph1;
|
||||
case "system": default: return -1;
|
||||
}
|
||||
}
|
||||
@@ -120,14 +148,16 @@ final class Config
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "grave": return KeyValue.FLAG_ACCENT1;
|
||||
case "aigu": return KeyValue.FLAG_ACCENT2;
|
||||
case "circonflexe": return KeyValue.FLAG_ACCENT3;
|
||||
case "tilde": return KeyValue.FLAG_ACCENT4;
|
||||
case "caron": return KeyValue.FLAG_ACCENT_CARON;
|
||||
case "cedille": return KeyValue.FLAG_ACCENT5;
|
||||
case "trema": return KeyValue.FLAG_ACCENT6;
|
||||
case "circonflexe": return KeyValue.FLAG_ACCENT3;
|
||||
case "grave": return KeyValue.FLAG_ACCENT1;
|
||||
case "macron": return KeyValue.FLAG_ACCENT_MACRON;
|
||||
case "ring": return KeyValue.FLAG_ACCENT_RING;
|
||||
case "szlig": return KeyValue.FLAG_LANG_SZLIG;
|
||||
case "tilde": return KeyValue.FLAG_ACCENT4;
|
||||
case "trema": return KeyValue.FLAG_ACCENT6;
|
||||
default: throw new RuntimeException(name);
|
||||
}
|
||||
}
|
||||
|
@@ -98,11 +98,21 @@ class KeyModifier
|
||||
case '-': return '÷';
|
||||
default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c);
|
||||
}
|
||||
case KeyValue.FLAG_ACCENT_CARON:
|
||||
switch (c)
|
||||
{
|
||||
default: return (char)KeyCharacterMap.getDeadChar('\u02C7', c);
|
||||
}
|
||||
case KeyValue.FLAG_ACCENT_RING:
|
||||
switch (c)
|
||||
{
|
||||
default: return (char)KeyCharacterMap.getDeadChar('\u02DA', c);
|
||||
}
|
||||
case KeyValue.FLAG_ACCENT_MACRON:
|
||||
switch (c)
|
||||
{
|
||||
default: return (char)KeyCharacterMap.getDeadChar('\u00AF', c);
|
||||
}
|
||||
case KeyValue.FLAG_ACCENT_SUPERSCRIPT:
|
||||
switch (c)
|
||||
{
|
||||
@@ -183,6 +193,7 @@ class KeyModifier
|
||||
case "$": name = "€"; break;
|
||||
case "#": name = "£"; break;
|
||||
case "*": name = "°"; break;
|
||||
case "tab": name = "\\t"; break;
|
||||
default: return k;
|
||||
}
|
||||
return KeyValue.getKeyByName(name);
|
||||
|
@@ -43,10 +43,13 @@ class KeyValue
|
||||
public static final int FLAG_ACCENT_SUPERSCRIPT = (1 << 22);
|
||||
public static final int FLAG_ACCENT_SUBSCRIPT = (1 << 23);
|
||||
public static final int FLAG_ACCENT_RING = (1 << 24);
|
||||
public static final int FLAG_ACCENT_CARON = (1 << 26);
|
||||
public static final int FLAG_ACCENT_MACRON = (1 << 27);
|
||||
|
||||
public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 |
|
||||
FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 |
|
||||
FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_RING;
|
||||
FLAG_ACCENT_CARON | FLAG_ACCENT_MACRON | FLAG_ACCENT_SUPERSCRIPT |
|
||||
FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_RING;
|
||||
|
||||
// Language specific keys
|
||||
public static final int FLAG_LANG_SZLIG = (1 << 25);
|
||||
@@ -94,7 +97,8 @@ class KeyValue
|
||||
KeyValue kv = KeyValue.keys.get(name);
|
||||
if (kv != null)
|
||||
return kv;
|
||||
return new KeyValue(name, name, CHAR_NONE, EVENT_NONE, 0);
|
||||
char c = (name.length() == 1) ? name.charAt(0) : CHAR_NONE;
|
||||
return new KeyValue(name, name, c, EVENT_NONE, 0);
|
||||
}
|
||||
|
||||
private static void addKey(String name, String symbol, char c, int event, int flags)
|
||||
@@ -143,11 +147,13 @@ class KeyValue
|
||||
addModifierKey("shift", "⇧", FLAG_LOCK | FLAG_SHIFT);
|
||||
addModifierKey("ctrl", "Ctrl", FLAG_CTRL);
|
||||
addModifierKey("alt", "Alt", FLAG_ALT);
|
||||
addModifierKey("accent_grave", "◌̀", FLAG_ACCENT1);
|
||||
addModifierKey("accent_aigu", "◌́", FLAG_ACCENT2);
|
||||
addModifierKey("accent_circonflexe", "◌̂", FLAG_ACCENT3);
|
||||
addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4);
|
||||
addModifierKey("accent_caron", "◌̌", FLAG_ACCENT_CARON);
|
||||
addModifierKey("accent_cedille", "◌̧", FLAG_ACCENT5);
|
||||
addModifierKey("accent_circonflexe", "◌̂", FLAG_ACCENT3);
|
||||
addModifierKey("accent_grave", "◌̀", FLAG_ACCENT1);
|
||||
addModifierKey("accent_macron", "◌̄", FLAG_ACCENT_MACRON);
|
||||
addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4);
|
||||
addModifierKey("accent_trema", "◌̈", FLAG_ACCENT6);
|
||||
addModifierKey("accent_ring", "◌̊", FLAG_ACCENT_RING);
|
||||
addModifierKey("superscript", "◌͆", FLAG_ACCENT_SUPERSCRIPT);
|
||||
@@ -209,10 +215,10 @@ class KeyValue
|
||||
addCharKey(')', KeyEvent.KEYCODE_NUMPAD_RIGHT_PAREN);
|
||||
addCharKey('ß', EVENT_NONE, FLAG_LANG_SZLIG);
|
||||
|
||||
addSpecialKey("config", "Conf", EVENT_CONFIG);
|
||||
addSpecialKey("config", "⛭", EVENT_CONFIG);
|
||||
addSpecialKey("switch_text", "ABC", EVENT_SWITCH_TEXT);
|
||||
addSpecialKey("switch_numeric", "123+", EVENT_SWITCH_NUMERIC);
|
||||
addSpecialKey("switch_emoji", ":)", EVENT_SWITCH_EMOJI);
|
||||
addSpecialKey("switch_emoji", "☻", EVENT_SWITCH_EMOJI);
|
||||
addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_EMOJI);
|
||||
addSpecialKey("change_method", "⊞", EVENT_CHANGE_METHOD);
|
||||
addSpecialKey("action", "Action", EVENT_ACTION); // Will always be replaced
|
||||
@@ -242,6 +248,7 @@ class KeyValue
|
||||
addEventKey("f10", "F10", KeyEvent.KEYCODE_F10);
|
||||
addEventKey("tab", "↹", KeyEvent.KEYCODE_TAB);
|
||||
|
||||
addKey("\\t", "\\t", '\t', EVENT_NONE, 0); // Send the tab character
|
||||
addKey("space", " ", ' ', KeyEvent.KEYCODE_SPACE, 0);
|
||||
}
|
||||
}
|
||||
|
@@ -57,6 +57,7 @@ public class Keyboard2 extends InputMethodService
|
||||
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
|
||||
Config.initGlobalConfig(this, new KeyEventHandler(this.new Receiver()));
|
||||
_config = Config.globalConfig();
|
||||
_config.refresh(this);
|
||||
_keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard);
|
||||
_keyboardView.reset();
|
||||
}
|
||||
@@ -141,18 +142,20 @@ public class Keyboard2 extends InputMethodService
|
||||
|
||||
private String actionLabel_of_imeAction(int action)
|
||||
{
|
||||
int res;
|
||||
switch (action)
|
||||
{
|
||||
case EditorInfo.IME_ACTION_NEXT: res = R.string.key_action_next; break;
|
||||
case EditorInfo.IME_ACTION_DONE: res = R.string.key_action_done; break;
|
||||
case EditorInfo.IME_ACTION_GO: res = R.string.key_action_go; break;
|
||||
case EditorInfo.IME_ACTION_PREVIOUS: res = R.string.key_action_prev; break;
|
||||
case EditorInfo.IME_ACTION_SEARCH: res = R.string.key_action_search; break;
|
||||
case EditorInfo.IME_ACTION_SEND: res = R.string.key_action_send; break;
|
||||
case EditorInfo.IME_ACTION_UNSPECIFIED:
|
||||
case EditorInfo.IME_ACTION_NEXT: return "Next";
|
||||
case EditorInfo.IME_ACTION_DONE: return "Done";
|
||||
case EditorInfo.IME_ACTION_GO: return "Go";
|
||||
case EditorInfo.IME_ACTION_PREVIOUS: return "Prev";
|
||||
case EditorInfo.IME_ACTION_SEARCH: return "Search";
|
||||
case EditorInfo.IME_ACTION_SEND: return "Send";
|
||||
case EditorInfo.IME_ACTION_NONE:
|
||||
default: return null;
|
||||
}
|
||||
return getResources().getString(res);
|
||||
}
|
||||
|
||||
private void refreshEditorInfo(EditorInfo info)
|
||||
@@ -171,21 +174,31 @@ public class Keyboard2 extends InputMethodService
|
||||
_config.actionLabel = actionLabel_of_imeAction(action); // Might be null
|
||||
_config.actionId = action;
|
||||
_config.swapEnterActionKey =
|
||||
(info.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0;
|
||||
(info.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshConfig()
|
||||
{
|
||||
int prev_theme = _config.theme;
|
||||
_config.refresh(this);
|
||||
refreshSubtypeImm();
|
||||
// Refreshing the theme config requires re-creating the views
|
||||
if (prev_theme != _config.theme)
|
||||
{
|
||||
_keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard);
|
||||
_emojiPane = null;
|
||||
}
|
||||
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartInputView(EditorInfo info, boolean restarting)
|
||||
{
|
||||
// Update '_config' before calling 'KeyboardView.setKeyboard'
|
||||
refreshSubtypeImm();
|
||||
refreshConfig();
|
||||
refreshEditorInfo(info);
|
||||
if ((info.inputType & InputType.TYPE_CLASS_NUMBER) != 0)
|
||||
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
|
||||
else
|
||||
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
|
||||
_keyboardView.reset(); // Layout might need to change due to rotation
|
||||
setInputView(_keyboardView);
|
||||
}
|
||||
|
||||
@@ -215,16 +228,7 @@ public class Keyboard2 extends InputMethodService
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
|
||||
{
|
||||
int prev_theme = _config.theme;
|
||||
_config.refresh(this);
|
||||
refreshSubtypeImm();
|
||||
_keyboardView.refreshConfig(getLayout(_currentTextLayout));
|
||||
// Refreshing the theme config requires re-creating the views
|
||||
if (prev_theme != _config.theme)
|
||||
{
|
||||
_keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard);
|
||||
_emojiPane = null;
|
||||
}
|
||||
refreshConfig();
|
||||
}
|
||||
|
||||
/** Not static */
|
||||
@@ -233,7 +237,9 @@ public class Keyboard2 extends InputMethodService
|
||||
public void switchToNextInputMethod()
|
||||
{
|
||||
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.switchToNextInputMethod(getConnectionToken(), false);
|
||||
imm.showInputMethodPicker();
|
||||
// deprecated in version 28: imm.switchToNextInputMethod(getConnectionToken(), false);
|
||||
// added in version 28: switchToNextInputMethod(false);
|
||||
}
|
||||
|
||||
public void setPane_emoji()
|
||||
|
@@ -47,15 +47,8 @@ public class Keyboard2View extends View
|
||||
_handler = new Handler(this);
|
||||
_theme = new Theme(getContext(), attrs);
|
||||
_config = Config.globalConfig();
|
||||
refreshConfig(null);
|
||||
setOnTouchListener(this);
|
||||
}
|
||||
|
||||
/* Internally calls [reset()]. */
|
||||
public void refreshConfig(KeyboardData kw)
|
||||
{
|
||||
if (kw != null)
|
||||
setKeyboard(kw); // handle layout options then calls reset().
|
||||
reset();
|
||||
}
|
||||
|
||||
public void setKeyboard(KeyboardData kw)
|
||||
|
Reference in New Issue
Block a user