Compare commits

...

99 Commits

Author SHA1 Message Date
Jules Aguillon
1aaf427883 Release 1.22.0 2023-04-02 17:27:44 +02:00
Jules Aguillon
a662934afc Bump targetSdkVersion to 33
No change needed.
2023-04-02 17:16:56 +02:00
Jules Aguillon
351355b3a7 Launcher activity: Input box
For trying the keyboard without having to mess with an other app.
2023-04-02 13:29:53 +02:00
Jules Aguillon
3caca59ff4 Refactor: Remove unecessary method KeyboardData.load_pin_entry 2023-03-28 11:55:24 +02:00
Jules Aguillon
35b4e442ab Add a launchable explanatory activity
This activity points to the system settings page for enabling input
methods. This is purely a shortcut but is expected by many users.

It could be made more useful in the future or hidden whenever the
keyboard is enabled.
2023-03-28 11:22:17 +02:00
Jules Aguillon
c4de1ec267 sync_translations.py: Output sub-elements 2023-03-28 11:11:41 +02:00
Chasm Solacer
59b0b60f3f Updated pl (Polish) translation (#316) 2023-03-24 01:26:14 +01:00
Jules Aguillon
2f938dc6f4 Correct pointer direction
The previous algorithm did not cut the circle into 16 equal parts.
The division by 2pi yielded numbers smaller than 16, which no longer
made sense after the cast to int.
2023-03-13 03:06:43 +01:00
Mostafa Ayesh
ce51df6f5a Add Arabic layout (#314)
* add arabic keyboard
* use unicode values for special characters
* add alternate layout
* use arabic numbers
2023-03-11 16:54:20 +01:00
Luke Videckis
6aaa497393 New Hindi layout (#313)
* New Hindi layout
* Update default layout for Marathi, Nepali
* Consistent naming for Devanagari layouts
2023-03-11 16:43:17 +01:00
Jules Aguillon
bac228e6fb Add extra keys for Ukrainian 2023-03-05 23:36:15 +01:00
Jules Aguillon
d7e4840f4d Add support for Belarusian
It uses the russian layout with placed extra keys.
2023-03-05 23:34:26 +01:00
Jules Aguillon
18d3fd3c84 Refactor: Remove KeyboardData.Corner
The Corner class is removed. The "localized" flag for all the corners is
held in a bitfield.
2023-03-05 23:08:35 +01:00
Jules Aguillon
c56ad425f6 Remove the 'edgekeys' attribute 2023-03-05 20:08:56 +01:00
Jules Aguillon
a6fe5cae00 Allow 8 symbols per key
'Keyboard.Key' now contains an array of size 9, giving each keyvalue an
index. The algorithm for finding the nearest key during a swipe now
needs 16 segments, which are now calculated as an angle.

The algorithm does one more interation instead of 2 more, slightly
reducing the sensitivity of corner values. The 'getAtDirection' function
is moved into the Pointers class to clearly separate the two systems.

The 'edgekey' attribute is now obsolete but is kept for compatibility.
The flag is removed internally, key index are simply translated.
Similarly, the 'slider' attribute now act on keys at index 5 and 6
instead of 2 and 3.
2023-03-03 19:44:05 +01:00
Jules Aguillon
1f9e92ed60 Fix caps lock stopped by auto-capitalisation
Auto-capitalisation triggers when the backspace key is used. Make sure
to not remove a locked shift pointer.
2023-03-02 11:40:22 +01:00
Jules Aguillon
0da02d60c4 Do not remove numpad keys from the layout
This removes keys like '.' and '-' from their usual place, which is
pretty annoying.

The feature is retained for the number row.
2023-03-02 10:57:58 +01:00
Edgars
70754aa3eb Update LV translation 2023-03-02 10:41:46 +01:00
Jules Aguillon
2244c46af1 Allow key and keyboard opacity to be 0 2023-02-26 11:52:10 +01:00
Jules Aguillon
798494e701 Fix miscalculated keyboard height with number row
The 'keysHeight' field needs to be updated. As this class is not
intended to be mutable, copy the list of rows and call the constructor.

Also remove an unecessary component of the keyboard height calculation.
2023-02-26 11:31:08 +01:00
mscheidemann
0d902aa334 Update values-de/strings.xml (#295)
Missing German translation completed
2023-02-26 09:54:47 +01:00
Jules Aguillon
91f27a1432 Update translations
Outdated since 0f62b30
2023-02-26 09:49:06 +01:00
JackDotJS
9523b158b3 Add theme "Alternative Black" (#297)
* Add alternative black theme
2023-02-26 09:47:31 +01:00
Jules Aguillon
2ca7b4427d Release 1.21.0 (32) 2023-02-12 23:38:37 +01:00
Jules Aguillon
0f62b3044c Option to switch to the previous input method
A new option changes the "change_method" into the new
"change_method_prev". It switch to the previously used input method.

A long press on "change_method_prev" sends "change_method".

A new section is added in the settings and existing options are moved.
2023-02-12 23:20:11 +01:00
Jules Aguillon
c46e3b6c61 Modify keys after a long press 2023-02-12 23:14:57 +01:00
Kazoku
5fac3459aa Added missing accent that can combine with horn_accent (#293) 2023-02-09 23:38:55 +01:00
Kazoku
b54f9c5797 Vietnamese keyboard (#291)
Added missing accent (horn, hook, dot below)
Added layout
Added accent font svg (by modified existing accent)
2023-02-09 18:40:48 +01:00
Jules Aguillon
72249b8a42 Fix arrow keys not repeating
The special handling of arrow keys have been removed in 854eff2. Key
repeat was not starting when the key0 was empty.
2023-02-08 22:38:01 +01:00
rVnPower
82b2bf6dfb Complete Vietnamese translation (#292) 2023-02-08 16:35:44 +01:00
Ram Kromberg
0fe27ef486 Add theme 'ePaper' (#287)
* Add theme 'ePaper'
2023-01-31 20:11:36 +01:00
Ram Kromberg
51ce2ccdf1 Add layouts 'he_il_1452_1' and 'he_il_1452_2' 2023-01-31 20:07:30 +01:00
Jules Aguillon
eb0df72ba1 Update French translation 2023-01-31 00:07:17 +01:00
Jules Aguillon
540384bb0a Add optional number row
An option is added to enable an extra number row at the top of the
keyboard. Digits are removed from the keyboard while the number row is
visible.
2023-01-30 23:58:47 +01:00
Jules Aguillon
c7184303e9 Remove the digits when numpad is visible 2023-01-30 23:54:39 +01:00
Jules Aguillon
78a461f740 Modification step for the special layout
Refactor, follow up of 90b7944. Add a modification step to the "special"
layouts: numpad, greekmath, pin entry.

Remove the apply_key0 function, which is not expressive enough.
Add an enum instead of yet an other "switch_" function.
2023-01-30 23:46:02 +01:00
Jules Aguillon
90b7944129 Apply modify_layout to text layout only
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to
implement more complicated transformations to the layouts.
2023-01-30 22:33:01 +01:00
Jules Aguillon
2539feadcd Fix placeholder key not replaced
Since fecc4dd, placeholder keys can't be compared by reference.
Add a placeholder kind and defined placeholder values.
2023-01-30 21:29:59 +01:00
Jules Aguillon
5f283cd0cd Slightly increase the width of the spacebar
The left and right arrows are less often needed and the key can be
shorter.
2023-01-29 19:46:56 +01:00
Jules Aguillon
fecc4dd70a Remove the explicit hashmap in KeyValue
Refactoring. Predefined keys are represented by a big switch statement
rather than added into a hashmap.
2023-01-29 19:38:54 +01:00
Jules Aguillon
7bc93c470e Don't send event at end of sliding
A sliding pointer going up must not cause a key event to be sent. This
caused an extra cursor movement and cleared the latched modifiers.
2023-01-29 18:49:44 +01:00
Jules Aguillon
854eff211d Move cursor by sliding on the space bar
Send key events for the left or right arrow as the finger slides on the
space bar.
Can be used to select text by holding shift. Works under Termux.

Events are sent linearly as the finger travels. The distance between
each events is defined from the swiping distance divided by 4.

'slider="true"' can be set on a key that have 'edgekeys="true"'.
'key2' and 'key3' represent the right and left keys.
2023-01-22 23:21:21 +01:00
Jules Aguillon
f4032e3be9 Remove the modulated repeat
It allowed to modulate the repeat speed of some keys (arrow, backspace,
delete) by move the finger farther or closer to the key.

In practice, this wasn't pratical and doesn't seem popular. It is
removed in favor of a better mechanism for moving the cursor.
2023-01-22 23:20:04 +01:00
Maki Nishikino
f7f4d4d6aa Update russian strings.xml (#280) 2023-01-21 15:56:32 +01:00
Jules Aguillon
de5571d428 Release 1.20.2 (31) 2023-01-15 23:34:04 +01:00
Jules Aguillon
6126578111 Avoid switching back from secondary layout automatically
Stay on the secondary layout after a config refresh or onStartInputView.
The information is kept until the keyboard is restarted.

Additionally, move tweaking the secondary layout to the Config class now
that physical equality is not needed.
2023-01-15 23:19:09 +01:00
Jules Aguillon
046416389a Present the "keyboard height" option similarly to the margin options 2023-01-15 19:37:03 +01:00
Jules Aguillon
fd0f0d5476 Separate option for bottom margin in landscape mode
A large margin in portrait mode is desirable but generally not in
landscape mode.
2023-01-15 19:19:07 +01:00
Jules Aguillon
a199962117 Separate option for horizontal margin in landscape mode
A separate option is needed, the +25dp offset wasn't enough.
2023-01-15 19:11:08 +01:00
Maki Nishikino
8a3c0566e7 Update Russian translation and add Russain description (#279)
* Add ru-RU market description

* Add russian settings translate
2023-01-15 17:20:04 +01:00
Jules Aguillon
e190394b47 Add layout 'qwertz_sk'
Co-authored-by: Jozef Kundlak <ingjozefkundlak@gmail.com>
2023-01-14 23:31:37 +01:00
Jules Aguillon
dcc4a640f7 Remove borders on the black theme 2023-01-07 14:55:43 +01:00
Jules Aguillon
c5f5a23d75 Fix dimensions going off after rotation
Values like 'characterSize' and 'horizontalMargin' can't be fed back into the default value because they are not of the same unit.
To avoid this happening again, change the way the default value is defined for every options.
The 'key_height' dimension was no longer used.
2022-12-31 14:00:38 +01:00
Jules Aguillon
73ef7c6765 Improve the description of the app
"swipe gesture" is not clearly defined and can be confused with the
one from the Swype keyboard. Also remove the useless part that is
repeated below.
2022-12-31 13:47:38 +01:00
Jules Aguillon
e333eb06fd Add keys for every context menu actions
The most requested keys are undo and redo. Unfortunatly redo doesn't
work reliably.

The other context menu actions like share, assist and autofill are added
even thought they are rarely useful or implemented.
2022-12-30 15:29:18 +01:00
Jules Aguillon
764cd882d2 Fix inaccessible text layout from pin
The "main" layout can now be pin layout. 'SWITCH_TEXT' and
'SWITCH_SECOND_BACK' don't mean to use that.
2022-12-29 12:43:02 +01:00
Jules Aguillon
a891a3a99b Release 1.20.1 2022-12-14 15:36:04 +01:00
Jules Aguillon
8f972113ca Fix pin entry layout not showing up
The regular text layout was showing instead of the pin entry due to a
misuse of the 'switch' syntax.
2022-12-14 15:33:44 +01:00
Jules Aguillon
c61b31168c Fix a crash on API < 12
'extra_keys_subtype' can be none on API level < 12 when the "accents"
option is tweaked.
2022-12-14 15:09:46 +01:00
Chasm Solacer
c182f3d829 qwerty_pl layout is default for Polish language (#253) 2022-12-14 15:07:40 +01:00
Jules Aguillon
7d6306fbc9 Fix keyboard not showing up after rotation
'setInputView()' must be called on every 'onStartInputView()', not just
when the view is re-created.

This is broken since bf31872.
2022-12-14 15:04:11 +01:00
Jules Aguillon
cb2ea83f8a Release 1.20.0 2022-12-11 22:17:20 +01:00
Chasm Solacer
90cad963ec Make the keyboard transparent (#252)
* Add option for keyboard opacity (transparency). Keyboard background, keys and pressed keys can be adjusted separately.

* Make the borders transparent as well

* Moved setAlphas outside drawKeyFrame to top of onDraw method
2022-12-11 22:10:00 +01:00
Jules Aguillon
bf31872955 Handle configuration change quickly
setInputView() was not called when the view was re-created through
refresh_config(). Also, the refresh_config() function was not able to
properly set the current layout.

Now keep the default layout (_localeTextLayout) and the current non-text
layout (if any, _currentSpecialLayout) separately to be able to refresh
them later.

setInputView() is called everytime the view is created instead of by
onStartInputView() specifically.

The setting activity now save the preferences to the protected storage
in onStop() instead of listening for onSharedPreferenceChanged.
2022-12-11 21:57:40 +01:00
Jules Aguillon
199ca5cf03 Improve emoji pane layout
The measurement function was wrong in some situations. Set a width for
columns and properly configure the GridView.
2022-12-11 16:26:50 +01:00
Jules Aguillon
87d21685ca Fix keyboard not reacting to changed preferences
The callback might not be called if the "default" shared preferences is
different from the shared preferences actually used. This is unexpected
but seems to happen half of the time on Android 12.

Since f1ce6ab, this callback is critical to update the keyboard.
Restarting the application can no longer solve these issues.
2022-12-11 14:55:32 +01:00
Chasm Solacer
8665d002bf Added qwerty_pl layout (#251)
* Updated pl translation

* Added qwerty_pl.xml – QWERTY (Polski) layout
2022-12-11 14:49:22 +01:00
Jules Aguillon
f0fcd791ec Fix syntax error in values-fr 2022-12-11 14:47:28 +01:00
Jules Aguillon
cd2c2357ed Update translation: fr 2022-12-10 20:10:12 +01:00
Jules Aguillon
c17b53ce7f Add option 'numpad_layout'
Allow choosing whether to show the high or the low digits first. The
numeric pane and the numpad are affected by the option.
2022-12-10 19:39:22 +01:00
Chasm Solacer
940fc81193 Added pl_PL (Polish) translation (#250) 2022-12-10 19:01:42 +01:00
Jules Aguillon
523de040be Settings: Allow the keyboard to be smaller
Some users reported that 25% of the screen height is too high on their
screen. This doesn't seem to be a good way to define the height but
until it is improved, allow smaller values.
2022-12-10 18:46:05 +01:00
Jules Aguillon
804ea84981 Correctly handle pointer cancel events
The cancel event ends the motion, it doesn't apply to a single pointer
like it was previously expected.
2022-12-04 18:21:59 +01:00
Jules Aguillon
aaf3d8b630 Update French translation
Also, sync all the translations since the added option.
2022-11-26 23:13:04 +01:00
Jules Aguillon
19c38ca6a2 Improve glyph of accent_bar
The small bar on the middle of the dotted circle looked like a small
arrow. Make the bar span the whole circle, not on the middle.
2022-11-26 23:05:55 +01:00
Jules Aguillon
e745c81269 Allow using a custom layout
Add an option for specifying an XML layout description as a string.

The option is a bit rough at the moment:

- No documentation, users have to be aware of the keyboard's code to use
  this option.
- No error are shown, the layout will fallback to qwerty on error.
2022-11-26 22:30:45 +01:00
Jules Aguillon
09d984a1ab Refactor: Use XmlPullParser directly
XmlResourceParser is convenient but cannot be easily instantiated.
2022-11-26 22:16:48 +01:00
Jules Aguillon
69994a55c5 Refactor: Pass layout as a KeyboardData instead of ID
Parse layouts sooner.
2022-11-26 22:14:29 +01:00
Jules Aguillon
ebdacbc2b2 Make sure translation are in sync
The new script makes sure that strings files don't contain obsolete
strings but also ease the job of contributors by adding missing
translations as comments.

A Github Action ensures that translations stay in sync over time.
2022-11-26 18:11:28 +01:00
Jules Aguillon
122a9c23d0 Make fake pointers not lockable
Especially annoying now that modifiers are not locked by a double tap.
2022-11-26 17:22:31 +01:00
Jules Aguillon
6fb15b3f16 Stop using deprecated 'shouldOfferSwitchingToNextInputMethod'
This function has been introduced in API 19 and deprecated in API 28.
There was no version check for API 19 but instead of adding these,
simply remove the feature for API under 28.
2022-11-26 15:46:45 +01:00
six-6
9a0e03f644 Update Simplified Chinese translation (#245) 2022-11-26 15:39:01 +01:00
Jules Aguillon
f7e16c0345 Fix missing version check
setSystemGestureExclusionRects is API 29. Broken since d644d2b, which
almost got into the release!
2022-11-13 20:59:40 +01:00
Jules Aguillon
64c7c8ce20 Draw borders and update themes
Themes can define the color of each borders independently. Every borders
must have the same width for now. It's possible to set a different width
when the key is activated, thought this is only used to remove borders.

The 4 themes are updated to take advantage of borders.
2022-11-13 20:53:06 +01:00
Jules Aguillon
c1751578ef Highlight activated keys label
Rendering change only.
2022-11-13 18:03:01 +01:00
Jules Aguillon
2aa98de7aa Add editing keys: copy, paste, cut, select all 2022-11-13 16:45:57 +01:00
Jules Aguillon
078dbcd5ff Refactor: Move editing code from to KeyEventHandler
Remove the code dealing with InputMethodConnection from 'Keyboard2' and
move it into 'KeyEventHandler', where more editing actions can now be
implemented.

Autocapitalisation is also moved, the IReceiver interface is simplified.
2022-11-13 16:28:39 +01:00
Jules Aguillon
22a7df6632 Refactor: Use enum values in KeyValue.Kind
instead of maintaining a separate set of constants and a conversion
function.
2022-11-13 15:19:50 +01:00
Jules Aguillon
e213834f67 Don't depend on dpi values in swipe distance
The dpi values "xdpi" and "ydpi" can have wildly different values on
different devices.

The new computation defines a baseline and only take into account the
dpi values as a ratio.

On a 480dpi screen (in both directions), this decrease the value by
about 18%. This new distance felt better during testing.
2022-11-13 14:43:53 +01:00
Jules Aguillon
b102ad9078 Fix localized keys appearing on secondary layout 2022-11-13 00:39:31 +01:00
Jules Aguillon
51b330c616 Allow switching quickly between two layouts
A new option allow to choose a secondary layout, the switching key is
placed on the top edge of the space bar.

The "Programming layout" option was basically doing that but it was
possible to choose from a few layouts only. It is improved and renamed.

The 'LayoutListPreference' allows setting the string for the first entry
but otherwise share the rest of the array.

Add nice icons from materialdesignicons.
2022-11-13 00:24:23 +01:00
Jules Aguillon
815e30a505 Add option for brightness of labels
The brightness value is used as the alpha value when drawing the labels.
2022-11-11 19:47:37 +01:00
Jules Aguillon
4d99bd4f4b Dim secondary keys
Reduce the constrast of "secondary" labels. Modifiers (except
diacritics), event and keyevent keys are considered secondary.
2022-11-11 19:18:22 +01:00
Jules Aguillon
d644d2bf0e Disable the back-gesture on the keyboard area
as well as other system gestures that would interfere with the
keyboard's own swipe gesture.
2022-11-11 16:14:44 +01:00
Jules Aguillon
fc68f2e07d Relase 1.19.1 2022-11-11 15:51:51 +01:00
Edgars
8350efaa83 Add missing Latvian translations 2022-11-11 15:43:34 +01:00
Jules Aguillon
ef34303c7e Avoid crashing in direct-boot mode
The settings activity can't open in direct-boot mode. The emoji pane
opens without the "last used" data.
2022-11-11 15:39:28 +01:00
Jules Aguillon
f1ce6abe5a Direct-boot aware preferences
Store preferences in device protected storage, which is available before
the device is unlocked.
The keyboard was crashing when trying to access the encrypted
preferences.

The emoji pane uses a separate preferences file, the old data is lost.

The SettingsActivity can't easily use the new preferences storage.
Instead, it continues to use the "default" preferences store, which is
copied back to the protected storage when needed.
2022-11-11 14:27:02 +01:00
Jules Aguillon
29fbb27a8a Increase the targetSdkVersion to 31 2022-11-11 10:17:47 +01:00
89 changed files with 2928 additions and 1022 deletions

View File

@@ -0,0 +1,16 @@
name: Check translations
on:
workflow_dispatch:
push:
pull_request:
jobs:
check-translations:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- run: python3 sync_translations.py
- name: Check that strings files are uptodate, run python3 sync_translations.py otherwise
run: git diff --exit-code

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="27" android:versionName="1.19.0" android:hardwareAccelerated="false">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="30"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="juloo.keyboard2" android:versionCode="33" android:versionName="1.22.0" android:hardwareAccelerated="false">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="33"/>
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:hardwareAccelerated="false">
<service android:name="juloo.keyboard2.Keyboard2" android:label="@string/app_name" android:permission="android.permission.BIND_INPUT_METHOD" android:exported="true" android:directBootAware="true">
<intent-filter>
@@ -8,11 +8,17 @@
</intent-filter>
<meta-data android:name="android.view.im" android:resource="@xml/method"/>
</service>
<activity android:name="juloo.keyboard2.SettingsActivity" android:icon="@drawable/ic_launcher" android:label="@string/settings_activity_label" android:theme="@style/android:Theme.DeviceDefault">
<activity android:name="juloo.keyboard2.SettingsActivity" android:icon="@drawable/ic_launcher" android:label="@string/settings_activity_label" android:theme="@style/android:Theme.DeviceDefault" android:exported="true" android:directBootAware="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity android:name="juloo.keyboard2.LauncherActivity" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/android:Theme.DeviceDefault" android:exported="true" android:directBootAware="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

View File

@@ -5,15 +5,13 @@ A lightweight virtual keyboard for developers.
| --- | --- | --- |
| <img src="/metadata/android/en-US/images/phoneScreenshots/4.png" alt="Screenshot-4" /> | <img src="/metadata/android/en-US/images/phoneScreenshots/5.png" alt="Screenshot-5" /> | <img src="/metadata/android/en-US/images/phoneScreenshots/6.png" alt="Screenshot-6" /> |
This app is a virtual keyboard for Android. The main features are easy typing of every ASCII character using the swipe gesture, dead keys for accents and modifier keys and the presence of special keys (tab, esc, arrows, etc..).
The keyboard shows up to 4 extra characters in the corners of each key. These extra characters are hit by swiping the finger on the key.
The main feature is easy typing of more characters by swiping the keys toward the corners.
Highlight of some of the features:
- Every character and special keys that are also available on a PC keyboard. This is perfect for using applications like Termux.
- Every character and special keys of a PC keyboard. This is perfect for using applications like Termux.
- This includes Tab, Esc, the arrows and function keys, but also Ctrl and Alt !
- This includes Tab, Esc, the arrows and function keys, but also Ctrl and Alt.
- Accented keys are accessible using dead keys. First activate the accent, then type the accented letter.

View File

@@ -0,0 +1,6 @@
Updated translations: Latvian
Fix crash when typing device password
Increase target SDK version to 31
Thanks to the contributors: @eandersons

View File

@@ -0,0 +1,10 @@
New layouts: QWERTY (Polski)
Allow switching quickly between two layouts.
Allow choosing opacity of the keyboard.
Improved themes and rendering.
Updated translations.
Fixed key repeat bug when holding 3 keys.
Tweaked the swipe gesture. Added some options.
Thanks to the contributors: @9-2-1, @ChasmSolacer

View File

@@ -0,0 +1 @@
Bug fix release.

View File

@@ -0,0 +1,7 @@
New layouts: QWERTZ (Slovak)
Bugs fixed.
Updated translations.
Tweaked themes and settings.
Thanks to the contributors: Jozef Kundlak, @MAKI1LOVE

View File

@@ -0,0 +1,10 @@
New translations: Vietnamese
New layouts: Hebrew, Vietnamese
Move the cursor by sliding on the space bar.
New ePaper theme.
Added number row.
Option to switch to the previous keyboard.
Updated translations.
Thanks to the contributors: @K4zoku, @rVnPower, @RamKromberg, @MAKI1LOVE

View File

@@ -0,0 +1,7 @@
New layouts: Arabic, Devanagari
Updated translations.
Updated layouts.
Bugs fixed.
Thanks to the contributors: @ChasmSolacer, @mostafaayesh, @lrvideckis, @eandersons, @mscheidemann, @JackDotJS

View File

@@ -1,12 +1,10 @@
This app is a virtual keyboard for Android. The main features are easy typing of every ASCII character using the swipe gesture, dead keys for accents and modifier keys and the presence of special keys (tab, esc, arrows, etc..).
The keyboard shows up to 4 extra characters in the corners of each key. These extra characters are hit by swiping the finger on the key.
The main feature is easy typing of more characters by swiping the keys toward the corners.
Highlight of some of the features:
- Every character and special keys that are also available on a PC keyboard. This is perfect for using applications like Termux.
- Every character and special keys of a PC keyboard. This is perfect for using applications like Termux.
- This includes Tab, Esc, the arrows and function keys, but also Ctrl and Alt !
- This includes Tab, Esc, the arrows and function keys, but also Ctrl and Alt.
- Accented keys are accessible using dead keys. First activate the accent, then type the accented letter.

View File

@@ -1,12 +1,10 @@
Cette application est un clavier virtuel pour Android. Les fonctionnalités principales sont l'accès rapide à tous les caractères ASCII en glissant le doigt, les touches mortes pour les accents et la présence des touches spéciales (Tab, Esc, les flèches, etc..).
Il peut y avoir un caractère supplémentaire dans chaque coin de chaque touche. Ces caractères sont tapés en glissant le doigt sur la touche.
La fonctionnalité principale est l'accès rapide à plus de caractères en balayant les touches vers les coins.
Quelques fonctionnalités:
- Tous les caractères et toutes les touches spéciales d'un clavier PC. Idéal pour utiliser une application comme Termux.
- Cela comprend les touches Tab, Esc, les flèches et les touches fonctions mais aussi Ctrl et Alt !
- Cela comprend les touches Tab, Esc, les flèches et les touches fonctions mais aussi Ctrl et Alt.
- Les accents sont des touches mortes. Activez d'abord l'accent et tapez ensuite la lettre accentuée.

View File

@@ -0,0 +1,16 @@
Jej główną cechą jest łatwość wprowadzania wielu znaków poprzez przesuwanie po klawiszu do rogu.
Wyróźnione funkcjonalności:
- Wszystkie znaki i klawisze specjalne dostępne na klawiaturze komputerowej. Doskonałe do korzystania z aplikacji takich jak Termux.
- Obejmują one Tab, Esc, strzałki, klawisze funkcyjne, a także Ctrl i Alt.
- Znaki akcentowane uzyskuje się za pomocą martwych klawiszy. Najpierw naciśnij akcent, a następnie wpisz akcentowaną literę.
- Bardzo lekka i szybka. Zajmuje 500x mniej miejsca niż klawiatura Google i 15x mniej niż klawiatura domyślna. Bez reklam, bez śledzenia.
- Wiele układów: QWERTY, QWERTZ, AZERTY. Motywy: Biały, Ciemny, Czarny (OLED). Oraz wiele innych ustawień.
Tak jak każda inna klawiatura ekranowa, należy ją włączyć w ustawieniach systemowych. Otwórz Ustawienia i przejdź kolejno do:
System > Języki i metody wprowadzania > Klawiatura ekranowa > Zarządzaj klawiaturami ekranowymi.

View File

@@ -0,0 +1 @@
Lekka klawiatura wirtualna dla programistów.

View File

@@ -0,0 +1,16 @@
Главная особенность клавиатуры - это возможность легко напечатать любой ASCII символ за счет свайпов в углы клавиш.
Основные особенности:
- Есть все символы и специальные клавиши компьютерной клавиатуры. Идеально подходит для таких приложений, как Termux.
- Включены клавиши Tab, Esc, стрелки, функциональные клавиши, Ctrl и Alt.
- Клавиши с акцентами доступны с помощью мёртвых клавиш. Сначала нажмите на акцент, затем нажмите на букву с акцентом.
- Очень легкая и быстрая. Использует в 500 раз меньше места, чем Google клавиатура и в 15 раз меньше дефолтной клавиатуры. Никакой рекламы, никаких трекеров.
- Множество раскладок: QWERTY, QWERTZ, AZERTY и т.д. Темы: белая, темная. Множество других опций.
Клавиатура, как и все виртуальные клавиатуры, должна быть активирована в настройках. Откройте Настройки и перейдите:
Язык и ввод > Блок "Клавиатура" или "Способ ввода" > поставить галочку напротив Unexpected Keyboard

View File

@@ -0,0 +1 @@
Легкая виртуальная клавиатура для разработчиков.

View File

@@ -0,0 +1 @@
Unexpected Keyboard

View File

@@ -0,0 +1,16 @@
Chức năng chính là dễ dàng gõ nhiều ký tự bằng cách kéo phím về góc của nó.
Các chức năng tiêu biểu:
- Chứa tất cả ký tự và phím cơ bản lẫn đặc biệt của một cái bàn phím máy tính. Hoàn hảo cho các ứng dụng như Termux.
- Bao gồm Tab, Esc, các phím mũi tên và phím chức năng, còn có thêm Ctrl và Alt.
- Các phím có dấu phụ có thể được sử dụng qua phím liệt. Đầu tiên là bật dấu phụ, sau đó thì gõ.
- Rất nhẹ và nhanh. Nhẹ hơn bàn phím của Google 500 lần và 15 lần bàn phím mặc định. Không quảng cáo, không theo dõi.
- Nhiều bố cục phím: QWERTY, QWERTZ, AZERTY. Nhiều chủ đề: Sáng, tối, đen OLED. Với nhiều lựa chọn khác.
Như các bàn phím ảo khác, nó phải được bật trong cài đặt. Đầu tiên là vào cài đặt hệ thống và đi đến:
Hệ thống -> Ngôn ngữ và nhập liệu -> Bàn phím ảo -> Quản lý bàn phím ảo

View File

@@ -0,0 +1 @@
Bàn phím ảo gọn nhẹ cho các nhà phát triển.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:hardwareAccelerated="false">
<juloo.keyboard2.EmojiGroupButtonsBar android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:background="?attr/colorKeyboard" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height"/>
<juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height" android:orientation="vertical" android:numColumns="auto_fit" android:columnWidth="45sp" android:background="?attr/colorKeyboard"/>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" key="switch_back_emoji"/>
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" android:layout_weight="4" key="space"/>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<TextView style="@style/paragraph" android:text="@string/launcher_description"/>
<Button style="@style/paragraph" android:text="@string/launcher_button_imesettings" android:onClick="launch_imesettings" android:layout_width="wrap_content"/>
<TextView style="@style/paragraph" android:text="@string/launcher_sourcecode" android:autoLink="web"/>
<TextView android:id="@+id/launcher_tryhere_text" style="@style/paragraph" android:text="@string/launcher_tryhere"/>
<EditText android:id="@+id/launcher_tryhere_area" style="@style/paragraph" android:inputType="text"/>
</LinearLayout>

View File

@@ -3,32 +3,49 @@
<string name="app_name" product="debug">Klávesnice Unexpected (pro ladění)</string>
<string name="app_name" product="default">Klávesnice Unexpected</string>
<string name="settings_activity_label">Nastavení Klávesnice Unexpected</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">Rozvržení</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">Změnit rozvržení klávesnice</string>
<string name="pref_layout_e_system">V nastavení systému</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">(Univerzální) Diakritická znaménka</string>
<string name="pref_accents_e_all_installed">Zobrazovat znaménka pro všechny instalované systémové jazyky</string>
<string name="pref_accents_e_selected">Zobrazovat znaménka pouze pro současně zvolený jazyk</string>
<string name="pref_accents_e_none">Skrýt (univerzální) diakritická znaménka</string>
<string name="pref_autocapitalisation_title">Automatická kapitalizace</string>
<string name="pref_autocapitalisation_summary">Stiskne Shift na začátku věty</string>
<string name="pref_programming_layout_title">Rozložení klávesnice pro programování</string>
<string name="pref_programming_layout_none">Žádné</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<string name="pref_second_layout_none">Žádné</string>
<string name="pref_category_typing">Psaní</string>
<string name="pref_swipe_dist_title">Vzdálenost posunutí prstem</string>
<string name="pref_swipe_dist_summary">Jak daleko je třeba posunout prst pro napsaní znaku/diakritiky v rozích klávey (%s)</string>
<string name="pref_long_timeout_title">Časová prodleva opakování znaků</string>
<string name="pref_long_interval_title">Interval opakování znaků</string>
<string name="pref_vibrate_title">Vibrace</string>
<string name="pref_vibrate_summary">Zapnout/Vypnout vibrace při stisku klávesy</string>
<string name="pref_precise_repeat_title">Precizní posun kurzoru</string>
<string name="pref_precise_repeat_summary">Zda-li posun prstem ovlivňuje rychlost kurzoru</string>
<string name="pref_lock_double_tap_title">Dvojklik pro aktivaci caps lock(u)</string>
<string name="pref_lock_double_tap_summary">Dvojklik namísto držení modifikačních kláves po nějakou dobu</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">Automatická kapitalizace</string>
<string name="pref_autocapitalisation_summary">Stiskne Shift na začátku věty</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Vibrace</string>
<string name="pref_vibrate_summary">Zapnout/Vypnout vibrace při stisku klávesy</string>
<string name="pref_category_style">Styl</string>
<string name="pref_margin_bottom_title">Spodní odsazení</string>
<string name="pref_keyboard_height_title">Výška klávesnice</string>
<string name="pref_keyboard_height_landscape_title">Výška klávesnice v režimu na šířku</string>
<string name="pref_horizontal_margin_title">Boční odsazení</string>
<string name="pref_character_size_title">Velikost znaků</string>
<string name="pref_character_size_summary">Velikost znaků zobrazených na klávesnici (%.2fx)</string>
@@ -37,6 +54,9 @@
<string name="pref_theme_e_dark">Tmavý</string>
<string name="pref_theme_e_light">Světlý</string>
<string name="pref_theme_e_black">Černý</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Velmi krátká</string>
<string name="pref_swipe_dist_e_short">Krátká</string>
<string name="pref_swipe_dist_e_default">Běžná</string>
@@ -44,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Velmi dlouhá</string>
<string name="pref_key_horizontal_space">Horizontální mezery mezi klávesami</string>
<string name="pref_key_vertical_space">Vertikální mezery mezi klávesami</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">Další</string>
<string name="key_action_done">Dokončit</string>
<string name="key_action_go">Spustit</string>
<string name="key_action_prev">Předchozí</string>
<string name="key_action_search">Hledat</string>
<string name="key_action_send">Odeslat</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -3,9 +3,16 @@
<string name="app_name" product="debug">Unexpected Keyboard (Debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard - Einstellungen</string>
<string name="pref_portrait">Im Hochformatmodus</string>
<string name="pref_landscape">Im Querformatmodus</string>
<string name="pref_category_layout">Layout</string>
<string name="pref_label_brightness">Helligkeit der Beschriftung anpassen</string>
<string name="pref_keyboard_opacity">Deckkraft des Tastaturhintergrunds anpassen</string>
<string name="pref_key_opacity">Deckkraft der Tasten anpassen</string>
<string name="pref_key_activated_opacity">Deckkraft gedrückter Tasten anpassen</string>
<string name="pref_layout_title">Tastaturlayout ändern</string>
<string name="pref_layout_e_system">Systemeinstellung</string>
<string name="pref_layout_e_custom">Eigenes Layout</string>
<string name="pref_accents_title">Akzente</string>
<string name="pref_accents_e_all_installed">Akzente für alle installierten Sprachen anzeigen</string>
<string name="pref_accents_e_selected">Akzente nur für die gewählte Sprache anzeigen</string>
@@ -14,35 +21,42 @@
<string name="pref_show_numpad_never">Nie</string>
<string name="pref_show_numpad_landscape">Nur im Querformat</string>
<string name="pref_show_numpad_always">Immer</string>
<string name="pref_programming_layout_title">Tastaturlayout zum Programmieren</string>
<string name="pref_number_row_title">Zahlenreihe anzeigen</string>
<string name="pref_number_row_summary">Eine Zahlenreihe oben an der Tastatur hinzufügen, wenn der Ziffernblock ausgeblendet ist</string>
<string name="pref_numpad_layout">Zahlenblock-Layout</string>
<string name="pref_numpad_layout_e_high_first">Hohe Ziffern zuerst</string>
<string name="pref_numpad_layout_e_low_first">Niedrige Ziffern zuerst</string>
<string name="pref_extra_keys_title">Zusätzliche Zeichen zur Tastatur hinzufügen</string>
<string name="pref_programming_layout_none">Keines</string>
<string name="pref_second_layout_title">Zweites Layout</string>
<string name="pref_second_layout_none">Keines</string>
<string name="pref_category_typing">Tippen</string>
<string name="pref_autocapitalisation_title">Automatische Großschreibung</string>
<string name="pref_autocapitalisation_summary">Shift-Taste am Satzanfang aktivieren</string>
<string name="pref_swipe_dist_title">Länge der Wischgeste</string>
<string name="pref_swipe_dist_summary">Abstand der Zeichen in den Ecken der Tasten (%s)</string>
<string name="pref_long_timeout_title">Zeitüberschreitung bei Tastenwiederholung</string>
<string name="pref_long_interval_title">Intervall der Tastenwiederholung</string>
<string name="pref_vibrate_title">Vibration</string>
<string name="pref_vibrate_summary">Vibration bei Tastendruck ein-/ausschalten</string>
<string name="pref_precise_repeat_title">Präzise Cursorsteuerung</string>
<string name="pref_precise_repeat_summary">Geschwindigkeit der Tastenwiederholung durch weniger oder mehr Wischen anpassen</string>
<string name="pref_lock_double_tap_title">Umschalttaste mit Doppeltippen einrasten</string>
<string name="pref_lock_double_tap_summary">Anstatt Taste längere Zeit gedrückt zu halten</string>
<string name="pref_category_behavior">Verhalten</string>
<string name="pref_autocapitalisation_title">Automatische Großschreibung</string>
<string name="pref_autocapitalisation_summary">Umschalttaste am Satzanfang aktivieren</string>
<string name="pref_switch_input_immediate_title">Sofort zur nächsten Tastatur wechseln</string>
<string name="pref_switch_input_immediate_summary">Verhalten der Tastaturumschalttaste</string>
<string name="pref_vibrate_title">Vibration</string>
<string name="pref_vibrate_summary">Vibration bei Tastendruck ein-/ausschalten</string>
<string name="pref_category_style">Design</string>
<string name="pref_margin_bottom_title">Unterer Abstand</string>
<string name="pref_keyboard_height_title">Höhe der Tastatur</string>
<string name="pref_keyboard_height_landscape_title">Höhe der Tastatur im Querformat</string>
<string name="pref_horizontal_margin_title">Horizontaler Abstand</string>
<string name="pref_character_size_title">Größe der Beschriftung</string>
<string name="pref_character_size_title">Größe der Beschriftung</string>
<string name="pref_character_size_summary">Größe der Buchstaben auf den Tasten (%.2fx)</string>
<string name="pref_theme">Theme</string>
<string name="pref_theme">Thema</string>
<string name="pref_theme_e_system">Systemeinstellung</string>
<string name="pref_theme_e_dark">Dunkel</string>
<string name="pref_theme_e_light">Hell</string>
<string name="pref_theme_e_black">Schwarz</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<string name="pref_theme_e_white">Weiß</string>
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_swipe_dist_e_very_short">Sehr kurz</string>
<string name="pref_swipe_dist_e_short">Kurz</string>
<string name="pref_swipe_dist_e_default">Normal</string>
@@ -50,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Sehr weit</string>
<string name="pref_key_horizontal_space">Horizontaler Abstand zwischen den Tasten</string>
<string name="pref_key_vertical_space">Vertikaler Abstand zwischen den Tasten</string>
<string name="pref_category_advanced">Erweitert</string>
<string name="pref_custom_layout_title">Eigenes Layout</string>
<string name="pref_custom_layout_summary">Bitte Sourcecode ansehen. Diese Option ist nicht zur Verwendung vorgesehen.</string>
<string name="key_action_next">Nächstes</string>
<string name="key_action_done">Fertig</string>
<string name="key_action_go">Los</string>
<string name="key_action_prev">Vorheriges</string>
<string name="key_action_search">Suchen</string>
<string name="key_action_send">Senden</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,22 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- <string name="app_name" product="debug">Unexpected Keyboard (debug)</string> -->
<!-- <string name="app_name" product="default">Unexpected Keyboard</string> -->
<string name="settings_activity_label">Ajustes de Unexpected Keyboard</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">Formato</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">Cambiar formato de teclado</string>
<string name="pref_layout_e_system">Ajustes del sistema</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">Acentos</string>
<string name="pref_accents_e_all_installed">Mostrar acentos para todos los lenguajes instalados</string>
<string name="pref_accents_e_selected">Solo mostrar acentos para el lenguaje seleccionado</string>
<string name="pref_accents_e_none">Ocultar acentos</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<!-- <string name="pref_second_layout_none">None</string> -->
<string name="pref_category_typing">Escribiendo</string>
<string name="pref_swipe_dist_title">Distancia para deslizar</string>
<string name="pref_swipe_dist_summary">Distancia de caracteres en las esquinas de las letras (%s)</string>
<string name="pref_long_timeout_title">Tiempo de espera de repetición de tecla</string>
<string name="pref_long_interval_title">Intervalo de repetición de tecla</string>
<!-- <string name="pref_lock_double_tap_title">Double tap on shift for caps lock</string> -->
<!-- <string name="pref_lock_double_tap_summary">You can lock any modifier by holding it</string> -->
<!-- <string name="pref_category_behavior">Behavior</string> -->
<!-- <string name="pref_autocapitalisation_title">Automatic capitalisation</string> -->
<!-- <string name="pref_autocapitalisation_summary">Press Shift at the beginning of a sentence</string> -->
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Vibración</string>
<string name="pref_vibrate_summary">Habilitar/deshabilitar vibración al presionar una tecla</string>
<string name="pref_precise_repeat_title">Movimientos de cursor preciso</string>
<string name="pref_precise_repeat_summary">Modular la velocidad de repetición de teclas según si se desliza más o menos</string>
<string name="pref_category_style">Estilo</string>
<string name="pref_margin_bottom_title">Margen del pie</string>
<string name="pref_keyboard_height_title">Altura del teclado</string>
@@ -28,6 +54,9 @@
<string name="pref_theme_e_dark">Oscuro</string>
<string name="pref_theme_e_light">Claro</string>
<string name="pref_theme_e_black">Negro</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Muy corto</string>
<string name="pref_swipe_dist_e_short">Corto</string>
<string name="pref_swipe_dist_e_default">Normal</string>
@@ -35,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Muy lejano</string>
<string name="pref_key_horizontal_space">Espaciado horizontal entre las teclas</string>
<string name="pref_key_vertical_space">Espaciado vertical entre las teclas</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">Siguiente</string>
<string name="key_action_done">Hecho</string>
<string name="key_action_go">Ir</string>
<string name="key_action_prev">Anterior</string>
<string name="key_action_search">Buscar</string>
<string name="key_action_send">Enviar</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,9 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard Paramètres</string>
<string name="pref_portrait">En mode portrait</string>
<string name="pref_landscape">En mode landscape</string>
<string name="pref_category_layout">Disposition</string>
<string name="pref_label_brightness">Luminosité des symboles</string>
<string name="pref_keyboard_opacity">Transparence du clavier</string>
<string name="pref_key_opacity">Transparence des touches</string>
<string name="pref_key_activated_opacity">Transparence des touches pressées</string>
<string name="pref_layout_title">Disposition des touches</string>
<string name="pref_layout_e_system">Paramètre système</string>
<string name="pref_layout_e_custom">Disposition personnalisée</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>
@@ -12,30 +21,42 @@
<string name="pref_show_numpad_never">Jamais</string>
<string name="pref_show_numpad_landscape">Seulement en mode paysage</string>
<string name="pref_show_numpad_always">Toujour</string>
<string name="pref_autocapitalisation_title">Majuscule automatique</string>
<string name="pref_autocapitalisation_summary">Active Shift au début des phrases</string>
<string name="pref_number_row_title">Rangée de nombres</string>
<string name="pref_number_row_summary">Ajoute une rangée de nombres en haut du clavier quand le pavé numérique est caché</string>
<string name="pref_numpad_layout">Disposition du pavé numérique</string>
<string name="pref_numpad_layout_e_high_first">Du plus haut au plus bas</string>
<string name="pref_numpad_layout_e_low_first">Du plus bas au plus haut</string>
<string name="pref_extra_keys_title">Ajouter des touches au clavier</string>
<string name="pref_second_layout_title">Disposition secondaire</string>
<string name="pref_second_layout_none">Aucune</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_long_interval_title">Écart entre les répétitions</string>
<string name="pref_lock_double_tap_title">Appuyer deux fois pour bloquer la majuscule</string>
<string name="pref_lock_double_tap_summary">Un appui long bloque la majuscule</string>
<string name="pref_category_behavior">Comportement</string>
<string name="pref_autocapitalisation_title">Majuscule automatique</string>
<string name="pref_autocapitalisation_summary">Activer Shift au début des phrases</string>
<string name="pref_switch_input_immediate_title">Changer vers le clavier utilisé en dernier</string>
<string name="pref_switch_input_immediate_summary">Comportement de la touche de changement de clavier</string>
<string name="pref_vibrate_title">Vibreur</string>
<string name="pref_vibrate_summary">Vibration a chaque touche</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_keyboard_height_title">Hauteur du clavier</string>
<string name="pref_keyboard_height_landscape_title">Hauteur du clavier en mode paysage</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_title">Taille des symboles</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_theme_e_altblack">Alternative Black</string> -->
<string name="pref_theme_e_white">Blanc</string>
<!-- <string name="pref_theme_e_epaper">ePaper</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>
@@ -43,10 +64,17 @@
<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="pref_category_advanced">Avancé</string>
<string name="pref_custom_layout_title">Disposition personnalisée</string>
<string name="pref_custom_layout_summary">Cette option n\'est pas faite pour être utilisée.</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>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -3,32 +3,49 @@
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Impostazioni di Unexpected Keyboard</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">Layout</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">Cambia layout tastiera</string>
<string name="pref_layout_e_system">Impostazioni di sistema</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">Accenti</string>
<string name="pref_accents_e_all_installed">Mostra accenti per tutte le lingue installate</string>
<string name="pref_accents_e_selected">Mostra accenti solo per le lingue selezionate</string>
<string name="pref_accents_e_none">Nascondi accenti</string>
<string name="pref_autocapitalisation_title">Maiuscole Automatiche</string>
<string name="pref_autocapitalisation_summary">Premi Shift all\'inizio di una frase</string>
<string name="pref_programming_layout_title">Layout tastiera per programmare</string>
<string name="pref_programming_layout_none">Nessuno</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<string name="pref_second_layout_none">Nessuno</string>
<string name="pref_category_typing">Digitando</string>
<string name="pref_swipe_dist_title">Distanza swipe</string>
<string name="pref_swipe_dist_summary">Distanza dei caratteri negli angoli dei tasti (%s)</string>
<string name="pref_long_timeout_title">Timeout ripetizione tasto</string>
<string name="pref_long_interval_title">Intervallo ripetizione tasto</string>
<string name="pref_vibrate_title">Vibrazione</string>
<string name="pref_vibrate_summary">Abilita/Disabilita Vibrazione alla pressione dei tasti</string>
<string name="pref_precise_repeat_title">Movimento puntatore preciso</string>
<string name="pref_precise_repeat_summary">Modula la veocità della ripetizione con lo swipe</string>
<string name="pref_lock_double_tap_title">Doppio tocco su Shift per attivare CapsLock</string>
<string name="pref_lock_double_tap_summary">Invece di premere i modificatori a lungo</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">Maiuscole Automatiche</string>
<string name="pref_autocapitalisation_summary">Premi Shift all\'inizio di una frase</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Vibrazione</string>
<string name="pref_vibrate_summary">Abilita/Disabilita Vibrazione alla pressione dei tasti</string>
<string name="pref_category_style">Stile</string>
<string name="pref_margin_bottom_title">Margine inferiore</string>
<string name="pref_keyboard_height_title">Altezza tastiera</string>
<string name="pref_keyboard_height_landscape_title">Altezza tastiera in modalità orizzontale</string>
<string name="pref_horizontal_margin_title">Margine orizzontale</string>
<string name="pref_character_size_title">Dimensione Caratteri</string>
<string name="pref_character_size_summary">Dimensione dei caratteri mostrati sulla tastiera (%.2fx)</string>
@@ -37,6 +54,9 @@
<string name="pref_theme_e_dark">Scuro</string>
<string name="pref_theme_e_light">Chiaro</string>
<string name="pref_theme_e_black">Nero</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Veramente breve</string>
<string name="pref_swipe_dist_e_short">Breve</string>
<string name="pref_swipe_dist_e_default">Normale</string>
@@ -44,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Molto distante</string>
<string name="pref_key_horizontal_space">Spazio orizzontale tra i tasti</string>
<string name="pref_key_vertical_space">Spazio verticale tra i tasti</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">Prossimo</string>
<string name="key_action_done">Fatto</string>
<string name="key_action_go">Vai</string>
<string name="key_action_prev">Precedente</string>
<string name="key_action_search">Cerca</string>
<string name="key_action_send">Invia</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,22 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- <string name="app_name" product="debug">Unexpected Keyboard (debug)</string> -->
<!-- <string name="app_name" product="default">Unexpected Keyboard</string> -->
<string name="settings_activity_label">Unexpected Keyboard 설정</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">레이아웃</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">키보드 레이아웃 변경</string>
<string name="pref_layout_e_system">시스템 세팅</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">악센트</string>
<string name="pref_accents_e_all_installed">설치된 모든 언어의 악센트 표시</string>
<string name="pref_accents_e_selected">선택한 언어의 악센트만 표시</string>
<string name="pref_accents_e_none">모든 언어의 악센트 숨기기</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<!-- <string name="pref_second_layout_none">None</string> -->
<string name="pref_category_typing">타자</string>
<string name="pref_swipe_dist_title">스와이프 범위</string>
<string name="pref_swipe_dist_summary">키 모서리 문자의 입력 범위 (%s)</string>
<string name="pref_long_timeout_title">키 길게 누르기 지연</string>
<string name="pref_long_interval_title">키 반복 간격</string>
<!-- <string name="pref_lock_double_tap_title">Double tap on shift for caps lock</string> -->
<!-- <string name="pref_lock_double_tap_summary">You can lock any modifier by holding it</string> -->
<!-- <string name="pref_category_behavior">Behavior</string> -->
<!-- <string name="pref_autocapitalisation_title">Automatic capitalisation</string> -->
<!-- <string name="pref_autocapitalisation_summary">Press Shift at the beginning of a sentence</string> -->
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">진동</string>
<string name="pref_vibrate_summary">키 누를 때 진동 키거/끄기</string>
<string name="pref_precise_repeat_title">정확한 커서 움직임</string>
<string name="pref_precise_repeat_summary">더 많거나 적은 스와이프로 키 반복 조절</string>
<string name="pref_category_style">스타일</string>
<string name="pref_margin_bottom_title">아래 넓이</string>
<string name="pref_keyboard_height_title">키보드 높이</string>
@@ -28,6 +54,9 @@
<string name="pref_theme_e_dark">Dark</string>
<string name="pref_theme_e_light">Light</string>
<string name="pref_theme_e_black">Black</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">매우 짧음</string>
<string name="pref_swipe_dist_e_short">짧음</string>
<string name="pref_swipe_dist_e_default">보통</string>
@@ -35,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">매우 넓음</string>
<string name="pref_key_horizontal_space">키보드 양 옆 간격</string>
<string name="pref_key_vertical_space">키보드 세로 간격</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">다음</string>
<string name="key_action_done">확인</string>
<string name="key_action_go">Go</string>
<string name="key_action_prev">이전</string>
<string name="key_action_search">검색</string>
<string name="key_action_send">보내기</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="horizontal_margin">28dp</dimen>
<dimen name="margin_bottom">3dp</dimen>
<dimen name="emoji_type_button_height">48dp</dimen>
<dimen name="extra_horizontal_margin">25dp</dimen>
</resources>

View File

@@ -3,33 +3,49 @@
<string name="app_name" product="debug">Unexpected Keyboard (atkļūdošana)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard iestatījumi</string>
<string name="pref_portrait">Stateniski</string>
<string name="pref_landscape">Guleniski</string>
<string name="pref_category_layout">Izkārtojums</string>
<string name="pref_label_brightness">Pielāgot iezīmju spilgtumu</string>
<string name="pref_keyboard_opacity">Pielāgot tastatūras fona necaurredzamību</string>
<string name="pref_key_opacity">Pielāgot taustiņu necaurredzamību</string>
<string name="pref_key_activated_opacity">Pielāgot piespiesta taustiņa necaurredzamību</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_layout_e_custom">Pielāgots izkārtojums</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_none">Paslēpt uzsvara zīmes</string>
<string name="pref_autocapitalisation_title">Automātiski lielie burti</string>
<string name="pref_autocapitalisation_summary">Piespiest Shift teikuma sākumā</string>
<string name="pref_show_numpad_title">Rādīt ciparnīcu</string>
<string name="pref_show_numpad_never">Nekad</string>
<string name="pref_show_numpad_landscape">Tikai guleniskajā skatā</string>
<string name="pref_show_numpad_always">Vienmēr</string>
<string name="pref_number_row_title">Rādīt ciparu rindu</string>
<string name="pref_number_row_summary">Pievienot ciparu rindu virs tastatūras, kad ciparnīca ir paslēpta</string>
<string name="pref_numpad_layout">Ciparnīcas izkārtojums</string>
<string name="pref_numpad_layout_e_high_first">Vispirms lielākie cipari</string>
<string name="pref_numpad_layout_e_low_first">Vispirms mazākie cipari</string>
<string name="pref_extra_keys_title">Pievienot tastatūrai taustiņus</string>
<string name="pref_programming_layout_title">Tastatūras izkārtojums programmēšanai</string>
<string name="pref_programming_layout_none">Neviens</string>
<string name="pref_second_layout_title">Otrējais izkārtojums</string>
<string name="pref_second_layout_none">Neviens</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_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_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_lock_double_tap_title">Divkāršs piesitiens burtslēgam</string>
<string name="pref_lock_double_tap_summary">Tā vietā, lai ilstoši piespiestu pārveidotāju</string>
<string name="pref_category_behavior">Uzvedība</string>
<string name="pref_autocapitalisation_title">Automātiski lielie burti</string>
<string name="pref_autocapitalisation_summary">Piespiest Shift teikuma sākumā</string>
<string name="pref_switch_input_immediate_title">Pārslēgties uz pēdējo izmantoto tastatūru</string>
<string name="pref_switch_input_immediate_summary">Tastatūras pārslēgšanas taustiņa uzvedība</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_category_style">Izskata pielāgojumi</string>
<string name="pref_margin_bottom_title">Apakšējā apmale</string>
<string name="pref_keyboard_height_title">Tastatūras augstums</string>
<string name="pref_keyboard_height_landscape_title">Tastatūras augstums guleniski</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>
@@ -38,6 +54,9 @@
<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_theme_e_altblack">Citādi melns</string>
<string name="pref_theme_e_white">Balts</string>
<string name="pref_theme_e_epaper">ePapīrs</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>
@@ -45,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Ļoti tāls</string>
<string name="pref_key_horizontal_space">Līmeniskais attālums starp taustiņiem</string>
<string name="pref_key_vertical_space">Stateniskais attālums starp taustiņiem</string>
<string name="pref_category_advanced">Papildu</string>
<string name="pref_custom_layout_title">Pielāgots izkārtojums</string>
<string name="pref_custom_layout_summary">Skatīt pirmkodu. Šī iespēja nav paredzēta izmantošanai.</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>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

80
res/values-pl/strings.xml Normal file
View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Ustawienia Unexpected Keyboard</string>
<string name="pref_portrait">W widoku pionowym</string>
<string name="pref_landscape">W widoku poziomym</string>
<string name="pref_category_layout">Układ</string>
<string name="pref_label_brightness">Dostosuj jasność znaków</string>
<string name="pref_keyboard_opacity">Nieprzezroczystość tła klawiatury</string>
<string name="pref_key_opacity">Nieprzezroczystość klawisza</string>
<string name="pref_key_activated_opacity">Nieprzezroczystość naciśniętego klawisza</string>
<string name="pref_layout_title">Zmień układ klawiatury</string>
<string name="pref_layout_e_system">Systemowy</string>
<string name="pref_layout_e_custom">Własny układ</string>
<string name="pref_accents_title">Znaki diakrytyczne</string>
<string name="pref_accents_e_all_installed">Pokaż znaki diakryt. dla wszystkich zainstalowanych języków</string>
<string name="pref_accents_e_selected">Pokaż znaki diakryt. tylko dla wybranego języka</string>
<string name="pref_accents_e_none">Ukryj znaki diakrytyczne</string>
<string name="pref_show_numpad_title">Pokaż klawiaturę numeryczną</string>
<string name="pref_show_numpad_never">Nigdy</string>
<string name="pref_show_numpad_landscape">Tylko w orientacji poziomej</string>
<string name="pref_show_numpad_always">Zawsze</string>
<string name="pref_number_row_title">Pokaż rząd cyfr</string>
<string name="pref_number_row_summary">Dodaj rząd cyfr na górze klawiatury, kiedy klaw. numeryczna jest schowana</string>
<string name="pref_numpad_layout">Układ klawiatury numerycznej</string>
<string name="pref_numpad_layout_e_high_first">Od największej cyfry</string>
<string name="pref_numpad_layout_e_low_first">Od najmniejszej cyfry</string>
<string name="pref_extra_keys_title">Dodaj klawisze do klawiatury</string>
<string name="pref_second_layout_title">Drugi układ</string>
<string name="pref_second_layout_none">Żaden</string>
<string name="pref_category_typing">Pisanie</string>
<string name="pref_swipe_dist_title">Odległość przesuwania</string>
<string name="pref_swipe_dist_summary">Odległość znaków od rogów klawiszy (%s)</string>
<string name="pref_long_timeout_title">Opóźnienie powtarzania naciśnięć klawisza</string>
<string name="pref_long_interval_title">Czas pomiędzy powtórzeniami</string>
<string name="pref_lock_double_tap_title">Naciśnij Shift podwójnie, aby włączyć caps lock</string>
<string name="pref_lock_double_tap_summary">Możesz zablokować modyfikator poprzez jego długie naciśnięcie</string>
<string name="pref_category_behavior">Zachowanie</string>
<string name="pref_autocapitalisation_title">Automatyczne wielkie litery</string>
<string name="pref_autocapitalisation_summary">Naciśnij Shift na początku zdania</string>
<string name="pref_switch_input_immediate_title">Przełącz na ostatnio używaną klawiaturę</string>
<string name="pref_switch_input_immediate_summary">Działanie klawisza przełączającego klawiaturę</string>
<string name="pref_vibrate_title">Wibracja</string>
<string name="pref_vibrate_summary">Wł./wył. wibrację przy naciśnięciu klawisza</string>
<string name="pref_category_style">Styl</string>
<string name="pref_margin_bottom_title">Margines dolny</string>
<string name="pref_keyboard_height_title">Wysokość klawiatury</string>
<string name="pref_horizontal_margin_title">Margines poziomy</string>
<string name="pref_character_size_title">Wielkość znaku</string>
<string name="pref_character_size_summary">Wielkość znaków widocznych na klawiaturze (%.2fx)</string>
<string name="pref_theme">Motyw</string>
<string name="pref_theme_e_system">Systemowy</string>
<string name="pref_theme_e_dark">Ciemny</string>
<string name="pref_theme_e_light">Jasny</string>
<string name="pref_theme_e_black">Czarny</string>
<string name="pref_theme_e_altblack">Alternatywny Czarny</string>
<string name="pref_theme_e_white">Biały</string>
<string name="pref_theme_e_epaper">e-paper</string>
<string name="pref_swipe_dist_e_very_short">Bardzo mała</string>
<string name="pref_swipe_dist_e_short">Mała</string>
<string name="pref_swipe_dist_e_default">Normalna</string>
<string name="pref_swipe_dist_e_far">Duża</string>
<string name="pref_swipe_dist_e_very_far">Bardzo duża</string>
<string name="pref_key_horizontal_space">Odległość pomiędzy klawiszami w poziomie</string>
<string name="pref_key_vertical_space">Odległość pomiędzy klawiszami w pionie</string>
<string name="pref_category_advanced">Zaawansowane</string>
<string name="pref_custom_layout_title">Własny układ</string>
<string name="pref_custom_layout_summary">Zobacz kod źródłowy. Ta opcja nie jest przeznaczona do użycia.</string>
<string name="key_action_next">Dalej</string>
<string name="key_action_done">OK</string>
<string name="key_action_go">Przejdź</string>
<string name="key_action_prev">Wstecz</string>
<string name="key_action_search">Szukaj</string>
<string name="key_action_send">Wyślij</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -3,32 +3,49 @@
<string name="app_name" product="debug">Teclado Unexpected</string>
<string name="app_name" product="default">Teclado Unexpected</string>
<string name="settings_activity_label">Configurar Teclado Unexpected</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">Layout</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">Mudar layout do teclado</string>
<string name="pref_layout_e_system">Mesmo do sistema</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">Acentos</string>
<string name="pref_accents_e_all_installed">Mostrar acentos para todos os idiomas instalados</string>
<string name="pref_accents_e_selected">Mostrar acentos só para o idioma selecionado</string>
<string name="pref_accents_e_none">Ocultar acentos</string>
<string name="pref_autocapitalisation_title">Maiusculização automática</string>
<string name="pref_autocapitalisation_summary">Aciona o shift no início de cada frase</string>
<string name="pref_programming_layout_title">Layout do teclado para programação</string>
<string name="pref_programming_layout_none">Nenhum</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<string name="pref_second_layout_none">Nenhum</string>
<string name="pref_category_typing">Digitação</string>
<string name="pref_swipe_dist_title">Distância a deslizar</string>
<string name="pref_swipe_dist_summary">Distância até acionar os cantos das teclas (%s)</string>
<string name="pref_long_timeout_title">Tempo até repetir tecla</string>
<string name="pref_long_interval_title">Intervalo de repetição de tecla</string>
<string name="pref_vibrate_title">Vibração</string>
<string name="pref_vibrate_summary">Ativar/desativar vibração ao digitar</string>
<string name="pref_precise_repeat_title">Precisão nos movimentos do cursor</string>
<string name="pref_precise_repeat_summary">Varia a velocidade de repetição a depender do quanto deslizar</string>
<string name="pref_lock_double_tap_title">Tecle duas vezes no shift para caixa alta</string>
<string name="pref_lock_double_tap_summary">Ao invés de apertar e segurar por um tempo</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">Maiusculização automática</string>
<string name="pref_autocapitalisation_summary">Aciona o shift no início de cada frase</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Vibração</string>
<string name="pref_vibrate_summary">Ativar/desativar vibração ao digitar</string>
<string name="pref_category_style">Estilo</string>
<string name="pref_margin_bottom_title">Margem inferior</string>
<string name="pref_keyboard_height_title">Altura do teclado</string>
<string name="pref_keyboard_height_landscape_title">Altura do teclado em modo paisagem</string>
<string name="pref_horizontal_margin_title">Margem horizontal</string>
<string name="pref_character_size_title">Tamanho dos indicadores</string>
<string name="pref_character_size_summary">Tamanho dos caracteres visíveis no teclado (%.2fx)</string>
@@ -37,6 +54,9 @@
<string name="pref_theme_e_dark">Escuro</string>
<string name="pref_theme_e_light">Claro</string>
<string name="pref_theme_e_black">Preto</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Muito curto</string>
<string name="pref_swipe_dist_e_short">Curto</string>
<string name="pref_swipe_dist_e_default">Normal</string>
@@ -44,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Muito longo</string>
<string name="pref_key_horizontal_space">Distância horizontal entre teclas</string>
<string name="pref_key_vertical_space">Distância vertical entre teclas</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">Próximo</string>
<string name="key_action_done">Pronto</string>
<string name="key_action_go">Ir</string>
<string name="key_action_prev">Anterior</string>
<string name="key_action_search">Buscar</string>
<string name="key_action_send">Enviar</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,48 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Unexpected Keyboard</string>
<string name="app_name" product="debug">Unexpected Keyboard (отладка)</string>
<!-- <string name="app_name" product="default">Unexpected Keyboard</string> -->
<string name="settings_activity_label">Unexpected Keyboard Настройки</string>
<string name="pref_portrait">В портретном режиме</string>
<string name="pref_landscape">В ландшафтном режиме</string>
<string name="pref_category_layout">Расположение</string>
<string name="pref_label_brightness">Изменить яркость клавиатуры</string>
<string name="pref_keyboard_opacity">Изменить прозрачность фона</string>
<string name="pref_key_opacity">Изменить прозрачность клавиш</string>
<string name="pref_key_activated_opacity">Изменить прозрачность нажатой клавиши</string>
<string name="pref_layout_title">Изменить раскладку клавиатуры</string>
<string name="pref_layout_e_system">Системные настройки</string>
<string name="pref_layout_e_custom">Пользовательская раскладка</string>
<string name="pref_accents_title">Акцент</string>
<string name="pref_accents_e_all_installed">Показывать акценты для всех установленных языков</string>
<string name="pref_accents_e_selected">Показывать акценты только для выбранного языка</string>
<string name="pref_accents_e_none">Скрыть акценты</string>
<string name="pref_programming_layout_title">Раскладка клавиатуры для программирования</string>
<string name="pref_programming_layout_none">Нету</string>
<string name="pref_category_typing">Печатание</string>
<string name="pref_show_numpad_title">Показывать NumPad</string>
<string name="pref_show_numpad_never">Никогда</string>
<string name="pref_show_numpad_landscape">Только в ландшафтном режиме</string>
<string name="pref_show_numpad_always">Всегда</string>
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<string name="pref_numpad_layout">NumPad раскладка</string>
<string name="pref_numpad_layout_e_high_first">Старшие цифры сверху</string>
<string name="pref_numpad_layout_e_low_first">Младшие цифры сверху</string>
<string name="pref_extra_keys_title">Добавить клавиши на клавиатуру</string>
<string name="pref_second_layout_title">Дополнительная раскладка</string>
<string name="pref_second_layout_none">Нет</string>
<string name="pref_category_typing">Печать</string>
<string name="pref_swipe_dist_title">Расстояние пролистывания</string>
<string name="pref_swipe_dist_summary">Расстояние между символами в углах клавиш (%s)</string>
<string name="pref_long_timeout_title">Тайм-аут повтора ключа</string>
<string name="pref_long_interval_title">Интервал повторения клавиш</string>
<string name="pref_long_timeout_title">Тайм-аут повтора клавиш</string>
<string name="pref_long_interval_title">Интервал повтора клавиш</string>
<string name="pref_lock_double_tap_title">Двойное нажатие на Shift активирует Caps lock</string>
<string name="pref_lock_double_tap_summary">Вы можете активировать модификатор, удерживая клавишу</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">Автоматическая смена регистра</string>
<string name="pref_autocapitalisation_summary">Автонажатие Shift в начале каждого предложения</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Вибрация</string>
<string name="pref_vibrate_summary">Включение/выключение вибрации при нажатии клавиши</string>
<string name="pref_precise_repeat_title">Точные перемещения курсора</string>
<string name="pref_precise_repeat_summary">Модулируйте скорость повторения клавиш, проводя пальцем больше или меньше</string>
<string name="pref_category_style">Стиль</string>
<string name="pref_margin_bottom_title">Нижняя граница поля</string>
<string name="pref_keyboard_height_title">Высота клавиатуры</string>
<string name="pref_keyboard_height_landscape_title">Высота клавиатуры в ландшафтном режиме</string>
<string name="pref_horizontal_margin_title">Горизонтальное поле</string>
<string name="pref_character_size_title">Размер этикетки</string>
<string name="pref_character_size_title">Размер символов</string>
<string name="pref_character_size_summary">Размер символов, отображаемых на клавиатуре (%.2fx)</string>
<string name="pref_theme">Тема</string>
<string name="pref_theme_e_system">Системные настройки</string>
<string name="pref_theme_e_dark">Темный</string>
<string name="pref_theme_e_light">Светлый</string>
<string name="pref_theme_e_black">Черный</string>
<string name="pref_swipe_dist_e_very_short">Очень короткий</string>
<string name="pref_swipe_dist_e_short">Короткий</string>
<string name="pref_swipe_dist_e_default">Обычный</string>
<string name="pref_swipe_dist_e_far">Far</string>
<string name="pref_theme_e_dark">Темная</string>
<string name="pref_theme_e_light">Светлая</string>
<string name="pref_theme_e_black">Черная</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<string name="pref_theme_e_white">Белая</string>
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Очень близко</string>
<string name="pref_swipe_dist_e_short">Близко</string>
<string name="pref_swipe_dist_e_default">Нормально</string>
<string name="pref_swipe_dist_e_far">Далеко</string>
<string name="pref_swipe_dist_e_very_far">Очень далеко</string>
<string name="pref_key_horizontal_space">Горизонтальное расстояние между клавишами</string>
<string name="pref_key_vertical_space">Расстояние по вертикали между клавишами</string>
<string name="key_action_next">Next</string>
<string name="pref_category_advanced">Расширенные настройки</string>
<string name="pref_custom_layout_title">Пользовательская раскладка</string>
<string name="pref_custom_layout_summary">Откройте исходный код. Эта параметр не предназначен для использования.</string>
<string name="key_action_next">Далее</string>
<string name="key_action_done">Ввод</string>
<string name="key_action_go">Go</string>
<string name="key_action_prev">Предыдущий</string>
<string name="key_action_search">Поиск</string>
<string name="key_action_send">Отправить</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -3,24 +3,46 @@
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard Ayarları</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">Düzen</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> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">Klavye Düzenini Değiştir</string>
<string name="pref_layout_e_system">Sistem Ayarları</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">Aksanlar</string>
<string name="pref_accents_e_all_installed">Yüklü tüm dillerin aksanlarını göster</string>
<string name="pref_accents_e_selected">Sadece seçili dilin aksanlarını göster</string>
<string name="pref_accents_e_none">Aksanları gizle</string>
<string name="pref_programming_layout_title">Programlama için klavye düzeni</string>
<string name="pref_programming_layout_none">Hiçbiri</string>
<!-- <string name="pref_show_numpad_title">Show NumPad</string> -->
<!-- <string name="pref_show_numpad_never">Never</string> -->
<!-- <string name="pref_show_numpad_landscape">Only in landscape mode</string> -->
<!-- <string name="pref_show_numpad_always">Always</string> -->
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<!-- <string name="pref_extra_keys_title">Add keys to the keyboard</string> -->
<!-- <string name="pref_second_layout_title">Secondary layout</string> -->
<string name="pref_second_layout_none">Hiçbiri</string>
<string name="pref_category_typing">Yazma</string>
<string name="pref_swipe_dist_title">Kaydırma mesafesi</string>
<string name="pref_swipe_dist_summary">Tuşların köşelerindeki karakterlerin uzaklıkları (%s)</string>
<string name="pref_long_timeout_title">Tuş tekrarlama beklemesi</string>
<string name="pref_long_interval_title">Tuş tekrarlama aralığı</string>
<!-- <string name="pref_lock_double_tap_title">Double tap on shift for caps lock</string> -->
<!-- <string name="pref_lock_double_tap_summary">You can lock any modifier by holding it</string> -->
<!-- <string name="pref_category_behavior">Behavior</string> -->
<!-- <string name="pref_autocapitalisation_title">Automatic capitalisation</string> -->
<!-- <string name="pref_autocapitalisation_summary">Press Shift at the beginning of a sentence</string> -->
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Titreşim</string>
<string name="pref_vibrate_summary">Tuşa basıldığında titreşimi etkinleştir</string>
<string name="pref_precise_repeat_title">İmleç hareketini ayarla</string>
<string name="pref_precise_repeat_summary">Tuş tekrar hızını az ya da çok kaydırarak ayarla</string>
<string name="pref_category_style">Stil</string>
<string name="pref_margin_bottom_title">Alt boşluk</string>
<string name="pref_keyboard_height_title">Klavye yüksekliği</string>
@@ -32,6 +54,9 @@
<string name="pref_theme_e_dark">Koyu</string>
<string name="pref_theme_e_light">ık</string>
<string name="pref_theme_e_black">Siyah</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<!-- <string name="pref_theme_e_white">White</string> -->
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">Çok kısa</string>
<string name="pref_swipe_dist_e_short">Kısa</string>
<string name="pref_swipe_dist_e_default">Normal</string>
@@ -39,10 +64,17 @@
<string name="pref_swipe_dist_e_very_far">Çok uzun</string>
<string name="pref_key_horizontal_space">Tuşlar arasındaki yatay boşluk</string>
<string name="pref_key_vertical_space">Tuşlar arasındaki dikey boşluk</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">İleri</string>
<string name="key_action_done">Bitti</string>
<string name="key_action_go">İlerle</string>
<string name="key_action_prev">Geri</string>
<string name="key_action_search">Ara</string>
<string name="key_action_send">Gönder</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

82
res/values-vi/strings.xml Normal file
View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" product="debug">Unexpected Keyboard (gỡ lỗi)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Cài đặt Unexpected Keyboard</string>
<string name="pref_portrait">Trong chế độ chân dung</string>
<string name="pref_landscape">Trong chế độ phong cảnh</string>
<string name="pref_category_layout">Bố cục</string>
<string name="pref_label_brightness">Tùy chỉnh độ sáng của phím</string>
<string name="pref_keyboard_opacity">Tùy chỉnh độ trong suốt của bàn phím</string>
<string name="pref_key_opacity">Tùy chỉnh độ trong suốt của phím</string>
<string name="pref_key_activated_opacity">Tùy chỉnh độ trong suốt của phím khi nhấn</string>
<string name="pref_layout_title">Thay đổi bố cục bàn phím</string>
<string name="pref_layout_e_system">Hệ thống</string>
<string name="pref_layout_e_custom">Tùy chỉnh bố cục</string>
<string name="pref_accents_title">Dấu phụ</string>
<string name="pref_accents_e_all_installed">Hiển thị cho các ngôn ngữ đã cài đặt</string>
<string name="pref_accents_e_selected">Chỉ hiển thị cho các ngôn ngữ đã chọn</string>
<string name="pref_accents_e_none">
Ẩn dấu phụ
</string>
<string name="pref_show_numpad_title">Hiện NumPad</string>
<string name="pref_show_numpad_never">Không bao giờ</string>
<string name="pref_show_numpad_landscape">Chỉ trong chế độ phong cảnh</string>
<string name="pref_show_numpad_always">Luôn luôn</string>
<string name="pref_number_row_title">Hiện số dòng</string>
<string name="pref_number_row_summary">Hiện số dòng trên đầu bàn phím khi NumPad ẩn</string>
<string name="pref_numpad_layout">Bố cục NumPad</string>
<string name="pref_numpad_layout_e_high_first">Số lớn nhất trước</string>
<string name="pref_numpad_layout_e_low_first">Số nhỏ nhất trước</string>
<string name="pref_extra_keys_title">Thêm phím vào bàn phím</string>
<string name="pref_second_layout_title">Bố cục phụ</string>
<string name="pref_second_layout_none">Không</string>
<string name="pref_category_typing"></string>
<string name="pref_swipe_dist_title">Khoảng cách vuốt</string>
<string name="pref_swipe_dist_summary">Khoảng cách giữa các ký tự ở góc phím (%s)</string>
<string name="pref_long_timeout_title">Thời hạn lặp phím</string>
<string name="pref_long_interval_title">Khoảng thời gian lặp phím</string>
<string name="pref_lock_double_tap_title">Nhấn hai lần Shift để bật Caps Lock</string>
<string name="pref_lock_double_tap_summary">Bạn có thể khóa phím hỗ trợ bằng cách giữ vào nó</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">Tự động viết hoa</string>
<string name="pref_autocapitalisation_summary">Nhấn Shift ở đầu câu</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">Sự rung</string>
<string name="pref_vibrate_summary">Bật/tắt rung khi nhấn</string>
<string name="pref_category_style">Kiểu cách</string>
<string name="pref_margin_bottom_title">Căn lề dưới</string>
<string name="pref_keyboard_height_title">Chiều cao bàn phím</string>
<string name="pref_horizontal_margin_title">Căn lề chiều ngang</string>
<string name="pref_character_size_title">Kích cỡ ký tự phím</string>
<string name="pref_character_size_summary">Kích cỡ các ký tự hiển thị trên bàn phím (%.2fx)</string>
<string name="pref_theme">Chủ đề</string>
<string name="pref_theme_e_system">Hệ thống</string>
<string name="pref_theme_e_dark">Tối</string>
<string name="pref_theme_e_light">Sáng</string>
<string name="pref_theme_e_black">Đen</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<string name="pref_theme_e_white">Trắng</string>
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_swipe_dist_e_very_short">Rất gần</string>
<string name="pref_swipe_dist_e_short">Gần</string>
<string name="pref_swipe_dist_e_default">Trungbình</string>
<string name="pref_swipe_dist_e_far">Xa</string>
<string name="pref_swipe_dist_e_very_far">Rất xa</string>
<string name="pref_key_horizontal_space">Khoảng cách giữa các phím theo chiều ngang</string>
<string name="pref_key_vertical_space">Khoảng cách giữa các phím theo chiều dọc</string>
<string name="pref_category_advanced">Nâng cao</string>
<string name="pref_custom_layout_title">Tùy chỉnh bố cục</string>
<string name="pref_custom_layout_summary">Hãy xem mã nguồn. Lựa chọn này không có mục đích sử dụng.</string>
<string name="key_action_next">Tiếp</string>
<string name="key_action_done">Xong</string>
<string name="key_action_go">Đi</string>
<string name="key_action_prev">Trước</string>
<string name="key_action_search">Tìm</string>
<string name="key_action_send">Gửi</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -3,22 +3,46 @@
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard 设置</string>
<!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> -->
<string name="pref_category_layout">布局</string>
<string name="pref_label_brightness">调整字母亮度</string>
<!-- <string name="pref_keyboard_opacity">Adjust keyboard background opacity</string> -->
<!-- <string name="pref_key_opacity">Adjust key opacity</string> -->
<!-- <string name="pref_key_activated_opacity">Adjust pressed key opacity</string> -->
<string name="pref_layout_title">改变键盘布局</string>
<string name="pref_layout_e_system">系统设置</string>
<!-- <string name="pref_layout_e_custom">Custom layout</string> -->
<string name="pref_accents_title">声调</string>
<string name="pref_accents_e_all_installed">显示所有安装的语言的声调符号</string>
<string name="pref_accents_e_selected">只显示选择的语言的声调符号</string>
<string name="pref_accents_e_none">隐藏声调符号</string>
<string name="pref_show_numpad_title">显示数字小键盘</string>
<string name="pref_show_numpad_never">从不</string>
<string name="pref_show_numpad_landscape">只在横屏显示</string>
<string name="pref_show_numpad_always">一直显示</string>
<!-- <string name="pref_number_row_title">Show number row</string> -->
<!-- <string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string> -->
<!-- <string name="pref_numpad_layout">NumPad layout</string> -->
<!-- <string name="pref_numpad_layout_e_high_first">High digits first</string> -->
<!-- <string name="pref_numpad_layout_e_low_first">Low digits first</string> -->
<string name="pref_extra_keys_title">选择要显示的按键</string>
<string name="pref_second_layout_title">第二键盘布局</string>
<string name="pref_second_layout_none"></string>
<string name="pref_category_typing">输入</string>
<string name="pref_swipe_dist_title">滑动触发距离</string>
<string name="pref_swipe_dist_summary">输入按键四角的符号需要滑动的距离 (%s)</string>
<string name="pref_long_timeout_title">长按到开始重复输入的时间</string>
<string name="pref_long_interval_title">长按后每次重复输入的时间间隔</string>
<string name="pref_lock_double_tap_title">双击Shift键锁定大写</string>
<string name="pref_lock_double_tap_summary">任何时候都可以长按修改键以锁定</string>
<!-- <string name="pref_category_behavior">Behavior</string> -->
<string name="pref_autocapitalisation_title">句首自动大写</string>
<string name="pref_autocapitalisation_summary">在句子的开头自动按下Shift</string>
<!-- <string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string> -->
<!-- <string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string> -->
<string name="pref_vibrate_title">振动</string>
<string name="pref_vibrate_summary">启用或者禁用按下按键时振动</string>
<string name="pref_precise_repeat_title">精确控制光标移速</string>
<string name="pref_precise_repeat_summary">按键重复按下速度由手指滑动的距离决定</string>
<string name="pref_category_style">样式</string>
<string name="pref_margin_bottom_title">键盘下边距</string>
<string name="pref_keyboard_height_title">键盘高度</string>
@@ -30,17 +54,27 @@
<string name="pref_theme_e_dark">暗色</string>
<string name="pref_theme_e_light">亮色</string>
<string name="pref_theme_e_black">黑色</string>
<!-- <string name="pref_theme_e_altblack">Alternative Black</string> -->
<string name="pref_theme_e_white">白色</string>
<!-- <string name="pref_theme_e_epaper">ePaper</string> -->
<string name="pref_swipe_dist_e_very_short">非常短</string>
<string name="pref_swipe_dist_e_short"></string>
<string name="pref_swipe_dist_e_default">中(默认)</string>
<string name="pref_swipe_dist_e_far"></string>
<string name="pref_swipe_dist_e_default">中(默认)</string>
<string name="pref_swipe_dist_e_far"></string>
<string name="pref_swipe_dist_e_very_far">非常长</string>
<string name="pref_key_horizontal_space">按键的左右边距</string>
<string name="pref_key_vertical_space">按键的上下边距</string>
<!-- <string name="pref_category_advanced">Advanced</string> -->
<!-- <string name="pref_custom_layout_title">Custom layout</string> -->
<!-- <string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</string> -->
<string name="key_action_next">下一项</string>
<string name="key_action_done">完成</string>
<string name="key_action_go">前往</string>
<string name="key_action_prev">前一项</string>
<string name="key_action_search">搜索</string>
<string name="key_action_send">发送</string>
<!-- <string name="launcher_button_imesettings">Enable keyboard</string> -->
<!-- <string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string> -->
<!-- <string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string> -->
<!-- <string name="launcher_tryhere">After enabling, you can try the keyboard here:</string> -->
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="pref_layout_values">
<item>system</item>
<item>none</item>
<item>azerty</item>
<item>qwerty</item>
<item>qwerty_pt</item>
@@ -13,11 +13,14 @@
<item>qwerty_sv_se</item>
<item>qwerty_hu</item>
<item>qwerty_tr</item>
<item>qwerty_pl</item>
<item>qwerty_vi</item>
<item>ru_jcuken</item>
<item>qwertz</item>
<item>qwertz_cs</item>
<item>qwertz_de</item>
<item>qwertz_hu</item>
<item>qwertz_sk</item>
<item>bgph1</item>
<item>dvorak</item>
<item>colemak</item>
@@ -25,10 +28,16 @@
<item>bone</item>
<item>jcuken_ua</item>
<item>bangla</item>
<item>hindi</item>
<item>devanagari_1</item>
<item>devanagari_2</item>
<item>he_il_1452_1</item>
<item>he_il_1452_2</item>
<item>ar_pc</item>
<item>ar_alt</item>
<item>custom</item>
</string-array>
<string-array name="pref_layout_entries">
<item>@string/pref_layout_e_system</item>
<item>None</item>
<item>AZERTY</item>
<item>QWERTY</item>
<item>QWERTY (Brasileiro)</item>
@@ -40,11 +49,14 @@
<item>QWERTY (Swedish)</item>
<item>QWERTY (Hungarian)</item>
<item>QWERTY (Türkçe)</item>
<item>QWERTY (Polski)</item>
<item>QWERTY (Vietnamese)</item>
<item>ЙЦУКЕН (Русский)</item>
<item>QWERTZ</item>
<item>QWERTZ (Czech)</item>
<item>QWERTZ (Deutsch)</item>
<item>QWERTZ (Hungarian)</item>
<item>QWERTZ (Slovak)</item>
<item>Bulgarian (Phonetic Traditional)</item>
<item>Dvorak</item>
<item>Colemak</item>
@@ -52,19 +64,13 @@
<item>Bone</item>
<item>ЙЦУКЕН (Українська)</item>
<item>বাংলা</item>
<item>हिन्दी</item>
</string-array>
<string-array name="pref_programming_layout_values">
<item>none</item>
<item>qwerty</item>
<item>dvorak</item>
<item>colemak</item>
</string-array>
<string-array name="pref_programming_layout_entries">
<item>@string/pref_programming_layout_none</item>
<item>QWERTY</item>
<item>Dvorak</item>
<item>Colemak</item>
<item>देवनागरी (हिंदी)-1</item>
<item>देवनागरी (हिंदी)-2</item>
<item>Hebrew SI-1452-1</item>
<item>Hebrew SI-1452-2</item>
<item>Arabic PC</item>
<item>Arabic ALT</item>
<item>@string/pref_layout_e_custom</item>
</string-array>
<string-array name="pref_accents_entries">
<item>@string/pref_accents_e_all_installed</item>
@@ -81,6 +87,14 @@
<item>@string/pref_show_numpad_landscape</item>
<item>@string/pref_show_numpad_always</item>
</string-array>
<string-array name="pref_numpad_layout_values">
<item>high_first</item>
<item>low_first</item>
</string-array>
<string-array name="pref_numpad_layout_entries">
<item>@string/pref_numpad_layout_e_high_first</item>
<item>@string/pref_numpad_layout_e_low_first</item>
</string-array>
<string-array name="pref_accents_values">
<item>1</item>
<item>2</item>
@@ -91,14 +105,18 @@
<item>@string/pref_theme_e_dark</item>
<item>@string/pref_theme_e_light</item>
<item>@string/pref_theme_e_black</item>
<item>@string/pref_theme_e_altblack</item>
<item>@string/pref_theme_e_white</item>
<item>@string/pref_theme_e_epaper</item>
</string-array>
<string-array name="pref_theme_values">
<item>system</item>
<item>dark</item>
<item>light</item>
<item>black</item>
<item>altblack</item>
<item>white</item>
<item>epaper</item>
</string-array>
<string-array name="pref_swipe_dist_entries">
<item>@string/pref_swipe_dist_e_very_short</item>

View File

@@ -3,4 +3,7 @@
<declare-styleable name="ExtraKeyCheckBoxPreference">
<attr name="index" format="integer"/>
</declare-styleable>
<declare-styleable name="LayoutListPreference">
<attr name="defaultString" format="string"/>
</declare-styleable>
</resources>

View File

@@ -3,9 +3,16 @@
<string name="app_name" product="debug">Unexpected Keyboard (debug)</string>
<string name="app_name" product="default">Unexpected Keyboard</string>
<string name="settings_activity_label">Unexpected Keyboard Settings</string>
<string name="pref_portrait">In portrait mode</string>
<string name="pref_landscape">In landscape mode</string>
<string name="pref_category_layout">Layout</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>
<string name="pref_key_activated_opacity">Adjust pressed key opacity</string>
<string name="pref_layout_title">Change keyboard layout</string>
<string name="pref_layout_e_system">System settings</string>
<string name="pref_layout_e_custom">Custom layout</string>
<string name="pref_accents_title">Accents</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>
@@ -14,26 +21,31 @@
<string name="pref_show_numpad_never">Never</string>
<string name="pref_show_numpad_landscape">Only in landscape mode</string>
<string name="pref_show_numpad_always">Always</string>
<string name="pref_autocapitalisation_title">Automatic capitalisation</string>
<string name="pref_autocapitalisation_summary">Press Shift at the beginning of a sentence</string>
<string name="pref_number_row_title">Show number row</string>
<string name="pref_number_row_summary">Add a number row at the top of the keyboard when the numpad is hidden</string>
<string name="pref_numpad_layout">NumPad layout</string>
<string name="pref_numpad_layout_e_high_first">High digits first</string>
<string name="pref_numpad_layout_e_low_first">Low digits first</string>
<string name="pref_extra_keys_title">Add keys to the keyboard</string>
<string name="pref_programming_layout_title">Keyboard layout for programming</string>
<string name="pref_programming_layout_none">None</string>
<string name="pref_second_layout_title">Secondary layout</string>
<string name="pref_second_layout_none">None</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">Key repeat timeout</string>
<string name="pref_long_interval_title">Key repeat interval</string>
<string name="pref_vibrate_title">Vibration</string>
<string name="pref_vibrate_summary">Enable/disable vibration on keypress</string>
<string name="pref_precise_repeat_title">Precise cursor movements</string>
<string name="pref_precise_repeat_summary">Modulate key repeat speed by swiping more or less</string>
<string name="pref_lock_double_tap_title">Double tap on shift for caps lock</string>
<string name="pref_lock_double_tap_summary">You can lock any modifier by holding it</string>
<string name="pref_category_behavior">Behavior</string>
<string name="pref_autocapitalisation_title">Automatic capitalisation</string>
<string name="pref_autocapitalisation_summary">Press Shift at the beginning of a sentence</string>
<string name="pref_switch_input_immediate_title">Switch to the last used keyboard</string>
<string name="pref_switch_input_immediate_summary">Behavior of the keyboard-switching key</string>
<string name="pref_vibrate_title">Vibration</string>
<string name="pref_vibrate_summary">Enable/disable vibration on keypress</string>
<string name="pref_category_style">Style</string>
<string name="pref_margin_bottom_title">Margin bottom</string>
<string name="pref_keyboard_height_title">Keyboard height</string>
<string name="pref_keyboard_height_landscape_title">Keyboard height in landscape mode</string>
<string name="pref_horizontal_margin_title">Horizontal margin</string>
<string name="pref_character_size_title">Label size</string>
<string name="pref_character_size_summary">Size of characters displayed on the keyboard (%.2fx)</string>
@@ -42,7 +54,9 @@
<string name="pref_theme_e_dark">Dark</string>
<string name="pref_theme_e_light">Light</string>
<string name="pref_theme_e_black">Black</string>
<string name="pref_theme_e_altblack">Alternative Black</string>
<string name="pref_theme_e_white">White</string>
<string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_swipe_dist_e_very_short">Very short</string>
<string name="pref_swipe_dist_e_short">Short</string>
<string name="pref_swipe_dist_e_default">Normal</string>
@@ -50,10 +64,17 @@
<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="pref_category_advanced">Advanced</string>
<string name="pref_custom_layout_title">Custom layout</string>
<string name="pref_custom_layout_summary">See the source code. This option is not meant to be used.</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>
<string name="launcher_button_imesettings">Enable keyboard</string>
<string name="launcher_description">This application is a virtual keyboard. Go to the system settings by clicking on the button below and enable Unexpected-Keyboard.</string>
<string name="launcher_sourcecode">This is an free and open source application. You can find the source code or report bugs on <a href="https://github.com/Julow/Unexpected-Keyboard/">Github</a>.</string>
<string name="launcher_tryhere">After enabling, you can try the keyboard here:</string>
</resources>

View File

@@ -17,9 +17,18 @@
<item name="android:textColor">?attr/emoji_key_text</item>
<item name="android:textSize">18dp</item>
</style>
<!-- Passed to TextView.setTextAppearance -->
<style name="emojiGridButton">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:gravity">center</item>
<item name="android:textSize">@dimen/emoji_text_size</item>
<item name="android:textColor">?attr/emoji_color</item>
</style>
<style name="paragraph">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginVertical">8dp</item>
<item name="android:layout_marginHorizontal">16dp</item>
<item name="android:layout_gravity">center</item>
</style>
</resources>

View File

@@ -11,10 +11,17 @@
<attr name="colorLabel" format="color"/>
<attr name="colorLabelActivated" format="color"/>
<attr name="colorLabelLocked" format="color"/>
<attr name="secondaryLightOffset" format="float"/>
<!-- Corner labels -->
<attr name="colorSubLabel" format="color"/>
<!-- Dimens -->
<!-- Borders -->
<attr name="keyBorderRadius" format="dimension"/>
<attr name="keyBorderWidth" format="dimension"/>
<attr name="keyBorderWidthActivated" format="dimension"/>
<attr name="keyBorderColorLeft" format="color"/>
<attr name="keyBorderColorTop" format="color"/>
<attr name="keyBorderColorRight" format="color"/>
<attr name="keyBorderColorBottom" format="color"/>
<!-- Emoji panel -->
<attr name="emoji_button_bg" type="color" format="color"/>
<attr name="emoji_color" type="color" format="color"/>
@@ -29,6 +36,8 @@
<item name="navigationBarColor">?attr/colorKeyboard</item>
<item name="windowLightNavigationBar">?attr/android:isLightTheme</item>
<item name="keyBorderRadius">5dp</item>
<item name="keyBorderWidth">0dp</item>
<item name="keyBorderWidthActivated">0dp</item>
<item name="emoji_key_bg" type="color">?attr/emoji_button_bg</item>
<item name="emoji_key_text" type="color">?attr/colorLabel</item>
</style>
@@ -37,10 +46,14 @@
<item name="colorKeyboard">#1b1b1b</item>
<item name="colorKey">#333333</item>
<item name="colorKeyActivated">#1b1b1b</item>
<item name="keyBorderWidth">1.2dp</item>
<item name="keyBorderWidthActivated">0dp</item>
<item name="keyBorderColorBottom">#404040</item>
<item name="colorLabel">#ffffff</item>
<item name="colorLabelActivated">#3399ff</item>
<item name="colorLabelLocked">#33cc33</item>
<item name="colorSubLabel">#cccccc</item>
<item name="secondaryLightOffset">-0.2</item>
<item name="emoji_button_bg" type="color">#202020</item>
<item name="emoji_color" type="color">#ffffff</item>
</style>
@@ -49,10 +62,17 @@
<item name="colorKeyboard">#e3e3e3</item>
<item name="colorKey">#cccccc</item>
<item name="colorKeyActivated">#e3e3e3</item>
<item name="keyBorderWidth">0.6dp</item>
<item name="keyBorderWidthActivated">0dp</item>
<item name="keyBorderColorLeft">#cccccc</item>
<item name="keyBorderColorTop">#eeeeee</item>
<item name="keyBorderColorRight">#cccccc</item>
<item name="keyBorderColorBottom">#aaaaaa</item>
<item name="colorLabel">#000000</item>
<item name="colorLabelActivated">#0066cc</item>
<item name="colorLabelLocked">#33cc33</item>
<item name="colorSubLabel">#333333</item>
<item name="secondaryLightOffset">+0.3</item>
<item name="emoji_button_bg">#dedede</item>
<item name="emoji_color">#000000</item>
</style>
@@ -61,23 +81,59 @@
<item name="colorKeyboard">#000000</item>
<item name="colorKey">#000000</item>
<item name="colorKeyActivated">#333333</item>
<item name="keyBorderWidth">0dp</item>
<item name="keyBorderWidthActivated">1dp</item>
<item name="keyBorderColorLeft">#2a2a2a</item>
<item name="keyBorderColorTop">#2a2a2a</item>
<item name="keyBorderColorRight">#2a2a2a</item>
<item name="keyBorderColorBottom">#2a2a2a</item>
<item name="colorLabel">#eeeeee</item>
<item name="colorLabelActivated">#009dff</item>
<item name="colorLabelLocked">#00ff26</item>
<item name="colorSubLabel">#bbbbbb</item>
<item name="secondaryLightOffset">-0.25</item>
<item name="keyBorderRadius">1dp</item>
<item name="emoji_button_bg">#000000</item>
<item name="emoji_color">#ffffff</item>
</style>
<style name="AltBlack" parent="Black">
<item name="keyBorderWidth">1dp</item>
</style>
<style name="White" parent="BaseTheme">
<item name="android:isLightTheme">true</item>
<item name="colorKeyboard">#ffffff</item>
<item name="colorKey">#ffffff</item>
<item name="colorKeyActivated">#cccccc</item>
<item name="keyBorderWidth">1dp</item>
<item name="keyBorderWidthActivated">1dp</item>
<item name="keyBorderColorLeft">#f0f0f0</item>
<item name="keyBorderColorTop">#f0f0f0</item>
<item name="keyBorderColorRight">#eeeeee</item>
<item name="keyBorderColorBottom">#eeeeee</item>
<item name="colorKeyActivated">#ffffff</item>
<item name="colorLabel">#000000</item>
<item name="colorLabelActivated">#0066cc</item>
<item name="colorLabelLocked">#33cc33</item>
<item name="colorSubLabel">#333333</item>
<item name="secondaryLightOffset">+0.35</item>
<item name="emoji_button_bg">#ffffff</item>
<item name="emoji_color">#000000</item>
</style>
<style name="ePaper" parent="BaseTheme">
<item name="android:isLightTheme">true</item>
<item name="colorKeyboard">#ffffff</item>
<item name="colorKey">#ffffff</item>
<item name="keyBorderWidth">2dp</item>
<item name="keyBorderWidthActivated">5dp</item>
<item name="keyBorderColorLeft">#000000</item>
<item name="keyBorderColorTop">#000000</item>
<item name="keyBorderColorRight">#000000</item>
<item name="keyBorderColorBottom">#000000</item>
<item name="colorKeyActivated">#ffffff</item>
<item name="colorLabel">#000000</item>
<item name="colorLabelActivated">#000000</item>
<item name="colorLabelLocked">#33cc33</item>
<item name="colorSubLabel">#333333</item>
<item name="secondaryLightOffset">+0.35</item>
<item name="emoji_button_bg">#ffffff</item>
<item name="emoji_color">#000000</item>
</style>

View File

@@ -6,11 +6,9 @@
<dimen name="key_padding">2dp</dimen>
<dimen name="key_vertical_interval">2dp</dimen>
<dimen name="key_horizontal_interval">2dp</dimen>
<dimen name="key_height">51dp</dimen>
<dimen name="emoji_type_button_height">56dp</dimen>
<dimen name="emoji_grid_height">250dp</dimen>
<dimen name="emoji_text_size">28dp</dimen>
<dimen name="extra_horizontal_margin">0dp</dimen>
<bool name="debug_logs" product="debug">true</bool>
<bool name="debug_logs" product="default">false</bool>
</resources>

42
res/xml/ar_alt.xml Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="ض" key2="١" key3="`" key4="esc"/>
<key key0="ص" key2="٢" key3="\@"/>
<key key0="ث" key2="٣" key3="\#"/>
<key key0="ق" key2="٤" key3="$"/>
<key key0="ف" key2="٥" key3="%"/>
<key key0="غ" key2="٦" key3="^"/>
<key key0="ع" key2="٧" key3="&amp;"/>
<key key0="ه" key2="٨" key3="*"/>
<key key0="خ" key2="٩" key3="("/>
<key key0="ح" key2="٠" key3=")"/>
<key key0="ج"/>
</row>
<row>
<key key0="ش" key4="tab"/>
<key key0="س"/>
<key key0="ي"/>
<key key0="ب"/>
<key key0="ل"/>
<key key0="ا" key1="أ"/>
<key key0="ت"/>
<key key0="ن"/>
<key key0="م"/>
<key key0="ك"/>
<key key0="ط"/>
</row>
<row>
<key key0="ذ"/>
<key key0="ء"/>
<key key0="ؤ" key1="{"/>
<key key0="ر" key1="}"/>
<key key0="ى" key1="ئ"/>
<key key0="ة"/>
<key key0="و" key3=","/>
<key key0="ز" key3="."/>
<key key0="ظ" key3="&#1567;"/>
<key key0="د"/>
<key width="1.0" key0="backspace" key2="delete"/>
</row>
</keyboard>

44
res/xml/ar_pc.xml Normal file
View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="ض" key1="&#1614;" key2="١" key3="`" key4="esc"/>
<key key0="ص" key1="&#1611;" key2="٢" key3="\@"/>
<key key0="ث" key1="&#1615;" key2="٣" key3="\#" key4="loc €"/>
<key key0="ق" key1="&#1612;" key2="٤" key3="$" key4="loc £"/>
<key key0="ف" key1="&#1604;&#1573;" key2="٥" key3="%"/>
<key key0="غ" key1="&#1573;" key2="٦" key3="^"/>
<key key0="ع" key1="&#8216;" key2="٧" key3="&amp;"/>
<key key0="ه" key1="&#0247;" key2="٨" key3="*"/>
<key key0="خ" key1="&#0215;" key2="٩" key3="("/>
<key key0="ح" key1="&#1563;" key2="٠" key3=")"/>
<key key0="ج" key1="&gt;" key2="-" key3="_"/>
<key key0="د" key1="&lt;" key2="=" key3="ذ"/>
<!-- <key key0="ذ" key1="&#1617;" key3="\\" key4="|"/> -->
</row>
<row>
<key shift="0.5" key0="ش" key1="&#1616;" key4="tab"/>
<key key0="س" key1="&#1613;"/>
<key key0="ي" key1="["/>
<key key0="ب" key1="]"/>
<key key0="ل" key1="&#1604;&#1571;"/>
<key key0="ا" key1="أ"/>
<key key0="ت" key1="ـ"/>
<key key0="ن" key1="&#1548;"/>
<key key0="م" key1="/"/>
<key key0="ك" key1=":"/>
<key key0="ط" key1="&quot;"/>
</row>
<row>
<key shift="0.5" key0="ئ" key1="~"/>
<key key0="ء" key1="&#1618;"/>
<key key0="ؤ" key1="{"/>
<key key0="ر" key1="}"/>
<key key0="لا" key1="&#1604;&#1570;"/>
<key key0="ى" key1="&#1570;"/>
<key key0="ة" key1="&#8217;"/>
<key key0="و" key1=","/>
<key key0="ز" key1="."/>
<key key0="ظ" key1="&#1567;"/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
</keyboard>

View File

@@ -38,8 +38,8 @@
<row height="0.95">
<key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
<key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" key2="0" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="4.0" key0="space" key7="switch_second" key8="0"/>
<key width="1.2" key7="up" key6="right" key5="left" key8="down"/>
<key width="1.8" key0="enter" key3="action"/>
</row>
</keyboard>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<row height="0.95">
<key width="1.8" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key4="switch_numeric"/>
<key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="1.8" key0="enter" key2="action"/>
<key width="1.7" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key4="switch_numeric"/>
<key width="1.1" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.4" key0="space" key7="switch_second" key5="left" key6="right" slider="true"/>
<key width="1.1" key7="up" key6="right" key5="left" key8="down"/>
<key width="1.7" key0="enter" key2="action"/>
</row>

30
res/xml/devanagari_2.xml Normal file
View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key shift="0.35" width="0.9" key0="क" key1="ख" key2="घ" key3="ङ" key4="ग"/>
<key width="0.9" key0="च" key1="छ" key2="झ" key3="ञ" key4="ज"/>
<key width="0.9" key0="ट" key1="ठ" key2="ढ" key3="ण" key4="ड"/>
<key width="0.9" key0="त" key1="थ" key2="ध" key3="न" key4="द"/>
<key width="0.9" key0="प" key1="फ" key2="भ" key3="म" key4="ब"/>
<key width="0.9" key0="र" key1="ज्ञ" key2="ल" key3="य" key4="व"/>
<key width="0.9" key0="ह" key1="श" key2="ळ" key3="स" key4="ष"/>
</row>
<row>
<key shift="0.35" width="0.9" key0="ा" key1="अ" key2="आ"/>
<key width="0.9" key0="ि" key1="इ"/>
<key width="0.9" key0="ी" key1="ई"/>
<key width="0.9" key0="ु" key1="उ" key2="ऊ" key4="ू"/>
<key width="0.9" key0="े" key1="ए" key2="ऋ" key4="ृ"/>
<key width="0.9" key0="ै" key1="ऐ" key2="ऌ" key4="ॢ"/>
<key width="0.9" key0="ो" key1="ओ" key2="औ" key4="ौ"/>
</row>
<row>
<key key0="्" key2="tab" key4="esc"/>
<key key0="ँ" key1="₹" key2="॑" key3="ॖ" key4="॓"/>
<key key0="ं" key1="ॐ" key2="ऽ" key3="" key4="&quot;"/>
<key key0="।" key1="," key2=";" key3="!" key4="\?"/>
<key key0="़" key1="॰" key2="" key3="-" key4="॒"/>
<key key0="५" key1="१" key2="३" key3="७" key4="९" key5="४" key6="६" key7="२" key8="८"/>
<key key0="backspace" key2="delete"/>
</row>
</keyboard>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard bottom_row="false" extra_keys="false">
<keyboard bottom_row="false">
<row>
<key key0="θ" key2="^"/>
<key key0="δ" key1="⌊" key2="" key3="↔" key4="⊂"/>
@@ -41,7 +41,7 @@
<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" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="1.2" key7="up" key6="right" key5="left" key8="down"/>
<key width="1.2" key0="enter" key1="=" key2="action"/>
</row>
</keyboard>

41
res/xml/he_il_1452_1.xml Normal file
View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="/" key2="1" key3="!" key4="esc"/>
<key key0="'" key2="2" key3="\@" key1=";"/>
<key key0="ק" key2="3" key3="\#" key1="€"/>
<key key0="ר" key2="4" key3="$" key1="₪"/>
<key key0="א" key2="5" key3="%"/>
<key key0="ט" key2="6" key3="^" key4="ole_placeholder"/>
<key key0="ו" key2="7" key3="&amp;" key4="meteg_placeholder"/>
<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" key3="f11_placeholder" key4="f12_placeholder"/>
</row>
<row>
<key key0="ש" key2="`" key1="tab" key3="sindot_placeholder" key4="shindot_placeholder" width="1.333"/>
<key key0="ד" key1="~" width="1.0333"/>
<key key0="ג" key1="geresh" key2="gershayim" width="1.0333"/>
<key key0="כ" width="1.0333"/>
<key key0="ע" width="1.0333"/>
<key key0="י" key2="-" key3="_" key4="maqaf" width="1.0333"/>
<key key0="ח" key2="=" key3="+" width="1.0333"/>
<key key0="ל" key2="b[" key3="b{" width="1.0333"/>
<key key0="ך" key2="b]" key3="b}" width="1.0333"/>
<key key0="ף" key2="," key3="&quot;" key1=":" width="1.4006"/>
</row>
<row>
<key key0="\\" key1="|" key2="shift" key3="loc capslock"/>
<key key0="ז"/>
<key key0="ס"/>
<key key0="ב"/>
<key key0="ה"/>
<key key0="נ"/>
<key key0="מ"/>
<key key0="צ"/>
<key key0="ת" key1="blt"/>
<key key0="ץ" key1="bgt"/>
<key key0="." key1="\?"/>
</row>
</keyboard>

39
res/xml/he_il_1452_2.xml Normal file
View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="ץ" key2="1" key3="!" key4="esc"/>
<key key0="ן" key2="2" key3="\@" key1=";"/>
<key key0="ק" key2="3" key3="\#" key1="€"/>
<key key0="ר" key2="4" key3="$" key1="₪"/>
<key key0="א" key2="5" key3="%"/>
<key key0="ט" key2="6" key3="^" key4="ole_placeholder"/>
<key key0="ו" key2="7" key3="&amp;" key4="meteg_placeholder"/>
<key key0="ת" key2="8" key3="*"/>
<key key0="ם" key2="9" key3="b(" key4="lrm"/>
<key key0="פ" key2="0" key3="b)" key4="rlm" width="1.333"/>
</row>
<row>
<key key0="ש" key2="`" key1="tab" key3="sindot_placeholder" key4="shindot_placeholder" width="1.333"/>
<key key0="ד" key1="~"/>
<key key0="ג" key1="geresh" key2="gershayim"/>
<key key0="כ"/>
<key key0="ע"/>
<key key0="י" key2="-" key3="_" key4="maqaf"/>
<key key0="ח" key2="=" key3="+"/>
<key key0="ל" key2="b[" key3="b{"/>
<key key0="ך" key2="b]" key3="b}"/>
<key key0="ף" key2="'" key3="&quot;" key1=":"/>
</row>
<row>
<key key0="\\" key1="|" key2="shift" key3="loc capslock"/>
<key key0="ז"/>
<key key0="ס"/>
<key key0="ב"/>
<key key0="ה" />
<key key0="נ"/>
<key key0="מ" key1="blt" key2=","/>
<key key0="צ" key1="bgt" key2="."/>
<key key0="/" key1="\?"/>
<key key0="backspace" key2="delete" key3="f11_placeholder" key4="f12_placeholder" width="1.333"/>
</row>
</keyboard>

View File

@@ -2,17 +2,16 @@
<keyboard>
<row>
<key key0="й" key2="1" key4="esc"/>
<key key0="ц" key2="2" key3="\@" key4="~"/>
<key key0="у" key2="3" key3="\#" key4="!"/>
<key key0="ц" key1="loc ї" key2="2" key3="\@" key4="~"/>
<key key0="у" key1="loc ў" key2="3" key3="\#" key4="!"/>
<key key0="к" key2="4" key3="$"/>
<key key0="е" key1="ё" key2="5" key3="%"/>
<key key0="н" key2="6" key3="^"/>
<key key0="г" key2="7" key3="&amp;"/>
<key key0="н" key1="loc є" key2="6" key3="^"/>
<key key0="г" key1="loc ґ" key2="7" key3="&amp;"/>
<key key0="ш" key2="8" key3="*"/>
<key key0="щ" key2="9" key3="(" key4=")"/>
<key key0="з" key2="0" key3="{" key4="}" />
<key key0="з" key2="0" key3="{" key4="}"/>
<key key0="х" key3="[" key4="]" key1="f11_placeholder" key2="f12_placeholder"/>
</row>
<row>
<key key0="ф" key1="tab" key2="`"/>
@@ -33,7 +32,7 @@
<key width="0.96" key0="ч"/>
<key width="0.96" key0="с"/>
<key width="0.96" key0="м"/>
<key width="0.96" key0="и" key2="&lt;" key3="."/>
<key width="0.96" key0="и" key1="loc і" key2="&lt;" key3="."/>
<key width="0.96" key0="т" key2="&gt;" key3=","/>
<key width="0.96" key0="ь" key1="ъ" key2="\?" key3="/"/>
<key width="0.96" key0="б" key2=":" key3=";"/>

View File

@@ -1,13 +1,20 @@
<?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="ar" android:imeSubtypeLocale="ar" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ar_pc"/>
<subtype android:label="%s" android:languageTag="be" android:imeSubtypeLocale="be_BY" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken,extra_keys=ґ|є|і|ї|ў"/>
<subtype android:label="%s" android:languageTag="bg" android:imeSubtypeLocale="bg_BG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=bgph1,extra_keys=€"/>
<subtype android:label="%s" android:languageTag="bn" android:imeSubtypeLocale="bn_BD" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=৳"/>
<subtype android:label="%s" android:languageTag="hi" android:imeSubtypeLocale="hi_IN" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=hindi,extra_keys="/>
<subtype android:label="%s" android:languageTag="cs" android:imeSubtypeLocale="cs_CZ" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz_cs,extra_keys=a|accent_cedille|accent_circonflexe"/>
<subtype android:label="%s" android:languageTag="de" android:imeSubtypeLocale="de_DE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz_de,extra_keys=accent_trema|ß|€"/>
<subtype android:label="%s" android:languageTag="el" android:imeSubtypeLocale="el" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_el,extra_keys=£|€"/>
<subtype android:label="%s" android:languageTag="en-GB" android:imeSubtypeLocale="en_GB" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=£|€"/>
<subtype android:label="%s" android:languageTag="en-US" 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_es,extra_keys=accent_grave|accent_aigu|accent_tilde|accent_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=accent_grave|accent_aigu|accent_circonflexe|accent_cedille|accent_trema|€"/>
<subtype android:label="%s" android:languageTag="he" android:imeSubtypeLocale="he_IL" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=he_il_1452_1,extra_keys=₪|€"/>
<subtype android:label="%s" android:languageTag="hi" android:imeSubtypeLocale="hi_IN" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=devanagari_1,extra_keys=₹"/>
<subtype android:label="%s" android:languageTag="mr" android:imeSubtypeLocale="mr_IN" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=devanagari_1,extra_keys=₹"/>
<subtype android:label="%s" android:languageTag="ne" android:imeSubtypeLocale="ne_NE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=devanagari_1,extra_keys=₹"/>
<subtype android:label="%s" android:languageTag="hu" android:imeSubtypeLocale="hu_HU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz_hu,extra_keys=accent_aigu|accent_trema|accent_ogonek|€"/>
<subtype android:label="%s" android:languageTag="it" android:imeSubtypeLocale="it_IT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=accent_grave|accent_aigu|€"/>
<subtype android:label="%s" android:languageTag="ko" android:imeSubtypeLocale="ko_KR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_ko"/>
@@ -15,12 +22,12 @@
<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=accent_caron|accent_cedille|accent_macron|€"/>
<subtype android:label="%s" android:languageTag="nl-BE" android:imeSubtypeLocale="nl_BE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=accent_grave|accent_aigu|accent_circonflexe|accent_cedille|accent_trema|€"/>
<subtype android:label="%s" android:languageTag="no" android:imeSubtypeLocale="no_NO" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_no,extra_keys=accent_aigu|€"/>
<subtype android:label="%s" android:languageTag="pl" android:imeSubtypeLocale="pl_PL" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=accent_aigu|accent_ogonek|accent_dot_above|ł"/>
<subtype android:label="%s" android:languageTag="pl" android:imeSubtypeLocale="pl_PL" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_pl"/>
<subtype android:label="%s" android:languageTag="pt" android:imeSubtypeLocale="pt_BR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_pt,extra_keys=accent_aigu|accent_cedille|accent_circonflexe|accent_grave|accent_tilde|€"/>
<subtype android:label="%s" android:languageTag="ru" android:imeSubtypeLocale="ru_RU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken"/>
<subtype android:label="%s" android:languageTag="sk" android:imeSubtypeLocale="sk_SK" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz_sk,extra_keys=é|ě|ŕ|ř|ť|ž|ü|ú|ů|í|ö|ó|ô|á|ä|ś|š|ď|ĺ|ľ|ý|č|ň"/>
<subtype android:label="%s" android:languageTag="sv" android:imeSubtypeLocale="sv_SE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_sv_se,extra_keys=accent_aigu|accent_trema|accent_ring|€"/>
<subtype android:label="%s" android:languageTag="tr" android:imeSubtypeLocale="tr_TR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_tr,extra_keys=accent_cedille|accent_trema|₺|ı|ğ"/>
<subtype android:label="%s" android:languageTag="uk" android:imeSubtypeLocale="uk_UA" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=jcuken_ua"/>
<subtype android:label="%s" android:languageTag="cs" android:imeSubtypeLocale="cs_CZ" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz_cs,extra_keys=a|accent_cedille|accent_circonflexe"/>
<subtype android:label="%s" android:languageTag="el" android:imeSubtypeLocale="el" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_el,extra_keys=£|€"/>
<subtype android:label="%s" android:languageTag="uk" android:imeSubtypeLocale="uk_UA" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=jcuken_ua,extra_keys=ґ|є|і"/>
<subtype android:label="%s" android:languageTag="vi" android:imeSubtypeLocale="vi_VN" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_vi"/>
</input-method>

View File

@@ -41,8 +41,8 @@
<row height="0.95">
<key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
<key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="4.0" key0="space" key7="switch_second"/>
<key width="1.2" key7="up" key6="right" key5="left" key8="down"/>
<key key0="j" key4=";"/>
<key width="1.8" key0="enter" key2="action"/>
</row>

13
res/xml/number_row.xml Normal file
View File

@@ -0,0 +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"/>
</row>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard bottom_row="false" extra_keys="false" num_pad="false">
<keyboard bottom_row="false">
<row>
<key width="0.75" key0="esc" key2="~" key4="!"/>
<key width="0.75" key0="(" key2="[" key4="{"/>
@@ -13,7 +13,7 @@
<key width="0.75" key0="tab" key2="|" key4="\\"/>
<key width="0.75" key0=")" key2="]" key4="}"/>
<key key0="4" key1="box" key3="arrows"/>
<key key0="5" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<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="^"/>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard width="6.0" bottom_row="false" extra_keys="false" num_pad="false">
<keyboard width="6.0" bottom_row="false">
<row>
<key shift="1.0" key0="1"/>
<key key0="2" indication="ABC"/>
@@ -21,7 +21,7 @@
<row>
<key shift="1.0" key0="*" key1="switch_text" key3="switch_numeric"/>
<key key0="0" key3="+" key4="space"/>
<key key0="\#" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key key0="\#" key7="up" key6="right" key5="left" key8="down"/>
<key key0="enter" key2="action"/>
</row>
</keyboard>

View File

@@ -1,10 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This file defines the QWERTY layout.
A layout is made of keys arranged into rows. Keys can be made bigger with the
'width' attribute and blank space can be added on the left of a key with the
'shift' attribute.
'key0' assigns the symbol on the middle of the key. 'key1', 'key2', etc..
assign symbols to the corners of a key, they are arranged like this:
1 7 2
5 0 6
3 8 4
Keys prefixed with 'loc ' are not visible on the keyboard. They are used to
specify a place for a key, if it needed to be added to the layout later.
(for example, by the "Add keys to keyboard" option)
See bottom_row.xml for the definition of the bottom row and neo2.xml for a
layout that re-defines it.
See srcs/juloo.keyboard2/KeyValue.java for the keys that have a special meaning.
-->
<keyboard>
<row>
<key key0="q" key2="1" key4="esc"/>
<key key0="w" key1="~" key2="2" key3="\@"/>
<key key0="e" key1="!" key2="3" key3="\#" key4="loc €"/>
<key key0="r" key2="4" key3="$"/>
<key key0="r" key2="4" key3="$" key1="loc ₪"/>
<key key0="t" key2="5" key3="%"/>
<key key0="y" key2="6" key3="^"/>
<key key0="u" key2="7" key3="&amp;"/>

37
res/xml/qwerty_pl.xml Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="q" key2="1" key4="esc"/>
<key key0="w" key1="~" key2="2" key3="\@"/>
<key key0="e" key1="!" key2="3" key3="\#" key4="ę"/>
<key key0="r" key2="4" key3="$"/>
<key key0="t" key2="5" key3="%"/>
<key key0="y" key2="6" key3="^"/>
<key key0="u" key2="7" key3="&amp;" key4="loc €"/>
<key key0="i" key1="loc accent_macron" key2="8" key3="*"/>
<key key0="o" key1="ó" key2="9" key3="(" key4=")"/>
<key key0="p" key2="0" key3="f11_placeholder" key4="f12_placeholder"/>
</row>
<row>
<key shift="0.5" key0="a" key1="tab" key2="`" key4="ą"/>
<key key0="s" key1="loc accent_ring" key3="loc ß" key4="ś"/>
<key key0="d" key1="loc accent_grave" key2="loc £" key3="loc accent_aigu"/>
<key key0="f" key1="loc accent_dot_above" key4="loc accent_ogonek"/>
<key key0="g" key1="loc accent_caron" key2="-" key3="_"/>
<key key0="h" key2="=" key3="+"/>
<key key0="j" key1="loc accent_trema" key2="loc accent_circonflexe" key3="{" key4="}"/>
<key key0="k" key1="loc accent_double_aigu" key3="[" key4="]"/>
<key key0="l" key2="|" key3="\\" key4="ł"/>
</row>
<row>
<key width="1.5" key0="shift" key2="loc capslock"/>
<key key0="z" key4="ż"/>
<key key0="x" key4="ź"/>
<key key0="c" key1="loc accent_cedille" key2="&lt;" key3="." key4="ć"/>
<key key0="v" key2="&gt;" key3=","/>
<key key0="b" key2="\?" key3="/"/>
<key key0="n" key1="loc accent_tilde" key2=":" key3=";" key4="ń"/>
<key key0="m" key2="&quot;" key3="'"/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
</keyboard>

37
res/xml/qwerty_vi.xml Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="q" key1="~" key2="1" key3="`" key4="esc"/>
<key key0="w" key1="accent_horn" key2="2" key3="\@"/>
<key key0="e" key1="!" key2="3" key3="\#" key4="ê"/>
<key key0="r" key2="4" key3="$" key1="accent_hook_above"/>
<key key0="t" key2="5" key3="%"/>
<key key0="y" key2="6" key3="^"/>
<key key0="u" key2="7" key3="&amp;"/>
<key key0="i" key2="8" key3="*"/>
<key key0="o" key1="ô" key2="9" key3="(" key4=")"/>
<key key0="p" key2="0" key3="f11_placeholder" key4="f12_placeholder"/>
</row>
<row>
<key shift="0.5" key0="a" key1="tab" key2="ă" key3="â"/>
<key key0="s" key1="accent_aigu"/>
<key key0="d" key1="accent_bar" key2="₫" key3="đ"/>
<key key0="f" key1="accent_grave"/>
<key key0="g" key2="-" key3="_"/>
<key key0="h" key2="=" key3="+"/>
<key key0="j" key1="accent_dot_below" key3="{" key4="}"/>
<key key0="k" key3="[" key4="]"/>
<key key0="l" key2="|" key3="\"/>
</row>
<row>
<key width="1.5" key0="shift" key2="loc capslock"/>
<key key0="z"/>
<key key0="x" key1="accent_tilde"/>
<key key0="c" key2="&lt;" key3="."/>
<key key0="v" key2="&gt;" key3=","/>
<key key0="b" key2="\?" key3="/"/>
<key key0="n" key2=":" key3=";"/>
<key key0="m" key2="&quot;" key3="'"/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
</keyboard>

39
res/xml/qwertz_sk.xml Normal file
View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard>
<row>
<key key0="q" key1="1" key4="esc"/>
<key key0="w" key1="2"/>
<key key0="e" key1="3" key3="é" key4="ě"/>
<key key0="r" key1="4" key3="ŕ" key4="ř"/>
<key key0="t" key1="5" key4="ť"/>
<key key0="z" key1="6" key4="ž"/>
<key key0="u" key1="7" key2="ü" key3="ú" key4="ů"/>
<key key0="i" key1="8" key3="í"/>
<key key0="o" key1="9" key2="ö" key3="ó" key4="ô"/>
<key key0="p" key1="0" key2="=" key3="\" key4="/"/>
</row>
<row>
<key key0="a" key1="tab" key3="á" key4="ä"/>
<key key0="s" key3="ś" key4="š"/>
<key key0="d" key4="ď"/>
<key key0="f" key1="%" key2="*"/>
<key key0="g" key2="^"/>
<key key0="h" key1="~" key2="÷"/>
<key key0="j" key1="{" key2="}" key3="|" key4="+"/>
<key key0="k" key1="[" key2="]" key3="'" key4="&quot;"/>
<key key0="l" key1="(" key2=")" key3="ĺ" key4="ľ"/>
<key key0="backspace" key3="delete"/>
</row>
<row>
<key key0="shift" key2="loc capslock"/>
<key key0="y" key1="$" key3="ý"/>
<key key0="x"/>
<key key0="c" key4="č"/>
<key key0="v" key4="\@"/>
<key key0="b" key1="\#" key2="&amp;" key3="-" key4="_"/>
<key key0="n" key1="«" key2="»" key4="ň"/>
<key key0="m" key1="&lt;" key2="&gt;"/>
<key key0="," key1=":" key2="\?"/>
<key key0="." key1=";" key2="!"/>
</row>
</keyboard>

View File

@@ -1,10 +1,11 @@
<?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">
<ListPreference android:key="layout" android:title="@string/pref_layout_title" android:summary="%s" android:defaultValue="system" android:entries="@array/pref_layout_entries" android:entryValues="@array/pref_layout_values"/>
<juloo.keyboard2.LayoutListPreference android:key="layout" android:title="@string/pref_layout_title" app:defaultString="@string/pref_layout_e_system"/>
<juloo.keyboard2.LayoutListPreference android:key="second_layout" android:title="@string/pref_second_layout_title" app:defaultString="@string/pref_second_layout_none"/>
<ListPreference android:key="accents" android:title="@string/pref_accents_title" android:summary="%s" android:defaultValue="1" android:entries="@array/pref_accents_entries" android:entryValues="@array/pref_accents_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="programming_layout" android:title="@string/pref_programming_layout_title" android:summary="%s" android:defaultValue="none" android:entries="@array/pref_programming_layout_entries" android:entryValues="@array/pref_programming_layout_values"/>
<CheckBoxPreference android:key="number_row" android:title="@string/pref_number_row_title" android:summary="@string/pref_number_row_summary" android:defaultValue="false"/>
<PreferenceScreen android:title="@string/pref_extra_keys_title">
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="0"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="1"/>
@@ -28,25 +29,57 @@
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="19"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="20"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="21"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="22"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="23"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="24"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="25"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="26"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="27"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="28"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="29"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="30"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="31"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="32"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="33"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="34"/>
<juloo.keyboard2.ExtraKeyCheckBoxPreference app:index="35"/>
</PreferenceScreen>
<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"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_typing">
<CheckBoxPreference android:key="autocapitalisation" android:title="@string/pref_autocapitalisation_title" android:summary="@string/pref_autocapitalisation_summary" android:defaultValue="true"/>
<ListPreference android:key="swipe_dist" android:title="@string/pref_swipe_dist_title" android:summary="@string/pref_swipe_dist_summary" android:defaultValue="15" android:entries="@array/pref_swipe_dist_entries" android:entryValues="@array/pref_swipe_dist_values"/>
<juloo.common.IntSlideBarPreference android:key="longpress_timeout" android:title="@string/pref_long_timeout_title" android:summary="%sms" android:defaultValue="600" min="50" max="2000"/>
<juloo.common.IntSlideBarPreference android:key="longpress_interval" android:title="@string/pref_long_interval_title" android:summary="%sms" android:defaultValue="25" min="5" max="100"/>
<CheckBoxPreference android:key="precise_repeat" android:title="@string/pref_precise_repeat_title" android:summary="@string/pref_precise_repeat_summary" android:defaultValue="true"/>
<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"/>
</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"/>
<CheckBoxPreference android:key="switch_input_immediate" android:title="@string/pref_switch_input_immediate_title" android:summary="@string/pref_switch_input_immediate_summary" android:defaultValue="false"/>
<CheckBoxPreference android:key="vibrate_enabled" android:title="@string/pref_vibrate_title" android:summary="@string/pref_vibrate_summary" android:defaultValue="true"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_style">
<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="keyboard_height" android:title="@string/pref_keyboard_height_title" android:summary="%s%%" android:defaultValue="35" min="25" max="50"/>
<juloo.common.IntSlideBarPreference android:key="keyboard_height_landscape" android:title="@string/pref_keyboard_height_landscape_title" android:summary="%s%%" android:defaultValue="50" min="35" max="65"/>
<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.IntSlideBarPreference android:key="label_brightness" android:title="@string/pref_label_brightness" android:summary="%s%%" android:defaultValue="100" min="50" max="100"/>
<juloo.common.IntSlideBarPreference android:key="keyboard_opacity" android:title="@string/pref_keyboard_opacity" android:summary="%s%%" android:defaultValue="100" min="0" max="100"/>
<juloo.common.IntSlideBarPreference android:key="key_opacity" android:title="@string/pref_key_opacity" android:summary="%s%%" android:defaultValue="100" min="0" max="100"/>
<juloo.common.IntSlideBarPreference android:key="key_activated_opacity" android:title="@string/pref_key_activated_opacity" android:summary="%s%%" android:defaultValue="100" min="0" max="100"/>
<PreferenceScreen android:title="@string/pref_margin_bottom_title">
<juloo.common.IntSlideBarPreference android:key="margin_bottom_portrait" android:title="@string/pref_portrait" android:summary="%sdp" android:defaultValue="7" min="0" max="100"/>
<juloo.common.IntSlideBarPreference android:key="margin_bottom_landscape" android:title="@string/pref_landscape" android:summary="%sdp" android:defaultValue="3" min="0" max="100"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_keyboard_height_title">
<juloo.common.IntSlideBarPreference android:key="keyboard_height" android:title="@string/pref_portrait" android:summary="%s%%" android:defaultValue="35" min="10" max="50"/>
<juloo.common.IntSlideBarPreference android:key="keyboard_height_landscape" android:title="@string/pref_landscape" android:summary="%s%%" android:defaultValue="50" min="20" max="65"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_horizontal_margin_title">
<juloo.common.IntSlideBarPreference android:key="horizontal_margin_portrait" android:title="@string/pref_portrait" android:summary="%sdp" android:defaultValue="3" min="0" max="30"/>
<juloo.common.IntSlideBarPreference android:key="horizontal_margin_landscape" android:title="@string/pref_landscape" android:summary="%sdp" android:defaultValue="28" min="0" max="200"/>
</PreferenceScreen>
<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>
<PreferenceCategory android:title="@string/pref_category_advanced">
<EditTextPreference android:key="custom_layout" android:title="@string/pref_custom_layout_title" android:summary="@string/pref_custom_layout_summary" android:inputType="text|textMultiLine|textLongMessage"/>
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -59,12 +59,6 @@ final class Autocapitalisation
callback(false);
}
public void typed(char c)
{
type_one_char(c);
callback(false);
}
public void event_sent(int code, int meta)
{
if (meta != 0)

View File

@@ -1,20 +1,19 @@
package juloo.keyboard2;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.Configuration;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.preference.PreferenceManager;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.KeyEvent;
import java.util.Iterator;
import java.util.Set;
import java.util.HashSet;
import java.util.Set;
final class Config
{
private final SharedPreferences _prefs;
// From resources
public final float marginTop;
public final float keyPadding;
@@ -23,28 +22,37 @@ final class Config
public final float sublabelTextSize;
// From preferences
public int layout; // Or '-1' for the system defaults
public int programming_layout; // Or '-1' for none
public KeyboardData layout; // Or 'null' for the system defaults
public KeyboardData second_layout; // Or 'null' for none
public KeyboardData custom_layout; // Might be 'null'
public boolean show_numpad = false;
// From the 'numpad_layout' option, also apply to the numeric pane.
public boolean inverse_numpad = false;
public boolean number_row;
public float swipe_dist_px;
public float slide_step_px;
public boolean vibrateEnabled;
public long longPressTimeout;
public long longPressInterval;
public float marginBottom;
public float margin_bottom;
public float keyHeight;
public float horizontalMargin;
public float horizontal_margin;
public float keyVerticalInterval;
public float keyHorizontalInterval;
public boolean preciseRepeat;
public int labelBrightness; // 0 - 255
public int keyboardOpacity; // 0 - 255
public int keyOpacity; // 0 - 255
public int keyActivatedOpacity; // 0 - 255
public boolean double_tap_lock_shift;
public float characterSize; // Ratio
public int accents; // Values are R.values.pref_accents_v_*
public int theme; // Values are R.style.*
public boolean autocapitalisation;
public boolean switch_input_immediate;
// Dynamically set
public boolean shouldOfferSwitchingToNextInputMethod;
public boolean shouldOfferSwitchingToProgramming;
public boolean shouldOfferSwitchingToSecond;
public String actionLabel; // Might be 'null'
public int actionId; // Meaningful only when 'actionLabel' isn't 'null'
public boolean swapEnterActionKey; // Swap the "enter" and "action" keys
@@ -52,34 +60,21 @@ final class Config
public Set<KeyValue> extra_keys_param;
public final IKeyEventHandler handler;
public boolean orientation_landscape = false;
private Config(Context context, IKeyEventHandler h)
private Config(SharedPreferences prefs, Resources res, IKeyEventHandler h)
{
Resources res = context.getResources();
_prefs = prefs;
// static values
marginTop = res.getDimension(R.dimen.margin_top);
keyPadding = res.getDimension(R.dimen.key_padding);
labelTextSize = 0.33f;
sublabelTextSize = 0.22f;
// default values
layout = -1;
programming_layout = -1;
vibrateEnabled = true;
longPressTimeout = 600;
longPressInterval = 65;
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;
// from prefs
refresh(context);
refresh(res);
// initialized later
shouldOfferSwitchingToNextInputMethod = false;
shouldOfferSwitchingToProgramming = false;
shouldOfferSwitchingToSecond = false;
actionLabel = null;
actionId = 0;
swapEnterActionKey = false;
@@ -90,63 +85,83 @@ final class Config
/*
** Reload prefs
*/
public void refresh(Context context)
public void refresh(Resources res)
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
Resources res = context.getResources();
DisplayMetrics dm = res.getDisplayMetrics();
orientation_landscape = res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
// The height of the keyboard is relative to the height of the screen.
// This is the height of the keyboard if it have 4 rows.
int keyboardHeightPercent;
// Scale some dimensions depending on orientation
float horizontalIntervalScale = 1.f;
float characterSizeScale = 1.f;
String show_numpad_s = prefs.getString("show_numpad", "never");
String show_numpad_s = _prefs.getString("show_numpad", "never");
show_numpad = "always".equals(show_numpad_s);
if (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) // Landscape mode
if (orientation_landscape)
{
if ("landscape".equals(show_numpad_s))
show_numpad = true;
keyboardHeightPercent = prefs.getInt("keyboard_height_landscape", 50);
keyboardHeightPercent = _prefs.getInt("keyboard_height_landscape", 50);
horizontalIntervalScale = 2.f;
characterSizeScale = 1.25f;
}
else
{
keyboardHeightPercent = prefs.getInt("keyboard_height", 35);
keyboardHeightPercent = _prefs.getInt("keyboard_height", 35);
}
String layout_s = prefs.getString("layout", "system");
layout = layout_s.equals("system") ? -1 : layoutId_of_string(layout_s);
String prog_layout_s = prefs.getString("programming_layout", "none");
programming_layout = prog_layout_s.equals("none") ? -1 : layoutId_of_string(prog_layout_s);
// The swipe distance is defined relatively to the "exact physical pixels
// per inch of the screen", which isn't affected by the scaling settings.
// Take the mean of both dimensions as an approximation of the diagonal.
float physical_scaling = (dm.widthPixels + dm.heightPixels) / (dm.xdpi + dm.ydpi);
swipe_dist_px = Float.valueOf(prefs.getString("swipe_dist", "15")) * physical_scaling;;
vibrateEnabled = prefs.getBoolean("vibrate_enabled", vibrateEnabled);
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);
layout = layout_of_string(res, _prefs.getString("layout", "none"));
second_layout = tweak_secondary_layout(layout_of_string(res, _prefs.getString("second_layout", "none")));
custom_layout = KeyboardData.load_string(_prefs.getString("custom_layout", ""));
inverse_numpad = _prefs.getString("numpad_layout", "default").equals("low_first");
number_row = _prefs.getBoolean("number_row", false);
// The baseline for the swipe distance correspond to approximately the
// width of a key in portrait mode, as most layouts have 10 columns.
// Multipled by the DPI ratio because most swipes are made in the diagonals.
// The option value uses an unnamed scale where the baseline is around 25.
float dpi_ratio = Math.max(dm.xdpi, dm.ydpi) / Math.min(dm.xdpi, dm.ydpi);
float swipe_scaling = Math.min(dm.widthPixels, dm.heightPixels) / 10.f * dpi_ratio;
float swipe_dist_value = Float.valueOf(_prefs.getString("swipe_dist", "15"));
swipe_dist_px = swipe_dist_value / 25.f * swipe_scaling;
slide_step_px = swipe_dist_px / 4.f;
vibrateEnabled = _prefs.getBoolean("vibrate_enabled", true);
longPressTimeout = _prefs.getInt("longpress_timeout", 600);
longPressInterval = _prefs.getInt("longpress_interval", 65);
margin_bottom = get_dip_pref(dm, oriented_pref("margin_bottom"),
res.getDimension(R.dimen.margin_bottom));
keyVerticalInterval = get_dip_pref(dm, "key_vertical_space",
res.getDimension(R.dimen.key_vertical_interval));
keyHorizontalInterval =
getDipPref(dm, prefs, "key_horizontal_space", keyHorizontalInterval)
get_dip_pref(dm, "key_horizontal_space",
res.getDimension(R.dimen.key_horizontal_interval))
* horizontalIntervalScale;
// Label brightness is used as the alpha channel
labelBrightness = _prefs.getInt("label_brightness", 100) * 255 / 100;
// Keyboard opacity
keyboardOpacity = _prefs.getInt("keyboard_opacity", 100) * 255 / 100;
keyOpacity = _prefs.getInt("key_opacity", 100) * 255 / 100;
keyActivatedOpacity = _prefs.getInt("key_activated_opacity", 100) * 255 / 100;
// Do not substract keyVerticalInterval from keyHeight because this is done
// during rendered.
keyHeight = dm.heightPixels * keyboardHeightPercent / 100 / 4;
horizontalMargin =
getDipPref(dm, prefs, "horizontal_margin", horizontalMargin)
+ res.getDimension(R.dimen.extra_horizontal_margin);
preciseRepeat = prefs.getBoolean("precise_repeat", preciseRepeat);
double_tap_lock_shift = prefs.getBoolean("lock_double_tap", false);
horizontal_margin =
get_dip_pref(dm, oriented_pref("horizontal_margin"),
res.getDimension(R.dimen.horizontal_margin));
double_tap_lock_shift = _prefs.getBoolean("lock_double_tap", false);
characterSize =
prefs.getFloat("character_size", characterSize)
_prefs.getFloat("character_size", 1.f)
* characterSizeScale;
accents = Integer.valueOf(prefs.getString("accents", "1"));
theme = getThemeId(res, prefs.getString("theme", ""));
autocapitalisation = prefs.getBoolean("autocapitalisation", true);
extra_keys_param = ExtraKeyCheckBoxPreference.get_extra_keys(prefs);
accents = Integer.valueOf(_prefs.getString("accents", "1"));
theme = getThemeId(res, _prefs.getString("theme", ""));
autocapitalisation = _prefs.getBoolean("autocapitalisation", true);
switch_input_immediate = _prefs.getBoolean("switch_input_immediate", false);
extra_keys_param = ExtraKeyCheckBoxPreference.get_extra_keys(_prefs);
}
KeyValue action_key()
{
// Update the name to avoid caching in KeyModifier
return (actionLabel == null) ? null :
KeyValue.getKeyByName("action").withSymbol(actionLabel);
}
/** Update the layout according to the configuration.
@@ -154,18 +169,22 @@ final class Config
* - Remove "localized" keys from other locales (not in 'extra_keys')
* - Replace the action key to show the right label
* - Swap the enter and action keys
* - Add the optional numpad and number row
*/
public KeyboardData modify_layout(KeyboardData original_kw)
public KeyboardData modify_layout(KeyboardData kw)
{
// Update the name to avoid caching in KeyModifier
final KeyValue action_key = (actionLabel == null) ? null :
KeyValue.getKeyByName("action").withSymbol(actionLabel);
final KeyValue action_key = action_key();
// Extra keys are removed from the set as they are encountered during the
// first iteration then automatically added.
final Set<KeyValue> extra_keys = new HashSet<KeyValue>();
extra_keys.addAll(extra_keys_subtype);
final Set<KeyValue> remove_keys = new HashSet<KeyValue>();
if (extra_keys_subtype != null)
extra_keys.addAll(extra_keys_subtype);
extra_keys.addAll(extra_keys_param);
KeyboardData kw = original_kw.mapKeys(new KeyboardData.MapKeyValues() {
boolean number_row = this.number_row && !show_numpad;
if (number_row)
KeyboardData.number_row.getKeys(remove_keys);
kw = kw.mapKeys(new KeyboardData.MapKeyValues() {
public KeyValue apply(KeyValue key, boolean localized)
{
boolean is_extra_key = extra_keys.contains(key);
@@ -173,18 +192,24 @@ final class Config
extra_keys.remove(key);
if (localized && !is_extra_key)
return null;
if (remove_keys.contains(key))
return null;
switch (key.getKind())
{
case Event:
switch (key.getEvent())
{
case CHANGE_METHOD:
return shouldOfferSwitchingToNextInputMethod ? key : null;
if (!shouldOfferSwitchingToNextInputMethod)
return null;
if (switch_input_immediate)
return KeyValue.getKeyByName("change_method_prev");
return key;
case ACTION:
return (swapEnterActionKey && action_key != null) ?
KeyValue.getKeyByName("enter") : action_key;
case SWITCH_PROGRAMMING:
return shouldOfferSwitchingToProgramming ? key : null;
case SWITCH_SECOND:
return shouldOfferSwitchingToSecond ? key : null;
}
break;
case Keyevent:
@@ -206,31 +231,98 @@ final class Config
return key;
}
});
if (show_numpad)
kw = kw.addNumPad();
if (number_row)
kw = kw.addNumberRow();
if (extra_keys.size() > 0)
kw = kw.addExtraKeys(extra_keys.iterator());
if (original_kw.num_pad && show_numpad)
kw = kw.addNumPad();
return kw;
}
private float getDipPref(DisplayMetrics dm, SharedPreferences prefs, String pref_name, float def)
/**
* Handle the numpad layout.
*/
public KeyboardData modify_numpad(KeyboardData kw)
{
final KeyValue action_key = action_key();
return kw.mapKeys(new KeyboardData.MapKeyValues() {
public KeyValue apply(KeyValue key, boolean localized)
{
switch (key.getKind())
{
case Event:
switch (key.getEvent())
{
case ACTION:
return (swapEnterActionKey && action_key != null) ?
KeyValue.getKeyByName("enter") : action_key;
}
break;
case Keyevent:
switch (key.getKeyevent())
{
case KeyEvent.KEYCODE_ENTER:
return (swapEnterActionKey && action_key != null) ? action_key : key;
}
break;
case Char:
char a = key.getChar(), b = a;
if (inverse_numpad)
b = inverse_numpad_char(a);
if (a != b)
return key.withChar(b);
break;
}
return key;
}
});
}
/** Modify a layout to turn it into a secondary layout by changing the
"switch_second" key. */
KeyboardData tweak_secondary_layout(KeyboardData layout)
{
if (layout == null)
return null;
return layout.mapKeys(new KeyboardData.MapKeyValues() {
public KeyValue apply(KeyValue key, boolean localized)
{
if (key.getKind() == KeyValue.Kind.Event
&& key.getEvent() == KeyValue.Event.SWITCH_SECOND)
return KeyValue.getKeyByName("switch_second_back");
return key;
}
});
}
private float get_dip_pref(DisplayMetrics dm, String pref_name, float def)
{
float value;
try { value = prefs.getInt(pref_name, -1); }
catch (Exception e) { value = prefs.getFloat(pref_name, -1f); }
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));
}
/** Returns preference name from a prefix depending on orientation. */
private String oriented_pref(String base_name)
{
String suffix = orientation_landscape ? "_landscape" : "_portrait";
return base_name + suffix;
}
private int getThemeId(Resources res, String theme_name)
{
switch (theme_name)
{
case "light": return R.style.Light;
case "black": return R.style.Black;
case "altblack": return R.style.AltBlack;
case "dark": return R.style.Dark;
case "white": return R.style.White;
case "epaper": return R.style.ePaper;
default:
case "system":
if (Build.VERSION.SDK_INT >= 8)
@@ -243,43 +335,69 @@ final class Config
}
}
public static int layoutId_of_string(String name)
public KeyboardData layout_of_string(Resources res, String name)
{
int id = R.xml.qwerty; // The config might store an invalid layout, don't crash
switch (name)
{
case "azerty": return R.xml.azerty;
case "bangla": return R.xml.bangla;
case "bgph1": return R.xml.local_bgph1;
case "bone": return R.xml.bone;
case "colemak": return R.xml.colemak;
case "dvorak": return R.xml.dvorak;
case "hindi": return R.xml.hindi;
case "jcuken_ua": return R.xml.jcuken_ua;
case "neo2": return R.xml.neo2;
case "qwerty": return R.xml.qwerty;
case "qwerty_el": return R.xml.qwerty_el;
case "qwerty_es": return R.xml.qwerty_es;
case "qwerty_hu": return R.xml.qwerty_hu;
case "qwerty_ko": return R.xml.qwerty_ko;
case "qwerty_lv": return R.xml.qwerty_lv;
case "qwerty_no": return R.xml.qwerty_no;
case "qwerty_pt": return R.xml.qwerty_pt;
case "qwerty_sv_se": return R.xml.qwerty_sv_se;
case "qwerty_tr": return R.xml.qwerty_tr;
case "qwertz": return R.xml.qwertz;
case "qwertz_cs": return R.xml.qwertz_cs;
case "qwertz_de": return R.xml.qwertz_de;
case "qwertz_hu": return R.xml.qwertz_hu;
case "ru_jcuken": return R.xml.local_ru_jcuken;
default: return R.xml.qwerty; // The config might store an invalid layout, don't crash
case "system": case "none": return null;
case "custom": if (custom_layout != null) return custom_layout; break;
case "azerty": id = R.xml.azerty; break;
case "bangla": id = R.xml.bangla; break;
case "bgph1": id = R.xml.local_bgph1; break;
case "bone": id = R.xml.bone; break;
case "colemak": id = R.xml.colemak; break;
case "dvorak": id = R.xml.dvorak; break;
case "devanagari_1": id = R.xml.devanagari_1; break;
case "devanagari_2": id = R.xml.devanagari_2; break;
case "jcuken_ua": id = R.xml.jcuken_ua; break;
case "neo2": id = R.xml.neo2; break;
case "qwerty": id = R.xml.qwerty; break;
case "qwerty_el": id = R.xml.qwerty_el; break;
case "qwerty_es": id = R.xml.qwerty_es; break;
case "qwerty_hu": id = R.xml.qwerty_hu; break;
case "qwerty_ko": id = R.xml.qwerty_ko; break;
case "qwerty_lv": id = R.xml.qwerty_lv; break;
case "qwerty_no": id = R.xml.qwerty_no; break;
case "qwerty_pt": id = R.xml.qwerty_pt; break;
case "qwerty_sv_se": id = R.xml.qwerty_sv_se; break;
case "qwerty_tr": id = R.xml.qwerty_tr; break;
case "qwerty_pl": id = R.xml.qwerty_pl; break;
case "qwerty_vi": id = R.xml.qwerty_vi; break;
case "qwertz": id = R.xml.qwertz; break;
case "qwertz_cs": id = R.xml.qwertz_cs; break;
case "qwertz_de": id = R.xml.qwertz_de; break;
case "qwertz_hu": id = R.xml.qwertz_hu; break;
case "qwertz_sk": id = R.xml.qwertz_sk; break;
case "ru_jcuken": id = R.xml.local_ru_jcuken; break;
case "he_il_1452_1": id = R.xml.he_il_1452_1; break;
case "he_il_1452_2": id = R.xml.he_il_1452_2; break;
case "ar_pc": id = R.xml.ar_pc; break;
case "ar_alt": id = R.xml.ar_alt; break;
}
return KeyboardData.load(res, id);
}
char inverse_numpad_char(char c)
{
switch (c)
{
case '7': return '1';
case '8': return '2';
case '9': return '3';
case '1': return '7';
case '2': return '8';
case '3': return '9';
default: return c;
}
}
private static Config _globalConfig = null;
public static void initGlobalConfig(Context context, IKeyEventHandler handler)
public static void initGlobalConfig(SharedPreferences prefs, Resources res,
IKeyEventHandler handler)
{
_globalConfig = new Config(context, handler);
_globalConfig = new Config(prefs, res, handler);
}
public static Config globalConfig()
@@ -289,6 +407,6 @@ final class Config
public static interface IKeyEventHandler
{
public void handleKeyUp(KeyValue value, Pointers.Modifiers flags);
public void key_up(KeyValue value, Pointers.Modifiers flags);
}
}

View File

@@ -0,0 +1,86 @@
package juloo.keyboard2;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build.VERSION;
import android.preference.PreferenceManager;
import java.util.Map;
import java.util.Set;
public final class DirectBootAwarePreferences
{
/* On API >= 24, preferences are read from the device protected storage. This
* storage is less protected than the default, no personnal or sensitive
* information is stored there (only the keyboard settings). This storage is
* accessible during boot and allow the keyboard to read its settings and
* allow typing the storage password. */
public static SharedPreferences get_shared_preferences(Context context)
{
if (VERSION.SDK_INT < 24)
return PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences prefs = get_protected_prefs(context);
check_need_migration(context, prefs);
return prefs;
}
/* Copy shared preferences to device protected storage. Not using
* [Context.moveSharedPreferencesFrom] because the settings activity still
* use [PreferenceActivity], which can't work on a non-default shared
* preference file. */
public static void copy_preferences_to_protected_storage(Context context,
SharedPreferences src)
{
if (VERSION.SDK_INT >= 24)
copy_shared_preferences(src, get_protected_prefs(context));
}
static SharedPreferences get_protected_prefs(Context context)
{
String pref_name =
PreferenceManager.getDefaultSharedPreferencesName(context);
return context.createDeviceProtectedStorageContext()
.getSharedPreferences(pref_name, Context.MODE_PRIVATE);
}
static void check_need_migration(Context app_context,
SharedPreferences protected_prefs)
{
if (!protected_prefs.getBoolean("need_migration", true))
return;
SharedPreferences prefs;
try
{
prefs = PreferenceManager.getDefaultSharedPreferences(app_context);
}
catch (Exception e)
{
// Device is locked, migrate later.
return;
}
prefs.edit().putBoolean("need_migration", false).commit();
copy_shared_preferences(prefs, protected_prefs);
}
static void copy_shared_preferences(SharedPreferences src, SharedPreferences dst)
{
SharedPreferences.Editor e = dst.edit();
Map<String, ?> entries = src.getAll();
for (String k : entries.keySet())
{
Object v = entries.get(k);
if (v instanceof Boolean)
e.putBoolean(k, (Boolean)v);
else if (v instanceof Float)
e.putFloat(k, (Float)v);
else if (v instanceof Integer)
e.putInt(k, (Integer)v);
else if (v instanceof Long)
e.putLong(k, (Long)v);
else if (v instanceof String)
e.putString(k, (String)v);
else if (v instanceof Set)
e.putStringSet(k, (Set<String>)v);
}
e.commit();
}
}

View File

@@ -19,7 +19,7 @@ public class Emoji
protected Emoji(String name, String bytecode, String desc)
{
_name = name;
_kv = new KeyValue(bytecode, KeyValue.KIND_STRING, 0, 0);
_kv = new KeyValue(bytecode, KeyValue.Kind.String, 0, 0);
_desc = desc;
emojis_by_name.put(name, this);
}

View File

@@ -2,10 +2,8 @@ package juloo.keyboard2;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.preference.PreferenceManager;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@@ -15,16 +13,14 @@ import android.widget.TextView;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Set;
public class EmojiGridView extends GridView
implements GridView.OnItemClickListener
{
public static final int GROUP_LAST_USE = -1;
public static final int COLUMN_WIDTH = 192;
private static final String LAST_USE_PREF = "emoji_last_use";
private Emoji[] _emojiArray;
@@ -39,7 +35,6 @@ public class EmojiGridView extends GridView
super(context, attrs);
Emoji.init(context.getResources());
setOnItemClickListener(this);
setColumnWidth(COLUMN_WIDTH);
loadLastUsed();
setEmojiGroup((_lastUsed.size() == 0) ? 0 : GROUP_LAST_USE);
}
@@ -55,17 +50,10 @@ public class EmojiGridView extends GridView
Config config = Config.globalConfig();
Integer used = _lastUsed.get(_emojiArray[pos]);
_lastUsed.put(_emojiArray[pos], (used == null) ? 1 : used.intValue() + 1);
config.handler.handleKeyUp(_emojiArray[pos].kv(), Pointers.Modifiers.EMPTY);
config.handler.key_up(_emojiArray[pos].kv(), Pointers.Modifiers.EMPTY);
saveLastUsed(); // TODO: opti
}
@Override
public void onMeasure(int wSpec, int hSpec)
{
super.onMeasure(wSpec, hSpec);
setNumColumns(getMeasuredWidth() / COLUMN_WIDTH);
}
private Emoji[] getLastEmojis()
{
final HashMap<Emoji, Integer> map = _lastUsed;
@@ -84,9 +72,10 @@ public class EmojiGridView extends GridView
private void saveLastUsed()
{
SharedPreferences.Editor edit = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
SharedPreferences.Editor edit;
try { edit = emojiSharedPreferences().edit(); }
catch (Exception _e) { return; }
HashSet<String> set = new HashSet<String>();
for (Emoji emoji : _lastUsed.keySet())
set.add(String.valueOf(_lastUsed.get(emoji)) + "-" + emoji.name());
edit.putStringSet(LAST_USE_PREF, set);
@@ -95,16 +84,18 @@ public class EmojiGridView extends GridView
private void loadLastUsed()
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
Set<String> lastUseSet = prefs.getStringSet(LAST_USE_PREF, null);
_lastUsed = new HashMap<Emoji, Integer>();
SharedPreferences prefs;
// Storage might not be available (eg. the device is locked), avoid
// crashing.
try { prefs = emojiSharedPreferences(); }
catch (Exception _e) { return; }
Set<String> lastUseSet = prefs.getStringSet(LAST_USE_PREF, null);
if (lastUseSet != null)
for (String emojiData : lastUseSet)
{
String[] data = emojiData.split("-", 2);
Emoji emoji;
if (data.length != 2)
continue ;
emoji = Emoji.getEmojiByName(data[1]);
@@ -114,14 +105,16 @@ public class EmojiGridView extends GridView
}
}
private static class EmojiView extends TextView
SharedPreferences emojiSharedPreferences()
{
return getContext().getSharedPreferences("emoji_last_use", Context.MODE_PRIVATE);
}
static class EmojiView extends TextView
{
public EmojiView(Context context)
{
super(context);
setTextAppearance(context, R.style.emojiGridButton);
setGravity(Gravity.CENTER);
setLayoutParams(new GridView.LayoutParams(GridView.LayoutParams.WRAP_CONTENT, GridView.LayoutParams.WRAP_CONTENT));
}
public void setEmoji(Emoji emoji)
@@ -130,15 +123,15 @@ public class EmojiGridView extends GridView
}
}
private static class EmojiViewAdpater extends BaseAdapter
static class EmojiViewAdpater extends BaseAdapter
{
private Context _context;
Context _button_context;
private Emoji[] _emojiArray;
Emoji[] _emojiArray;
public EmojiViewAdpater(Context context, Emoji[] emojiArray)
{
_context = context;
_button_context = new ContextThemeWrapper(context, R.style.emojiGridButton);
_emojiArray = emojiArray;
}
@@ -164,9 +157,9 @@ public class EmojiGridView extends GridView
EmojiView view = (EmojiView)convertView;
if (view == null)
view = new EmojiView(_context);
view = new EmojiView(_button_context);
view.setEmoji(_emojiArray[pos]);
return (view);
return view;
}
}
}

View File

@@ -2,11 +2,18 @@ package juloo.keyboard2;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.view.ContextThemeWrapper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout.LayoutParams;
import android.widget.LinearLayout;
public class EmojiGroupButtonsBar extends LinearLayout
{
private EmojiGridView _emoji_grid = null;
public EmojiGroupButtonsBar(Context context, AttributeSet attrs)
{
super(context, attrs);
@@ -19,8 +26,37 @@ public class EmojiGroupButtonsBar extends LinearLayout
}
}
private void add_group(int id, String symbol)
void add_group(int id, String symbol)
{
addView(new EmojiTypeButton(getContext(), id, symbol), new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1.f));
addView(this.new EmojiGroupButton(getContext(), id, symbol),
new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 1.f));
}
EmojiGridView get_emoji_grid()
{
if (_emoji_grid == null)
_emoji_grid = (EmojiGridView)((ViewGroup)(getParent())).findViewById(R.id.emoji_grid);
return _emoji_grid;
}
class EmojiGroupButton extends Button implements View.OnTouchListener
{
int _group_id;
public EmojiGroupButton(Context context, int group_id, String symbol)
{
super(new ContextThemeWrapper(context, R.style.emojiTypeButton), null, 0);
_group_id = group_id;
setText(symbol);
setOnTouchListener(this);
}
public boolean onTouch(View view, MotionEvent event)
{
if (event.getAction() != MotionEvent.ACTION_DOWN)
return false;
get_emoji_grid().setEmojiGroup(_group_id);
return true;
}
}
}

View File

@@ -24,6 +24,6 @@ public class EmojiKeyButton extends Button
public void onClick(View v)
{
Config config = Config.globalConfig();
config.handler.handleKeyUp(_key, Pointers.Modifiers.EMPTY);
config.handler.key_up(_key, Pointers.Modifiers.EMPTY);
}
}

View File

@@ -1,37 +0,0 @@
package juloo.keyboard2;
import android.content.Context;
import android.view.ContextThemeWrapper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
/* Emoji "types" are groups. This class is misnamed. */
public class EmojiTypeButton extends Button
implements View.OnTouchListener
{
private int _emojiType;
static private final int DEFAULT_GROUP = 0;
public EmojiTypeButton(Context context, int group_id, String symbol)
{
super(new ContextThemeWrapper(context, R.style.emojiTypeButton), null, 0);
_emojiType = group_id;
setText(symbol);
setOnTouchListener(this);
}
public boolean onTouch(View view, MotionEvent event)
{
EmojiGridView emojiGrid;
if (event.getAction() != MotionEvent.ACTION_DOWN)
return (false);
emojiGrid = (EmojiGridView)((ViewGroup)(getParent().getParent())).findViewById(R.id.emoji_grid);
emojiGrid.setEmojiGroup(_emojiType);
return (true);
}
}

View File

@@ -31,11 +31,25 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
"accent_breve",
"accent_slash",
"accent_bar",
"accent_dot_below",
"accent_hook_above",
"accent_horn",
"",
"ß",
"£",
"switch_greekmath",
"capslock",
"copy",
"paste",
"cut",
"selectAll",
"shareText",
"pasteAsPlainText",
"undo",
"redo",
"replaceText",
"textAssist",
"autofill",
};
public static boolean default_checked(String name)

View File

@@ -1,41 +1,64 @@
package juloo.keyboard2;
import android.os.Looper;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
class KeyEventHandler implements Config.IKeyEventHandler
{
private IReceiver _recv;
IReceiver _recv;
Autocapitalisation _autocap;
public KeyEventHandler(IReceiver recv)
public int actionId; // Action performed by the Action key.
public KeyEventHandler(Looper looper, IReceiver recv)
{
_recv = recv;
_autocap = new Autocapitalisation(looper,
this.new Autocapitalisation_callback());
}
public void handleKeyUp(KeyValue key, Pointers.Modifiers mods)
/** Editing just started. */
public void started(EditorInfo info)
{
_autocap.started(info, _recv.getCurrentInputConnection());
}
/** Selection has been updated. */
public void selection_updated(int oldSelStart, int newSelStart)
{
_autocap.selection_updated(oldSelStart, newSelStart);
}
/** A key has been released. */
public void key_up(KeyValue key, Pointers.Modifiers mods)
{
if (key == null)
return;
switch (key.getKind())
{
case Char:
_recv.commitChar(key.getChar());
break;
case String:
_recv.commitText(key.getString());
break;
case Char: send_text(String.valueOf(key.getChar())); break;
case String: send_text(key.getString()); break;
case Event:
switch (key.getEvent())
{
case CONFIG: _recv.showKeyboardConfig(); break;
case SWITCH_TEXT: _recv.switchMain(); break;
case SWITCH_NUMERIC: _recv.switchNumeric(); break;
case SWITCH_TEXT: _recv.set_layout(Layout.Current); break;
case SWITCH_NUMERIC: _recv.set_layout(Layout.Numeric); break;
case SWITCH_EMOJI: _recv.setPane_emoji(); break;
case SWITCH_BACK_EMOJI: _recv.setPane_normal(); break;
case CHANGE_METHOD: _recv.switchToNextInputMethod(); break;
case ACTION: _recv.performAction(); break;
case SWITCH_PROGRAMMING: _recv.switchProgramming(); break;
case SWITCH_GREEKMATH: _recv.switchGreekmath(); break;
case CAPS_LOCK: _recv.enableCapsLock(); break;
case CHANGE_METHOD: _recv.switchInputMethod(); break;
case CHANGE_METHOD_PREV: _recv.switchToPrevInputMethod(); break;
case ACTION:
InputConnection conn = _recv.getCurrentInputConnection();
if (conn != null)
conn.performEditorAction(actionId);
break;
case SWITCH_SECOND: _recv.set_layout(Layout.Secondary); break;
case SWITCH_SECOND_BACK: _recv.set_layout(Layout.Primary); break;
case SWITCH_GREEKMATH: _recv.set_layout(Layout.Greekmath); break;
case CAPS_LOCK: _recv.set_shift_state(true, true); break;
}
break;
case Keyevent:
@@ -43,6 +66,28 @@ class KeyEventHandler implements Config.IKeyEventHandler
break;
case Modifier:
break;
case Editing:
send_context_menu_action(action_of_editing_key(key.getEditing()));
break;
}
}
static int action_of_editing_key(KeyValue.Editing e)
{
switch (e)
{
case COPY: return android.R.id.copy;
case PASTE: return android.R.id.paste;
case CUT: return android.R.id.cut;
case SELECT_ALL: return android.R.id.selectAll;
case SHARE: return android.R.id.shareText;
case PASTE_PLAIN: return android.R.id.pasteAsPlainText;
case UNDO: return android.R.id.undo;
case REDO: return android.R.id.redo;
case REPLACE: return android.R.id.replaceText;
case ASSIST: return android.R.id.textAssist;
case AUTOFILL: return android.R.id.autofill;
default: return -1; // sad
}
}
@@ -56,17 +101,17 @@ class KeyEventHandler implements Config.IKeyEventHandler
// getCurrentInputConnection().deleteSurroundingText(before, after);
// }
private int sendMetaKey(int eventCode, int metaFlags, int metaState, boolean down)
int sendMetaKey(int eventCode, int metaFlags, int metaState, boolean down)
{
int action;
int updatedMetaState;
if (down) { action = KeyEvent.ACTION_DOWN; updatedMetaState = metaState | metaFlags; }
else { action = KeyEvent.ACTION_UP; updatedMetaState = metaState & ~metaFlags; }
_recv.sendKeyEvent(action, eventCode, metaState);
send_keyevent(action, eventCode, metaState);
return updatedMetaState;
}
private int sendMetaKeyForModifier(KeyValue.Modifier mod, int metaState, boolean down)
int sendMetaKeyForModifier(KeyValue.Modifier mod, int metaState, boolean down)
{
switch (mod)
{
@@ -85,34 +130,75 @@ class KeyEventHandler implements Config.IKeyEventHandler
/*
* Don't set KeyEvent.FLAG_SOFT_KEYBOARD.
*/
private void handleKeyUpWithModifier(int keyCode, Pointers.Modifiers mods)
{
void handleKeyUpWithModifier(int keyCode, Pointers.Modifiers mods)
{
int metaState = 0;
for (int i = 0; i < mods.size(); i++)
metaState = sendMetaKeyForModifier(mods.get(i), metaState, true);
_recv.sendKeyEvent(KeyEvent.ACTION_DOWN, keyCode, metaState);
_recv.sendKeyEvent(KeyEvent.ACTION_UP, keyCode, metaState);
send_keyevent(KeyEvent.ACTION_DOWN, keyCode, metaState);
send_keyevent(KeyEvent.ACTION_UP, keyCode, metaState);
for (int i = mods.size() - 1; i >= 0; i--)
metaState = sendMetaKeyForModifier(mods.get(i), metaState, false);
}
}
void send_keyevent(int eventAction, int eventCode, int meta)
{
InputConnection conn = _recv.getCurrentInputConnection();
if (conn == null)
return;
conn.sendKeyEvent(new KeyEvent(1, 1, eventAction, eventCode, 0, meta));
if (eventAction == KeyEvent.ACTION_UP)
_autocap.event_sent(eventCode, meta);
}
void send_text(CharSequence text)
{
InputConnection conn = _recv.getCurrentInputConnection();
if (conn == null)
return;
conn.commitText(text, 1);
_autocap.typed(text);
}
/** See {!InputConnection.performContextMenuAction}. */
void send_context_menu_action(int id)
{
InputConnection conn = _recv.getCurrentInputConnection();
if (conn == null)
return;
conn.performContextMenuAction(id);
}
public enum Layout
{
Current, // The primary or secondary layout
Primary,
Secondary,
Numeric,
Greekmath
}
public static interface IReceiver
{
public void switchToNextInputMethod();
public void switchInputMethod();
public void switchToPrevInputMethod();
public void setPane_emoji();
public void setPane_normal();
public void showKeyboardConfig();
public void performAction();
public void enableCapsLock();
public void set_layout(Layout l);
public void set_shift_state(boolean state, boolean lock);
public InputConnection getCurrentInputConnection();
}
public void switchMain();
public void switchNumeric();
public void switchProgramming();
public void switchGreekmath();
public void sendKeyEvent(int eventAction, int eventCode, int meta);
public void commitText(String text);
public void commitChar(char c);
class Autocapitalisation_callback implements Autocapitalisation.Callback
{
@Override
public void update_shift_state(boolean should_enable, boolean should_disable)
{
if (should_enable)
_recv.set_shift_state(true, false);
else if (should_disable)
_recv.set_shift_state(false, false);
}
}
}

View File

@@ -60,10 +60,29 @@ class KeyModifier
case SLASH: return apply_map_char(k, map_char_slash);
case BAR: return apply_map_char(k, map_char_bar);
case ARROW_RIGHT: return apply_combining(k, "\u20D7");
case DOT_BELOW: return apply_map_char(k, map_char_dot_below);
case HORN: return apply_map_char(k, map_char_horn);
case HOOK_ABOVE: return apply_map_char(k, map_char_hook_above);
default: return k;
}
}
/** Modify a key after a long press. */
public static KeyValue modify_long_press(KeyValue k)
{
switch (k.getKind())
{
case Event:
switch (k.getEvent())
{
case CHANGE_METHOD_PREV:
return KeyValue.getKeyByName("change_method");
}
break;
}
return k;
}
private static KeyValue apply_map_char(KeyValue k, Map_char map)
{
switch (k.getKind())
@@ -122,17 +141,7 @@ class KeyModifier
case Char: name = apply_fn_char(k.getChar()); break;
case Keyevent: name = apply_fn_keyevent(k.getKeyevent()); break;
case Event: name = apply_fn_event(k.getEvent()); break;
case String:
switch (k.getString())
{
case "":
if (k == KeyValue.getKeyByName("f11_placeholder"))
name = "f11";
else if (k == KeyValue.getKeyByName("f12_placeholder"))
name = "f12";
break;
}
break;
case Placeholder: name = apply_fn_placeholder(k.getPlaceholder()); break;
}
return (name == null) ? k : KeyValue.getKeyByName(name);
}
@@ -160,6 +169,20 @@ class KeyModifier
}
}
private static String apply_fn_placeholder(KeyValue.Placeholder p)
{
switch (p)
{
case F11: return "f11";
case F12: return "f12";
case SHINDOT: return "shindot";
case SINDOT: return "sindot";
case OLE: return "ole";
case METEG: return "meteg";
default: return null;
}
}
/** Return the name of modified key, or [null]. */
private static String apply_fn_char(char c)
{
@@ -198,6 +221,7 @@ class KeyModifier
case ',': return "·";
case '!': return "¡";
case '?': return "¿";
case '|': return "¦";
// arrows
case '↖': return "";
case '↑': return "";
@@ -243,6 +267,76 @@ class KeyModifier
case '⊂': return "";
case '⊃': return "";
case '±': return "";
// hebrew niqqud
case 'ק': return "qamats"; // kamatz
case 'ר': return "hataf_qamats"; // reduced kamatz
case 'ו': return "holam";
case 'ם': return "rafe";
case 'פ': return "patah"; // patach
case 'ש': return "sheva";
case 'ד': return "dagesh"; // or mapiq
case 'ח': return "hiriq";
case 'ף': return "hataf_patah"; // reduced patach
case 'ז': return "qubuts"; // kubuts
case 'ס': return "segol";
case 'ב': return "hataf_segol"; // reduced segol
case 'צ': return "tsere";
// Devanagari symbols
case 'ए': return "";
case 'े': return "";
case 'ऐ': return "";
case 'ै': return "";
case 'ऋ': return "";
case 'ृ': return "";
case 'ळ': return "";
case 'र': return "";
case 'क': return "";
case 'ख': return "";
case 'ग': return "";
case 'घ': return "";
case 'ढ': return "";
case 'न': return "";
case 'ड': return "";
case 'ट': return "";
case 'ण': return "";
case 'फ': return "";
case 'ऌ': return "";
case 'ॢ': return "";
case 'औ': return "";
case 'ौ': return "";
case 'ओ': return "";
case 'ो': return "";
case 'च': return "";
case 'ज': return "";
case 'ब': return "ॿ";
case 'व': return "";
case 'य': return "";
case 'अ': return "";
case 'आ': return "";
case 'ा': return "";
case 'झ': return "";
case 'ई': return "";
case 'ी': return "";
case 'इ': return "";
case 'ि': return "";
case 'उ': return "";
case 'ऊ': return "";
case 'ु': return "";
case 'ष': return "क्ष";
case 'थ': return "त्र";
case 'द': return "द्र";
case 'प': return "प्र";
case 'श': return "श्र";
case 'छ': return "श्च";
case 'ँ': return "";
case '₹': return "";
case 'ॖ': return "";
case '॓': return "";
case '॰': return "";
case '।': return "";
case 'ं': return "";
case '़': return "";
case 'ऽ': return "";
// other
case ' ': return "nbsp";
default: return null;
@@ -551,4 +645,72 @@ class KeyModifier
}
}
};
private static final Map_char map_char_dot_below =
new Map_char() {
public char apply(char c)
{
switch (c)
{
case 'a': return 'ạ';
case 'ă': return 'ặ';
case 'â': return 'ậ';
case 'e': return 'ẹ';
case 'ê': return 'ệ';
case 'i': return 'ị';
case 'o': return 'ọ';
case 'ô': return 'ộ';
case 'ơ': return 'ợ';
case 'u': return 'ụ';
case 'ư': return 'ự';
case 'y': return 'ỵ';
default: return c;
}
}
};
private static final Map_char map_char_horn =
new Map_char() {
public char apply(char c)
{
switch (c)
{
case 'o': return 'ơ';
case 'ó': return 'ớ';
case 'ò': return 'ờ';
case 'ỏ': return 'ở';
case 'õ': return 'ỡ';
case 'ọ': return 'ợ';
case 'u': return 'ư';
case 'ú': return 'ứ';
case 'ù': return 'ừ';
case 'ủ': return 'ử';
case 'ũ': return 'ữ';
case 'ụ': return 'ự';
default: return c;
}
}
};
private static final Map_char map_char_hook_above =
new Map_char() {
public char apply(char c)
{
switch (c)
{
case 'a': return 'ả';
case 'ă': return 'ẳ';
case 'â': return 'ẩ';
case 'e': return 'ẻ';
case 'ê': return 'ể';
case 'i': return 'ỉ';
case 'o': return 'ỏ';
case 'ô': return 'ổ';
case 'ơ': return 'ở';
case 'u': return 'ủ';
case 'ư': return 'ử';
case 'y': return 'ỷ';
default: return c;
}
}
};
}

View File

@@ -1,6 +1,5 @@
package juloo.keyboard2;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import java.util.HashMap;
@@ -14,8 +13,10 @@ final class KeyValue
SWITCH_EMOJI,
SWITCH_BACK_EMOJI,
CHANGE_METHOD,
CHANGE_METHOD_PREV,
ACTION,
SWITCH_PROGRAMMING,
SWITCH_SECOND,
SWITCH_SECOND_BACK,
SWITCH_GREEKMATH,
CAPS_LOCK,
}
@@ -29,12 +30,15 @@ final class KeyValue
META,
DOUBLE_AIGU,
DOT_ABOVE,
DOT_BELOW,
GRAVE,
AIGU,
CIRCONFLEXE,
TILDE,
CEDILLE,
TREMA,
HORN,
HOOK_ABOVE,
SUPERSCRIPT,
SUBSCRIPT,
RING,
@@ -51,25 +55,51 @@ final class KeyValue
FN, // Must be placed last to be applied first
}
public static enum Editing
{
COPY,
PASTE,
CUT,
SELECT_ALL,
PASTE_PLAIN,
UNDO,
REDO,
// Android context menu actions
REPLACE,
SHARE,
ASSIST,
AUTOFILL,
}
public static enum Placeholder
{
REMOVED,
F11,
F12,
SHINDOT,
SINDOT,
OLE,
METEG
}
public static enum Kind
{
Char, String, Keyevent, Event, Modifier, Editing, Placeholder
}
// Behavior flags.
public static final int FLAG_LATCH = (1 << 20);
public static final int FLAG_LOCK = (1 << 21);
// Special keys are not repeated and don't clear latched modifiers.
public static final int FLAG_SPECIAL = (1 << 22);
public static final int FLAG_PRECISE_REPEAT = (1 << 23);
// Free flag: (1 << 23);
// Rendering flags.
public static final int FLAG_KEY_FONT = (1 << 24);
public static final int FLAG_SMALLER_FONT = (1 << 25);
public static final int FLAG_KEY_FONT = (1 << 24); // special font file
public static final int FLAG_SMALLER_FONT = (1 << 25); // 25% smaller symbols
public static final int FLAG_SECONDARY = (1 << 26); // dimmer
// Used by [Pointers].
public static final int FLAG_LOCKED = (1 << 26);
public static final int FLAG_FAKE_PTR = (1 << 27);
// Kinds
public static final int KIND_CHAR = (0 << 29);
public static final int KIND_STRING = (1 << 29);
public static final int KIND_KEYEVENT = (2 << 29);
public static final int KIND_EVENT = (3 << 29);
public static final int KIND_MODIFIER = (4 << 29);
public static final int FLAG_LOCKED = (1 << 28);
public static final int FLAG_FAKE_PTR = (1 << 29);
// Ranges for the different components
private static final int FLAGS_BITS = (0b111111111 << 20); // 9 bits wide
@@ -83,29 +113,12 @@ final class KeyValue
private final String _symbol;
/** This field encodes three things:
- The kind
- The flags
- The value for Char, Event and Modifier keys.
*/
/** This field encodes three things: Kind, flags and value. */
private final int _code;
public static enum Kind
{
Char, String, Keyevent, Event, Modifier
}
public Kind getKind()
{
switch (_code & KIND_BITS)
{
case KIND_CHAR: return Kind.Char;
case KIND_STRING: return Kind.String;
case KIND_KEYEVENT: return Kind.Keyevent;
case KIND_EVENT: return Kind.Event;
case KIND_MODIFIER: return Kind.Modifier;
default: throw new RuntimeException("Corrupted kind flags");
}
return Kind.values()[(_code & KIND_BITS) >>> 29];
}
public int getFlags()
@@ -149,15 +162,26 @@ final class KeyValue
return Modifier.values()[(_code & VALUE_BITS)];
}
/** Defined only when [getKind() == Kind.Editing]. */
public Editing getEditing()
{
return Editing.values()[(_code & VALUE_BITS)];
}
public Placeholder getPlaceholder()
{
return Placeholder.values()[(_code & VALUE_BITS)];
}
/* Update the char and the symbol. */
public KeyValue withChar(char c)
{
return new KeyValue(String.valueOf(c), KIND_CHAR, c, getFlags());
return new KeyValue(String.valueOf(c), Kind.Char, c, getFlags());
}
public KeyValue withString(String s)
{
return new KeyValue(s, KIND_STRING, 0, getFlags());
return new KeyValue(s, Kind.String, 0, getFlags());
}
public KeyValue withSymbol(String s)
@@ -167,7 +191,7 @@ final class KeyValue
public KeyValue withKeyevent(int code)
{
return new KeyValue(_symbol, KIND_KEYEVENT, code, getFlags());
return new KeyValue(_symbol, Kind.Keyevent, code, getFlags());
}
public KeyValue withFlags(int f)
@@ -178,7 +202,14 @@ final class KeyValue
@Override
public boolean equals(Object obj)
{
KeyValue snd = (KeyValue)obj;
return sameKey((KeyValue)obj);
}
/** Type-safe alternative to [equals]. */
public boolean sameKey(KeyValue snd)
{
if (snd == null)
return false;
return _symbol.equals(snd._symbol) && _code == snd._code;
}
@@ -188,8 +219,6 @@ final class KeyValue
return _symbol.hashCode() + _code;
}
private static HashMap<String, KeyValue> keys = new HashMap<String, KeyValue>();
public KeyValue(String s, int kind, int value, int flags)
{
check((kind & ~KIND_BITS) == 0);
@@ -199,149 +228,210 @@ final class KeyValue
_code = kind | flags | value;
}
public static KeyValue getKeyByName(String name)
public KeyValue(String s, Kind k, int v, int f)
{
KeyValue kv = keys.get(name);
if (kv != null)
return kv;
if (name.length() == 1)
return new KeyValue(name, KIND_CHAR, name.charAt(0), 0);
else
return new KeyValue(name, KIND_STRING, 0, 0);
this(s, (k.ordinal() << 29), v, f);
}
private static void addKey(String name, String symbol, int kind, int code, int flags)
private static KeyValue charKey(String symbol, char c, int flags)
{
keys.put(name, new KeyValue(symbol, kind, code, flags));
return new KeyValue(symbol, Kind.Char, c, flags);
}
private static void addCharKey(String name, String symbol, char c, int flags)
{
addKey(name, symbol, KIND_CHAR, c, flags);
}
private static void addModifierKey(String name, String symbol, Modifier m, int flags)
private static KeyValue modifierKey(String symbol, Modifier m, int flags)
{
if (symbol.length() > 1)
flags |= FLAG_SMALLER_FONT;
addKey(name, symbol, KIND_MODIFIER, m.ordinal(),
FLAG_LATCH | FLAG_SPECIAL | flags);
return new KeyValue(symbol, Kind.Modifier, m.ordinal(),
FLAG_LATCH | FLAG_SPECIAL | FLAG_SECONDARY | flags);
}
private static void addModifierKey(String name, int symbol, Modifier m, int flags)
private static KeyValue modifierKey(int symbol, Modifier m, int flags)
{
addModifierKey(name, String.valueOf((char)symbol), m, flags | FLAG_KEY_FONT);
return modifierKey(String.valueOf((char)symbol), m, flags | FLAG_KEY_FONT);
}
private static void addDiacritic(String name, int symbol, Modifier m)
private static KeyValue diacritic(int symbol, Modifier m)
{
addModifierKey(name, symbol, m, 0);
return new KeyValue(String.valueOf((char)symbol), Kind.Modifier, m.ordinal(),
FLAG_LATCH | FLAG_SPECIAL | FLAG_KEY_FONT);
}
private static void addEventKey(String name, String symbol, Event e, int flags)
private static KeyValue eventKey(String symbol, Event e, int flags)
{
addKey(name, symbol, KIND_EVENT, e.ordinal(), flags | FLAG_SPECIAL);
return new KeyValue(symbol, Kind.Event, e.ordinal(), flags | FLAG_SPECIAL | FLAG_SECONDARY);
}
private static void addEventKey(String name, int symbol, Event e, int flags)
private static KeyValue eventKey(int symbol, Event e, int flags)
{
addEventKey(name, String.valueOf((char)symbol), e, flags | FLAG_KEY_FONT);
return eventKey(String.valueOf((char)symbol), e, flags | FLAG_KEY_FONT);
}
private static void addKeyeventKey(String name, String symbol, int code, int flags)
private static KeyValue keyeventKey(String symbol, int code, int flags)
{
addKey(name, symbol, KIND_KEYEVENT, code, flags);
return new KeyValue(symbol, Kind.Keyevent, code, flags | FLAG_SECONDARY);
}
private static void addKeyeventKey(String name, int symbol, int code, int flags)
private static KeyValue keyeventKey(int symbol, int code, int flags)
{
addKeyeventKey(name, String.valueOf((char)symbol), code, flags | FLAG_KEY_FONT);
return keyeventKey(String.valueOf((char)symbol), code, flags | FLAG_KEY_FONT);
}
// Within VALUE_BITS
private static int placeholder_unique_id = 0;
/** Use a unique id as the value because the symbol is shared between every
placeholders (it is the empty string). */
private static void addPlaceholderKey(String name)
private static KeyValue editingKey(String symbol, Editing action)
{
addKey(name, "", KIND_STRING, placeholder_unique_id++, 0);
return new KeyValue(symbol, Kind.Editing, action.ordinal(),
FLAG_SPECIAL | FLAG_SECONDARY | FLAG_SMALLER_FONT);
}
static
/** A key that do nothing but has a unique ID. */
private static KeyValue placeholderKey(Placeholder id)
{
addModifierKey("shift", 0x0A, Modifier.SHIFT, 0);
addModifierKey("ctrl", "Ctrl", Modifier.CTRL, 0);
addModifierKey("alt", "Alt", Modifier.ALT, 0);
addDiacritic("accent_aigu", 0x50, Modifier.AIGU);
addDiacritic("accent_caron", 0x51, Modifier.CARON);
addDiacritic("accent_cedille", 0x52, Modifier.CEDILLE);
addDiacritic("accent_circonflexe", 0x53, Modifier.CIRCONFLEXE);
addDiacritic("accent_grave", 0x54, Modifier.GRAVE);
addDiacritic("accent_macron", 0x55, Modifier.MACRON);
addDiacritic("accent_ring", 0x56, Modifier.RING);
addDiacritic("accent_tilde", 0x57, Modifier.TILDE);
addDiacritic("accent_trema", 0x58, Modifier.TREMA);
addDiacritic("accent_ogonek", 0x59, Modifier.OGONEK);
addDiacritic("accent_dot_above", 0x5A, Modifier.DOT_ABOVE);
addDiacritic("accent_double_aigu", 0x5B, Modifier.DOUBLE_AIGU);
addDiacritic("accent_slash", 0x5C, Modifier.SLASH);
addDiacritic("accent_arrow_right", 0x5D, Modifier.ARROW_RIGHT);
addDiacritic("accent_breve", 0x5E, Modifier.BREVE);
addDiacritic("accent_bar", 0x5F, Modifier.BAR);
addModifierKey("superscript", "Sup", Modifier.SUPERSCRIPT, 0);
addModifierKey("subscript", "Sub", Modifier.SUBSCRIPT, 0);
addModifierKey("ordinal", "Ord", Modifier.ORDINAL, 0);
addModifierKey("arrows", "Arr", Modifier.ARROWS, 0);
addModifierKey("box", "Box", Modifier.BOX, 0);
addModifierKey("fn", "Fn", Modifier.FN, 0);
addModifierKey("meta", "Meta", Modifier.META, 0);
return new KeyValue("", Kind.Placeholder, id.ordinal(), 0);
}
addEventKey("config", 0x04, Event.CONFIG, FLAG_SMALLER_FONT);
addEventKey("switch_text", "ABC", Event.SWITCH_TEXT, FLAG_SMALLER_FONT);
addEventKey("switch_numeric", "123+", Event.SWITCH_NUMERIC, FLAG_SMALLER_FONT);
addEventKey("switch_emoji", 0x01, Event.SWITCH_EMOJI, FLAG_SMALLER_FONT);
addEventKey("switch_back_emoji", "ABC", Event.SWITCH_BACK_EMOJI, 0);
addEventKey("switch_programming", "Prog", Event.SWITCH_PROGRAMMING, FLAG_SMALLER_FONT);
addEventKey("switch_greekmath", "πλ∇¬", Event.SWITCH_GREEKMATH, FLAG_SMALLER_FONT);
addEventKey("change_method", 0x09, Event.CHANGE_METHOD, FLAG_SMALLER_FONT);
addEventKey("action", "Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
addEventKey("capslock", 0x12, Event.CAPS_LOCK, 0);
private static KeyValue fallbackMakeKey(String name)
{
if (name.length() == 1)
return new KeyValue(name, Kind.Char, name.charAt(0), 0);
else
return new KeyValue(name, Kind.String, 0, 0);
}
addKeyeventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
addKeyeventKey("enter", 0x0E, KeyEvent.KEYCODE_ENTER, 0);
addKeyeventKey("up", 0x05, KeyEvent.KEYCODE_DPAD_UP, FLAG_PRECISE_REPEAT);
addKeyeventKey("right", 0x06, KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_PRECISE_REPEAT);
addKeyeventKey("down", 0x07, KeyEvent.KEYCODE_DPAD_DOWN, FLAG_PRECISE_REPEAT);
addKeyeventKey("left", 0x08, KeyEvent.KEYCODE_DPAD_LEFT, FLAG_PRECISE_REPEAT);
addKeyeventKey("page_up", 0x02, KeyEvent.KEYCODE_PAGE_UP, 0);
addKeyeventKey("page_down", 0x03, KeyEvent.KEYCODE_PAGE_DOWN, 0);
addKeyeventKey("home", 0x0B, KeyEvent.KEYCODE_MOVE_HOME, 0);
addKeyeventKey("end", 0x0C, KeyEvent.KEYCODE_MOVE_END, 0);
addKeyeventKey("backspace", 0x11, KeyEvent.KEYCODE_DEL, 0);
addKeyeventKey("delete", 0x10, KeyEvent.KEYCODE_FORWARD_DEL, 0);
addKeyeventKey("insert", "Ins", KeyEvent.KEYCODE_INSERT, FLAG_SMALLER_FONT);
addKeyeventKey("f1", "F1", KeyEvent.KEYCODE_F1, 0);
addKeyeventKey("f2", "F2", KeyEvent.KEYCODE_F2, 0);
addKeyeventKey("f3", "F3", KeyEvent.KEYCODE_F3, 0);
addKeyeventKey("f4", "F4", KeyEvent.KEYCODE_F4, 0);
addKeyeventKey("f5", "F5", KeyEvent.KEYCODE_F5, 0);
addKeyeventKey("f6", "F6", KeyEvent.KEYCODE_F6, 0);
addKeyeventKey("f7", "F7", KeyEvent.KEYCODE_F7, 0);
addKeyeventKey("f8", "F8", KeyEvent.KEYCODE_F8, 0);
addKeyeventKey("f9", "F9", KeyEvent.KEYCODE_F9, 0);
addKeyeventKey("f10", "F10", KeyEvent.KEYCODE_F10, 0);
addKeyeventKey("f11", "F11", KeyEvent.KEYCODE_F11, FLAG_SMALLER_FONT);
addKeyeventKey("f12", "F12", KeyEvent.KEYCODE_F12, FLAG_SMALLER_FONT);
addKeyeventKey("tab", 0x0F, KeyEvent.KEYCODE_TAB, FLAG_SMALLER_FONT);
public static KeyValue getKeyByName(String name)
{
switch (name)
{
case "shift": return modifierKey(0x0A, Modifier.SHIFT, 0);
case "ctrl": return modifierKey("Ctrl", Modifier.CTRL, 0);
case "alt": return modifierKey("Alt", Modifier.ALT, 0);
case "accent_aigu": return diacritic(0x50, Modifier.AIGU);
case "accent_caron": return diacritic(0x51, Modifier.CARON);
case "accent_cedille": return diacritic(0x52, Modifier.CEDILLE);
case "accent_circonflexe": return diacritic(0x53, Modifier.CIRCONFLEXE);
case "accent_grave": return diacritic(0x54, Modifier.GRAVE);
case "accent_macron": return diacritic(0x55, Modifier.MACRON);
case "accent_ring": return diacritic(0x56, Modifier.RING);
case "accent_tilde": return diacritic(0x57, Modifier.TILDE);
case "accent_trema": return diacritic(0x58, Modifier.TREMA);
case "accent_ogonek": return diacritic(0x59, Modifier.OGONEK);
case "accent_dot_above": return diacritic(0x5A, Modifier.DOT_ABOVE);
case "accent_double_aigu": return diacritic(0x5B, Modifier.DOUBLE_AIGU);
case "accent_slash": return diacritic(0x5C, Modifier.SLASH);
case "accent_arrow_right": return diacritic(0x5D, Modifier.ARROW_RIGHT);
case "accent_breve": return diacritic(0x5E, Modifier.BREVE);
case "accent_bar": return diacritic(0x5F, Modifier.BAR);
case "accent_dot_below": return diacritic(0x60, Modifier.DOT_BELOW);
case "accent_horn": return diacritic(0x61, Modifier.HORN);
case "accent_hook_above": return diacritic(0x62, Modifier.HOOK_ABOVE);
case "superscript": return modifierKey("Sup", Modifier.SUPERSCRIPT, 0);
case "subscript": return modifierKey("Sub", Modifier.SUBSCRIPT, 0);
case "ordinal": return modifierKey("Ord", Modifier.ORDINAL, 0);
case "arrows": return modifierKey("Arr", Modifier.ARROWS, 0);
case "box": return modifierKey("Box", Modifier.BOX, 0);
case "fn": return modifierKey("Fn", Modifier.FN, 0);
case "meta": return modifierKey("Meta", Modifier.META, 0);
addCharKey("\\t", "\\t", '\t', 0); // Send the tab character
addCharKey("space", "\r", ' ', FLAG_KEY_FONT);
addCharKey("nbsp", "\u237d", '\u00a0', FLAG_SMALLER_FONT);
case "config": return eventKey(0x04, Event.CONFIG, FLAG_SMALLER_FONT);
case "switch_text": return eventKey("ABC", Event.SWITCH_TEXT, FLAG_SMALLER_FONT);
case "switch_numeric": return eventKey("123+", Event.SWITCH_NUMERIC, FLAG_SMALLER_FONT);
case "switch_emoji": return eventKey(0x01, Event.SWITCH_EMOJI, FLAG_SMALLER_FONT);
case "switch_back_emoji": return eventKey("ABC", Event.SWITCH_BACK_EMOJI, 0);
case "switch_second": return eventKey(0x13, Event.SWITCH_SECOND, FLAG_SMALLER_FONT);
case "switch_second_back": return eventKey(0x14, Event.SWITCH_SECOND_BACK, FLAG_SMALLER_FONT);
case "switch_greekmath": return eventKey("πλ∇¬", Event.SWITCH_GREEKMATH, FLAG_SMALLER_FONT);
case "change_method": return eventKey(0x09, Event.CHANGE_METHOD, FLAG_SMALLER_FONT);
case "change_method_prev": return eventKey(0x09, Event.CHANGE_METHOD_PREV, FLAG_SMALLER_FONT);
case "action": return eventKey("Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
case "capslock": return eventKey(0x12, Event.CAPS_LOCK, 0);
addPlaceholderKey("removed");
addPlaceholderKey("f11_placeholder");
addPlaceholderKey("f12_placeholder");
case "esc": return keyeventKey("Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
case "enter": return keyeventKey(0x0E, KeyEvent.KEYCODE_ENTER, 0);
case "up": return keyeventKey(0x05, KeyEvent.KEYCODE_DPAD_UP, 0);
case "right": return keyeventKey(0x06, KeyEvent.KEYCODE_DPAD_RIGHT, 0);
case "down": return keyeventKey(0x07, KeyEvent.KEYCODE_DPAD_DOWN, 0);
case "left": return keyeventKey(0x08, KeyEvent.KEYCODE_DPAD_LEFT, 0);
case "page_up": return keyeventKey(0x02, KeyEvent.KEYCODE_PAGE_UP, 0);
case "page_down": return keyeventKey(0x03, KeyEvent.KEYCODE_PAGE_DOWN, 0);
case "home": return keyeventKey(0x0B, KeyEvent.KEYCODE_MOVE_HOME, 0);
case "end": return keyeventKey(0x0C, KeyEvent.KEYCODE_MOVE_END, 0);
case "backspace": return keyeventKey(0x11, KeyEvent.KEYCODE_DEL, 0);
case "delete": return keyeventKey(0x10, KeyEvent.KEYCODE_FORWARD_DEL, 0);
case "insert": return keyeventKey("Ins", KeyEvent.KEYCODE_INSERT, FLAG_SMALLER_FONT);
case "f1": return keyeventKey("F1", KeyEvent.KEYCODE_F1, 0);
case "f2": return keyeventKey("F2", KeyEvent.KEYCODE_F2, 0);
case "f3": return keyeventKey("F3", KeyEvent.KEYCODE_F3, 0);
case "f4": return keyeventKey("F4", KeyEvent.KEYCODE_F4, 0);
case "f5": return keyeventKey("F5", KeyEvent.KEYCODE_F5, 0);
case "f6": return keyeventKey("F6", KeyEvent.KEYCODE_F6, 0);
case "f7": return keyeventKey("F7", KeyEvent.KEYCODE_F7, 0);
case "f8": return keyeventKey("F8", KeyEvent.KEYCODE_F8, 0);
case "f9": return keyeventKey("F9", KeyEvent.KEYCODE_F9, 0);
case "f10": return keyeventKey("F10", KeyEvent.KEYCODE_F10, 0);
case "f11": return keyeventKey("F11", KeyEvent.KEYCODE_F11, FLAG_SMALLER_FONT);
case "f12": return keyeventKey("F12", KeyEvent.KEYCODE_F12, FLAG_SMALLER_FONT);
case "tab": return keyeventKey(0x0F, KeyEvent.KEYCODE_TAB, FLAG_SMALLER_FONT);
case "\\t": return charKey("\\t", '\t', 0); // Send the tab character
case "space": return charKey("\r", ' ', FLAG_KEY_FONT | FLAG_SECONDARY);
case "nbsp": return charKey("\u237d", '\u00a0', FLAG_SMALLER_FONT);
/* bidi */
case "lrm": return charKey("", '\u200e', 0); // Send left-to-right mark
case "rlm": return charKey("", '\u200f', 0); // Send right-to-left mark
case "b(": return charKey("(", ')', 0);
case "b)": return charKey(")", '(', 0);
case "b[": return charKey("[", ']', 0);
case "b]": return charKey("]", '[', 0);
case "b{": return charKey("{", '}', 0);
case "b}": return charKey("}", '{', 0);
case "blt": return charKey("<", '>', 0);
case "bgt": return charKey(">", '<', 0);
case "removed": return placeholderKey(Placeholder.REMOVED);
case "f11_placeholder": return placeholderKey(Placeholder.F11);
case "f12_placeholder": return placeholderKey(Placeholder.F12);
/* hebrew niqqud */
case "qamats": return charKey("\u05E7\u05B8", '\u05B8', 0); // kamatz
case "patah": return charKey("\u05E4\u05B7", '\u05B7', 0); // patach
case "sheva": return charKey("\u05E9\u05B0", '\u05B0', 0);
case "dagesh": return charKey("\u05D3\u05BC", '\u05BC', 0); // or mapiq
case "hiriq": return charKey("\u05D7\u05B4", '\u05B4', 0);
case "segol": return charKey("\u05E1\u05B6", '\u05B6', 0);
case "tsere": return charKey("\u05E6\u05B5", '\u05B5', 0);
case "holam": return charKey("\u05D5\u05B9", '\u05B9', 0);
case "qubuts": return charKey("\u05E7\u05BB", '\u05BB', 0); // kubuts
case "hataf_patah": return charKey("\u05D7\u05B2\u05E4\u05B7", '\u05B2', 0); // reduced patach
case "hataf_qamats": return charKey("\u05D7\u05B3\u05E7\u05B8", '\u05B3', 0); // reduced kamatz
case "hataf_segol": return charKey("\u05D7\u05B1\u05E1\u05B6", '\u05B1', 0); // reduced segol
case "shindot": return charKey("\u05E9\u05C1", '\u05C1', 0);
case "shindot_placeholder": return placeholderKey(Placeholder.SHINDOT);
case "sindot": return charKey("\u05E9\u05C2", '\u05C2', 0);
case "sindot_placeholder": return placeholderKey(Placeholder.SINDOT);
/* hebrew punctuation */
case "geresh": return charKey("\u05F3", '\u05F3', 0);
case "gershayim": return charKey("\u05F4", '\u05F4', 0);
case "maqaf": return charKey("\u05BE", '\u05BE', 0);
/* hebrew biblical */
case "rafe": return charKey("\u05E4\u05BF", '\u05BF', 0);
case "ole": return charKey("\u05E2\u05AB", '\u05AB', 0);
case "ole_placeholder": return placeholderKey(Placeholder.OLE);
case "meteg": return charKey("\u05DE\u05BD", '\u05BD', 0); // or siluq or sof-pasuq
case "meteg_placeholder": return placeholderKey(Placeholder.METEG);
case "copy": return editingKey("copy", Editing.COPY);
case "paste": return editingKey("paste", Editing.PASTE);
case "cut": return editingKey("cut", Editing.CUT);
case "selectAll": return editingKey("s. all", Editing.SELECT_ALL);
case "shareText": return editingKey("share", Editing.SHARE);
case "pasteAsPlainText": return editingKey("<paste>", Editing.PASTE_PLAIN);
case "undo": return editingKey("undo", Editing.UNDO);
case "redo": return editingKey("redo", Editing.REDO);
case "replaceText": return editingKey("repl.", Editing.REPLACE);
case "textAssist": return editingKey("assist", Editing.ASSIST);
case "autofill": return editingKey("auto.", Editing.AUTOFILL);
default: return fallbackMakeKey(name);
}
}
static final HashMap<String, String> keys_descr = new HashMap<String, String>();

View File

@@ -6,66 +6,88 @@ import android.content.SharedPreferences;
import android.inputmethodservice.InputMethodService;
import android.os.Build.VERSION;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.text.InputType;
import android.util.Log;
import android.util.LogPrinter;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.util.Log;
import android.util.LogPrinter;
import java.util.Arrays;
import java.util.List;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class Keyboard2 extends InputMethodService
implements SharedPreferences.OnSharedPreferenceChangeListener,
Autocapitalisation.Callback
implements SharedPreferences.OnSharedPreferenceChangeListener
{
static private final String TAG = "Keyboard2";
private Keyboard2View _keyboardView;
private int _currentTextLayout;
private KeyEventHandler _keyeventhandler;
// If not 'null', the layout to use instead of [_currentTextLayout].
private KeyboardData _currentSpecialLayout;
private Current_text_layout _currentTextLayout;
// Layout associated with the currently selected locale.
private KeyboardData _localeTextLayout;
private ViewGroup _emojiPane = null;
private Config _config;
private Autocapitalisation _autocap;
private boolean _debug_logs = false;
private KeyboardData getLayout(int resId)
/** Layout currently visible. */
KeyboardData current_layout()
{
return KeyboardData.load(getResources(), resId);
if (_currentSpecialLayout != null)
return _currentSpecialLayout;
KeyboardData layout;
if (_currentTextLayout == Current_text_layout.SECONDARY)
layout = _config.second_layout;
else if (_config.layout == null)
layout = _localeTextLayout;
else
layout = _config.layout;
return _config.modify_layout(layout);
}
void setTextLayout(Current_text_layout layout)
{
_currentTextLayout = layout;
_currentSpecialLayout = null;
_keyboardView.setKeyboard(current_layout());
}
void setSpecialLayout(KeyboardData l)
{
_currentSpecialLayout = l;
_keyboardView.setKeyboard(l);
}
KeyboardData loadLayout(int layout_id)
{
return KeyboardData.load(getResources(), layout_id);
}
@Override
public void onCreate()
{
super.onCreate();
PreferenceManager.setDefaultValues(this, R.xml.settings, false);
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
Config.initGlobalConfig(this, new KeyEventHandler(this.new Receiver()));
KeyboardData.init(getResources());
SharedPreferences prefs = DirectBootAwarePreferences.get_shared_preferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
_keyeventhandler = new KeyEventHandler(getMainLooper(), this.new Receiver());
Config.initGlobalConfig(prefs, getResources(), _keyeventhandler);
_config = Config.globalConfig();
_config.refresh(this);
_keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard);
_keyboardView.reset();
_debug_logs = getResources().getBoolean(R.bool.debug_logs);
_autocap = new Autocapitalisation(getMainLooper(), this);
}
public void update_shift_state(boolean should_enable, boolean should_disable)
{
if (should_enable)
_keyboardView.set_shift_state(true, false);
else if (should_disable)
_keyboardView.set_shift_state(false, false);
}
private List<InputMethodSubtype> getEnabledSubtypes(InputMethodManager imm)
@@ -79,16 +101,11 @@ public class Keyboard2 extends InputMethodService
private void refreshSubtypeLayout(InputMethodSubtype subtype)
{
int l = _config.layout;
if (l == -1)
{
String s = subtype.getExtraValueOf("default_layout");
if (s != null)
l = Config.layoutId_of_string(s);
else
l = R.xml.qwerty;
}
_currentTextLayout = l;
String s = subtype.getExtraValueOf("default_layout");
if (s != null)
_localeTextLayout = _config.layout_of_string(getResources(), s);
else
_localeTextLayout = KeyboardData.load(getResources(), R.xml.qwerty);
}
private void extra_keys_of_subtype(Set<KeyValue> dst, InputMethodSubtype subtype)
@@ -132,14 +149,15 @@ public class Keyboard2 extends InputMethodService
case 1: case 2: case 3: _config.extra_keys_subtype = null; break;
case 4: _config.extra_keys_subtype = new HashSet<KeyValue>(); break;
}
// Fallback for the layout option: Use qwerty in the "system settings" case
_currentTextLayout = (_config.layout == -1) ? R.xml.qwerty : _config.layout;
}
private void refreshSubtypeImm()
{
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
_config.shouldOfferSwitchingToNextInputMethod = imm.shouldOfferSwitchingToNextInputMethod(getConnectionToken());
if (VERSION.SDK_INT < 28)
_config.shouldOfferSwitchingToNextInputMethod = true;
else
_config.shouldOfferSwitchingToNextInputMethod = shouldOfferSwitchingToNextInputMethod();
if (VERSION.SDK_INT < 12)
{
// Subtypes won't work well under API level 12 (getExtraValueOf)
@@ -159,9 +177,15 @@ public class Keyboard2 extends InputMethodService
refreshAccentsOption(imm, subtype);
}
}
_config.shouldOfferSwitchingToProgramming =
_config.programming_layout != -1 &&
_currentTextLayout != _config.programming_layout;
if (_config.second_layout == null)
{
_config.shouldOfferSwitchingToSecond = false;
_currentTextLayout = Current_text_layout.PRIMARY;
}
else
{
_config.shouldOfferSwitchingToSecond = true;
}
}
private String actionLabel_of_imeAction(int action)
@@ -189,23 +213,25 @@ public class Keyboard2 extends InputMethodService
if (info.actionLabel != null)
{
_config.actionLabel = info.actionLabel.toString();
_config.actionId = info.actionId;
_keyeventhandler.actionId = info.actionId;
_config.swapEnterActionKey = false;
}
else
{
int action = info.imeOptions & EditorInfo.IME_MASK_ACTION;
_config.actionLabel = actionLabel_of_imeAction(action); // Might be null
_config.actionId = action;
_keyeventhandler.actionId = action;
_config.swapEnterActionKey =
(info.imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) == 0;
}
}
private void refreshConfig()
/** Might re-create the keyboard view. [_keyboardView.setKeyboard()] and
[setInputView()] must be called soon after. */
private void refresh_config()
{
int prev_theme = _config.theme;
_config.refresh(this);
_config.refresh(getResources());
refreshSubtypeImm();
// Refreshing the theme config requires re-creating the views
if (prev_theme != _config.theme)
@@ -213,6 +239,7 @@ public class Keyboard2 extends InputMethodService
_keyboardView = (Keyboard2View)inflate_view(R.layout.keyboard);
_emojiPane = null;
}
_keyboardView.reset();
}
private void log_editor_info(EditorInfo info)
@@ -225,27 +252,30 @@ public class Keyboard2 extends InputMethodService
Log.d(TAG, "actionLabel: "+_config.actionLabel);
}
private int chooseLayout(EditorInfo info)
private void refresh_special_layout(EditorInfo info)
{
switch (info.inputType & InputType.TYPE_MASK_CLASS)
{
case InputType.TYPE_CLASS_NUMBER:
return R.xml.pin;
case InputType.TYPE_CLASS_PHONE:
case InputType.TYPE_CLASS_DATETIME:
return R.xml.pin;
_currentSpecialLayout =
_config.modify_numpad(KeyboardData.load(getResources(), R.xml.pin));
break;
default:
return _currentTextLayout;
_currentSpecialLayout = null;
break;
}
}
@Override
public void onStartInputView(EditorInfo info, boolean restarting)
{
refreshConfig();
refresh_config();
refresh_action_label(info);
_keyboardView.setKeyboard(getLayout(chooseLayout(info)));
_autocap.started(info, getCurrentInputConnection());
refresh_special_layout(info);
_keyboardView.setKeyboard(current_layout());
_keyeventhandler.started(info);
setInputView(_keyboardView);
if (_debug_logs)
log_editor_info(info);
@@ -264,14 +294,14 @@ public class Keyboard2 extends InputMethodService
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype)
{
refreshSubtypeImm();
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
_keyboardView.setKeyboard(current_layout());
}
@Override
public void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)
{
super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd);
_autocap.selection_updated(oldSelStart, newSelStart);
_keyeventhandler.selection_updated(oldSelStart, newSelStart);
}
@Override
@@ -282,9 +312,11 @@ public class Keyboard2 extends InputMethodService
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
public void onSharedPreferenceChanged(SharedPreferences _prefs, String _key)
{
refreshConfig();
refresh_config();
setInputView(_keyboardView);
_keyboardView.setKeyboard(current_layout());
}
@Override
@@ -297,12 +329,21 @@ public class Keyboard2 extends InputMethodService
/** Not static */
public class Receiver implements KeyEventHandler.IReceiver
{
public void switchToNextInputMethod()
public void switchInputMethod()
{
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
// deprecated in version 28: imm.switchToNextInputMethod(getConnectionToken(), false);
// added in version 28: switchToNextInputMethod(false);
}
public void switchToPrevInputMethod()
{
if (VERSION.SDK_INT < 28)
{
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
imm.switchToLastInputMethod(getConnectionToken());
}
else
Keyboard2.this.switchToPreviousInputMethod();
}
public void setPane_emoji()
@@ -317,59 +358,33 @@ public class Keyboard2 extends InputMethodService
setInputView(_keyboardView);
}
public void performAction()
public void set_shift_state(boolean state, boolean lock)
{
InputConnection conn = getCurrentInputConnection();
if (conn == null)
return;
conn.performEditorAction(_config.actionId);
_keyboardView.set_shift_state(state, lock);
}
public void enableCapsLock()
public void set_layout(KeyEventHandler.Layout l)
{
_keyboardView.set_shift_state(true, true);
}
public void switchMain()
{
_keyboardView.setKeyboard(getLayout(_currentTextLayout));
}
public void switchNumeric()
{
_keyboardView.setKeyboard(getLayout(R.xml.numeric));
}
public void switchGreekmath()
{
_keyboardView.setKeyboard(getLayout(R.xml.greekmath));
}
public void switchProgramming()
{
if (_config.programming_layout == -1)
return;
KeyboardData layout =
getLayout(_config.programming_layout).mapKeys(new KeyboardData.MapKeyValues() {
public KeyValue apply(KeyValue key, boolean localized)
{
if (key.getKind() == KeyValue.Kind.Event
&& key.getEvent() == KeyValue.Event.SWITCH_PROGRAMMING)
return KeyValue.getKeyByName("switch_text");
return key;
}
});
_keyboardView.setKeyboard(layout);
}
public void sendKeyEvent(int eventAction, int eventCode, int meta)
{
InputConnection conn = getCurrentInputConnection();
if (conn == null)
return;
conn.sendKeyEvent(new KeyEvent(1, 1, eventAction, eventCode, 0, meta));
if (eventAction == KeyEvent.ACTION_UP)
_autocap.event_sent(eventCode, meta);
switch (l)
{
case Current:
_currentSpecialLayout = null;
_keyboardView.setKeyboard(current_layout());
break;
case Primary:
setTextLayout(Current_text_layout.PRIMARY);
break;
case Secondary:
if (_config.second_layout != null)
setTextLayout(Current_text_layout.SECONDARY);
break;
case Numeric:
setSpecialLayout(_config.modify_numpad(loadLayout(R.xml.numeric)));
break;
case Greekmath:
setSpecialLayout(_config.modify_numpad(loadLayout(R.xml.greekmath)));
break;
}
}
public void showKeyboardConfig()
@@ -379,16 +394,9 @@ public class Keyboard2 extends InputMethodService
startActivity(intent);
}
public void commitText(String text)
public InputConnection getCurrentInputConnection()
{
getCurrentInputConnection().commitText(text, 1);
_autocap.typed(text);
}
public void commitChar(char c)
{
sendKeyChar(c);
_autocap.typed(c);
return Keyboard2.this.getCurrentInputConnection();
}
}
@@ -401,4 +409,10 @@ public class Keyboard2 extends InputMethodService
{
return View.inflate(new ContextThemeWrapper(this, _config.theme), layout, null);
}
private static enum Current_text_layout
{
PRIMARY,
SECONDARY
}
}

View File

@@ -4,16 +4,17 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.inputmethodservice.InputMethodService;
import android.os.Build.VERSION;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import java.util.Arrays;
public class Keyboard2View extends View
implements View.OnTouchListener, Pointers.IPointerEventHandler
@@ -80,7 +81,7 @@ public class Keyboard2View extends View
public void setKeyboard(KeyboardData kw)
{
_keyboard = _config.modify_layout(kw);
_keyboard = kw;
_shift_kv = KeyValue.getKeyByName("shift");
_shift_key = _keyboard.findKeyWithValue(_shift_kv);
if (_shift_key == null)
@@ -104,10 +105,19 @@ public class Keyboard2View extends View
{
if (_keyboard == null || _shift_key == null)
return;
int flags = _pointers.getKeyFlags(_shift_key, _shift_kv);
if (state)
{
if (flags != -1 && !lock)
return; // Don't replace an existing pointer
_pointers.add_fake_pointer(_shift_kv, _shift_key, lock);
}
else
{
if ((flags & KeyValue.FLAG_FAKE_PTR) != 0)
return; // Don't remove locked pointers
_pointers.remove_fake_pointer(_shift_kv, _shift_key);
}
invalidate();
}
@@ -124,13 +134,13 @@ public class Keyboard2View extends View
public void onPointerUp(KeyValue k, Pointers.Modifiers mods)
{
_config.handler.handleKeyUp(k, mods);
_config.handler.key_up(k, mods);
invalidate();
}
public void onPointerHold(KeyValue k, Pointers.Modifiers mods)
{
_config.handler.handleKeyUp(k, mods);
_config.handler.key_up(k, mods);
}
public void onPointerFlagsChanged(boolean shouldVibrate)
@@ -169,7 +179,7 @@ public class Keyboard2View extends View
_pointers.onTouchMove(event.getX(p), event.getY(p), event.getPointerId(p));
break;
case MotionEvent.ACTION_CANCEL:
_pointers.onTouchCancel(event.getPointerId(event.getActionIndex()));
_pointers.onTouchCancel();
break;
default:
return (false);
@@ -194,7 +204,7 @@ public class Keyboard2View extends View
private KeyboardData.Key getKeyAtPosition(float tx, float ty)
{
KeyboardData.Row row = getRowAtPosition(ty);
float x = _config.horizontalMargin;
float x = _config.horizontal_margin;
if (row == null || tx < x)
return null;
for (KeyboardData.Key key : row.keys)
@@ -228,44 +238,69 @@ public class Keyboard2View extends View
int width = dm.widthPixels;
int height =
(int)(_config.keyHeight * _keyboard.keysHeight
+ _keyboard.rows.size()
+ _config.marginTop + _config.marginBottom);
+ _config.marginTop + _config.margin_bottom);
setMeasuredDimension(width, height);
_keyWidth = (width - (_config.horizontalMargin * 2)) / _keyboard.keysWidth;
_keyWidth = (width - (_config.horizontal_margin * 2)) / _keyboard.keysWidth;
}
@Override
public void onLayout(boolean changed, int left, int top, int right, int bottom)
{
if (!changed)
return;
if (VERSION.SDK_INT >= 29)
{
// Disable the back-gesture on the keyboard area
Rect keyboard_area = new Rect(
left + (int)_config.horizontal_margin,
top + (int)_config.marginTop,
right - (int)_config.horizontal_margin,
bottom - (int)_config.margin_bottom);
setSystemGestureExclusionRects(Arrays.asList(keyboard_area));
}
}
/** Horizontal and vertical position of the 9 indexes. */
static final Paint.Align[] LABEL_POSITION_H = new Paint.Align[]{
Paint.Align.CENTER, Paint.Align.LEFT, Paint.Align.RIGHT, Paint.Align.LEFT,
Paint.Align.RIGHT, Paint.Align.LEFT, Paint.Align.RIGHT,
Paint.Align.CENTER, Paint.Align.CENTER
};
static final Vertical[] LABEL_POSITION_V = new Vertical[]{
Vertical.CENTER, Vertical.TOP, Vertical.TOP, Vertical.BOTTOM,
Vertical.BOTTOM, Vertical.CENTER, Vertical.CENTER, Vertical.TOP,
Vertical.BOTTOM
};
@Override
protected void onDraw(Canvas canvas)
{
updateFlags();
// Set keyboard background opacity
getBackground().setAlpha(_config.keyboardOpacity);
// Set keys opacity
_theme.keyBgPaint.setAlpha(_config.keyOpacity);
_theme.keyDownBgPaint.setAlpha(_config.keyActivatedOpacity);
_theme.keyBorderPaint.setAlpha(_config.keyOpacity);
float y = _config.marginTop + _config.keyVerticalInterval / 2;
for (KeyboardData.Row row : _keyboard.rows)
{
y += row.shift * _config.keyHeight;
float x = _config.horizontalMargin + _config.keyHorizontalInterval / 2;
float x = _config.horizontal_margin + _config.keyHorizontalInterval / 2;
float keyH = row.height * _config.keyHeight - _config.keyVerticalInterval;
for (KeyboardData.Key k : row.keys)
{
x += k.shift * _keyWidth;
float keyW = _keyWidth * k.width - _config.keyHorizontalInterval;
boolean isKeyDown = _pointers.isKeyDown(k);
_tmpRect.set(x, y, x + keyW, y + keyH);
canvas.drawRoundRect(_tmpRect, _theme.keyBorderRadius, _theme.keyBorderRadius,
isKeyDown ? _theme.keyDownBgPaint : _theme.keyBgPaint);
drawLabel(canvas, k.key0, keyW / 2f + x, y, keyH, isKeyDown);
if (k.edgekeys)
drawKeyFrame(canvas, x, y, keyW, keyH, isKeyDown);
if (k.keys[0] != null)
drawLabel(canvas, k.keys[0], keyW / 2f + x, y, keyH, isKeyDown);
for (int i = 1; i < 9; i++)
{
drawSubLabel(canvas, k.key1, x, y, keyW, keyH, Paint.Align.CENTER, Vertical.TOP, isKeyDown);
drawSubLabel(canvas, k.key3, x, y, keyW, keyH, Paint.Align.LEFT, Vertical.CENTER, isKeyDown);
drawSubLabel(canvas, k.key2, x, y, keyW, keyH, Paint.Align.RIGHT, Vertical.CENTER, isKeyDown);
drawSubLabel(canvas, k.key4, x, y, keyW, keyH, Paint.Align.CENTER, Vertical.BOTTOM, isKeyDown);
}
else
{
drawSubLabel(canvas, k.key1, x, y, keyW, keyH, Paint.Align.LEFT, Vertical.TOP, isKeyDown);
drawSubLabel(canvas, k.key3, x, y, keyW, keyH, Paint.Align.LEFT, Vertical.BOTTOM, isKeyDown);
drawSubLabel(canvas, k.key2, x, y, keyW, keyH, Paint.Align.RIGHT, Vertical.TOP, isKeyDown);
drawSubLabel(canvas, k.key4, x, y, keyW, keyH, Paint.Align.RIGHT, Vertical.BOTTOM, isKeyDown);
if (k.keys[i] != null)
drawSubLabel(canvas, k.keys[i], x, y, keyW, keyH, i, isKeyDown);
}
if (k.indication != null)
{
@@ -283,48 +318,83 @@ public class Keyboard2View extends View
super.onDetachedFromWindow();
}
private int labelColor(KeyValue k, boolean isKeyDown, int defaultColor)
/** Draw borders and background of the key. */
void drawKeyFrame(Canvas canvas, float x, float y, float keyW, float keyH,
boolean isKeyDown)
{
if (isKeyDown && k.hasFlags(KeyValue.FLAG_LATCH))
float r = _theme.keyBorderRadius;
float w = isKeyDown ? _theme.keyBorderWidthActivated : _theme.keyBorderWidth;
float w2 = _theme.keyBorderWidth / 2.f;
_tmpRect.set(x + w2, y + w2, x + keyW - w2, y + keyH - w2);
canvas.drawRoundRect(_tmpRect, r, r,
isKeyDown ? _theme.keyDownBgPaint : _theme.keyBgPaint);
if (w > 0.f)
{
_theme.keyBorderPaint.setStrokeWidth(w);
float overlap = r - r * 0.85f + w; // sin(45°)
drawBorder(canvas, x, y, x + overlap, y + keyH, _theme.keyBorderColorLeft);
drawBorder(canvas, x, y, x + keyW, y + overlap, _theme.keyBorderColorTop);
drawBorder(canvas, x + keyW - overlap, y, x + keyW, y + keyH, _theme.keyBorderColorRight);
drawBorder(canvas, x, y + keyH - overlap, x + keyW, y + keyH, _theme.keyBorderColorBottom);
}
}
/** Clip to draw a border at a time. This allows to call [drawRoundRect]
several time with the same parameters but a different Paint. */
void drawBorder(Canvas canvas, float clipl, float clipt, float clipr,
float clipb, int color)
{
Paint p = _theme.keyBorderPaint;
float r = _theme.keyBorderRadius;
canvas.save();
canvas.clipRect(clipl, clipt, clipr, clipb);
p.setColor(color);
canvas.drawRoundRect(_tmpRect, r, r, p);
canvas.restore();
}
private int labelColor(KeyValue k, boolean isKeyDown, boolean sublabel)
{
if (isKeyDown)
{
int flags = _pointers.getKeyFlags(k);
if (flags != -1)
{
if ((flags & KeyValue.FLAG_LOCKED) != 0)
return _theme.lockedColor;
if ((flags & KeyValue.FLAG_LATCH) == 0)
return _theme.activatedColor;
return _theme.activatedColor;
}
}
return defaultColor;
if (k.hasFlags(KeyValue.FLAG_SECONDARY))
return _theme.secondaryLabelColor;
return sublabel ? _theme.subLabelColor : _theme.labelColor;
}
private void drawLabel(Canvas canvas, KeyboardData.Corner k, float x, float y, float keyH, boolean isKeyDown)
private void drawLabel(Canvas canvas, KeyValue kv, float x, float y, float keyH, boolean isKeyDown)
{
if (k == null)
return;
KeyValue kv = KeyModifier.modify(k.kv, _mods);
kv = KeyModifier.modify(kv, _mods);
if (kv == null)
return;
float textSize = scaleTextSize(kv, _config.labelTextSize, keyH);
Paint p = _theme.labelPaint(kv.hasFlags(KeyValue.FLAG_KEY_FONT));
p.setColor(labelColor(kv, isKeyDown, _theme.labelColor));
p.setColor(labelColor(kv, isKeyDown, false));
p.setAlpha(_config.labelBrightness);
p.setTextSize(textSize);
canvas.drawText(kv.getString(), x, (keyH - p.ascent() - p.descent()) / 2f + y, p);
}
private void drawSubLabel(Canvas canvas, KeyboardData.Corner k, float x,
float y, float keyW, float keyH, Paint.Align a, Vertical v,
boolean isKeyDown)
private void drawSubLabel(Canvas canvas, KeyValue kv, float x, float y,
float keyW, float keyH, int sub_index, boolean isKeyDown)
{
if (k == null)
return;
KeyValue kv = KeyModifier.modify(k.kv, _mods);
Paint.Align a = LABEL_POSITION_H[sub_index];
Vertical v = LABEL_POSITION_V[sub_index];
kv = KeyModifier.modify(kv, _mods);
if (kv == null)
return;
float textSize = scaleTextSize(kv, _config.sublabelTextSize, keyH);
Paint p = _theme.subLabelPaint(kv.hasFlags(KeyValue.FLAG_KEY_FONT), a);
p.setColor(labelColor(kv, isKeyDown, _theme.subLabelColor));
p.setColor(labelColor(kv, isKeyDown, true));
p.setAlpha(_config.labelBrightness);
p.setTextSize(textSize);
float subPadding = _config.keyPadding;
if (v == Vertical.CENTER)

View File

@@ -2,12 +2,17 @@ package juloo.keyboard2;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.util.Xml;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.function.Function;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import org.xmlpull.v1.XmlPullParser;
class KeyboardData
{
@@ -16,17 +21,13 @@ class KeyboardData
public final float keysWidth;
/** Total height of the keyboard. */
public final float keysHeight;
/** Whether to add extra keys. */
public final boolean extra_keys;
/** Whether to possibly add NumPad. */
public final boolean num_pad;
public KeyboardData mapKeys(MapKey f)
{
ArrayList<Row> rows_ = new ArrayList<Row>();
for (Row r : rows)
rows_.add(r.mapKeys(f));
return new KeyboardData(rows_, keysWidth, extra_keys, num_pad);
return new KeyboardData(rows_, keysWidth);
}
/** Add keys from the given iterator into the keyboard. Extra keys are added
@@ -35,8 +36,6 @@ class KeyboardData
* third row. */
public KeyboardData addExtraKeys(Iterator<KeyValue> k)
{
if (!extra_keys)
return this;
ArrayList<Row> rows = new ArrayList<Row>(this.rows);
addExtraKeys_to_row(rows, k, 1, 4);
addExtraKeys_to_row(rows, k, 1, 3);
@@ -48,15 +47,13 @@ class KeyboardData
for (int c = 1; c <= 4; c++)
addExtraKeys_to_row(rows, k, r, c);
}
return new KeyboardData(rows, keysWidth, extra_keys, num_pad);
return new KeyboardData(rows, keysWidth);
}
public KeyboardData addNumPad()
{
if (!num_pad || _numPadKeyboardData == null)
return this;
ArrayList<Row> extendedRows = new ArrayList<Row>();
Iterator<Row> iterNumPadRows = _numPadKeyboardData.rows.iterator();
Iterator<Row> iterNumPadRows = num_pad.rows.iterator();
for (Row row : rows)
{
ArrayList<KeyboardData.Key> keys = new ArrayList<Key>(row.keys);
@@ -73,7 +70,14 @@ class KeyboardData
}
extendedRows.add(new Row(keys, row.height, row.shift));
}
return new KeyboardData(extendedRows, compute_max_width(extendedRows), extra_keys, num_pad);
return new KeyboardData(extendedRows, compute_max_width(extendedRows));
}
public KeyboardData addNumberRow()
{
ArrayList<Row> rows_ = new ArrayList<Row>(this.rows);
rows_.add(0, number_row.updateWidth(keysWidth));
return new KeyboardData(rows_, keysWidth);
}
public Key findKeyWithValue(KeyValue kv)
@@ -87,6 +91,12 @@ class KeyboardData
return null;
}
public void getKeys(Set<KeyValue> dst)
{
for (Row r : rows)
r.getKeys(dst);
}
private static void addExtraKeys_to_row(ArrayList<Row> rows, final Iterator<KeyValue> extra_keys, int row_i, final int d)
{
if (!extra_keys.hasNext())
@@ -101,10 +111,26 @@ class KeyboardData
}));
}
private static Row _bottomRow = null;
private static KeyboardData _numPadKeyboardData = null;
public static Row bottom_row;
public static Row number_row;
public static KeyboardData num_pad;
private static Map<Integer, KeyboardData> _layoutCache = new HashMap<Integer, KeyboardData>();
public static void init(Resources res)
{
try
{
bottom_row = parse_row(res.getXml(R.xml.bottom_row));
number_row = parse_row(res.getXml(R.xml.number_row));
num_pad = parse_keyboard(res.getXml(R.xml.numpad));
}
catch (Exception e)
{
e.printStackTrace();
}
}
/** Load a layout from a resource ID. Returns [null] on error. */
public static KeyboardData load(Resources res, int id)
{
KeyboardData l = _layoutCache.get(id);
@@ -112,13 +138,9 @@ class KeyboardData
{
try
{
if (_bottomRow == null)
_bottomRow = parse_bottom_row(res.getXml(R.xml.bottom_row));
if (_numPadKeyboardData == null)
{
_numPadKeyboardData = parse_keyboard(res.getXml(R.xml.numpad));
}
l = parse_keyboard(res.getXml(id));
XmlResourceParser parser = res.getXml(id);
l = parse_keyboard(parser);
parser.close();
_layoutCache.put(id, l);
}
catch (Exception e)
@@ -129,21 +151,34 @@ class KeyboardData
return l;
}
private static KeyboardData parse_keyboard(XmlResourceParser parser) throws Exception
/** Load a layout from a string. Returns [null] on error. */
public static KeyboardData load_string(String src)
{
try
{
XmlPullParser parser = Xml.newPullParser();
parser.setInput(new StringReader(src));
return parse_keyboard(parser);
}
catch (Exception e)
{
return null;
}
}
private static KeyboardData parse_keyboard(XmlPullParser parser) throws Exception
{
if (!expect_tag(parser, "keyboard"))
throw new Exception("Empty layout file");
boolean bottom_row = parser.getAttributeBooleanValue(null, "bottom_row", true);
boolean extra_keys = parser.getAttributeBooleanValue(null, "extra_keys", true);
boolean num_pad = parser.getAttributeBooleanValue(null, "num_pad", true);
float specified_kw = parser.getAttributeFloatValue(null, "width", 0f);
boolean add_bottom_row = attribute_bool(parser, "bottom_row", true);
float specified_kw = attribute_float(parser, "width", 0f);
ArrayList<Row> rows = new ArrayList<Row>();
while (expect_tag(parser, "row"))
rows.add(Row.parse(parser));
float kw = (specified_kw != 0f) ? specified_kw : compute_max_width(rows);
if (bottom_row)
rows.add(_bottomRow.updateWidth(kw));
return new KeyboardData(rows, kw, extra_keys, num_pad);
if (add_bottom_row)
rows.add(bottom_row.updateWidth(kw));
return new KeyboardData(rows, kw);
}
private static float compute_max_width(List<Row> rows)
@@ -154,14 +189,14 @@ class KeyboardData
return w;
}
private static Row parse_bottom_row(XmlResourceParser parser) throws Exception
private static Row parse_row(XmlPullParser parser) throws Exception
{
if (!expect_tag(parser, "row"))
throw new Exception("Failed to parse bottom row");
throw new Exception("Failed to parse row");
return Row.parse(parser);
}
protected KeyboardData(List<Row> rows_, float kw, boolean xk, boolean np)
protected KeyboardData(List<Row> rows_, float kw)
{
float kh = 0.f;
for (Row r : rows_)
@@ -169,8 +204,6 @@ class KeyboardData
rows = rows_;
keysWidth = kw;
keysHeight = kh;
extra_keys = xk;
num_pad = np;
}
public static class Row
@@ -193,17 +226,23 @@ class KeyboardData
keysWidth = kw;
}
public static Row parse(XmlResourceParser parser) throws Exception
public static Row parse(XmlPullParser parser) throws Exception
{
ArrayList<Key> keys = new ArrayList<Key>();
int status;
float h = parser.getAttributeFloatValue(null, "height", 1f);
float shift = parser.getAttributeFloatValue(null, "shift", 0f);
float h = attribute_float(parser, "height", 1f);
float shift = attribute_float(parser, "shift", 0f);
while (expect_tag(parser, "key"))
keys.add(Key.parse(parser));
return new Row(keys, h, shift);
}
public void getKeys(Set<KeyValue> dst)
{
for (Key k : keys)
k.getKeys(dst);
}
public Row mapKeys(MapKey f)
{
ArrayList<Key> keys_ = new ArrayList<Key>();
@@ -232,187 +271,129 @@ class KeyboardData
public static class Key
{
/*
** 1 2
** 0
** 3 4
/**
* 1 7 2
* 5 0 6
* 3 8 4
*/
public final Corner key0;
public final Corner key1;
public final Corner key2;
public final Corner key3;
public final Corner key4;
public final KeyValue[] keys;
/** Pack flags for every key values. Flags are: [F_LOC]. */
private final int keysflags;
/** Key width in relative unit. */
public final float width;
/** Extra empty space on the left of the key. */
public final float shift;
/** Put keys 1 to 4 on the edges instead of the corners. */
public final boolean edgekeys;
/** Keys 2 and 3 are repeated as the finger moves laterally on the key.
Used for the left and right arrow keys on the space bar. */
public final boolean slider;
/** String printed on the keys. It has no other effect. */
public final String indication;
protected Key(Corner k0, Corner k1, Corner k2, Corner k3, Corner k4, float w, float s, boolean e, String i)
/** 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, int f, float w, float s, boolean sl, String i)
{
key0 = k0;
key1 = k1;
key2 = k2;
key3 = k3;
key4 = k4;
keys = ks;
keysflags = f;
width = w;
shift = s;
edgekeys = e;
slider = sl;
indication = i;
}
public static Key parse(XmlResourceParser parser) throws Exception
/** Write the parsed key into [ks] at [index]. Doesn't write if the
attribute is not present. Return flags that can be aggregated into the
value for [keysflags]. */
static int parse_key_attr(XmlPullParser parser, String attr, KeyValue[] ks,
int index)
throws Exception
{
Corner k0 = Corner.parse_of_attr(parser, "key0");
Corner k1 = Corner.parse_of_attr(parser, "key1");
Corner k2 = Corner.parse_of_attr(parser, "key2");
Corner k3 = Corner.parse_of_attr(parser, "key3");
Corner k4 = Corner.parse_of_attr(parser, "key4");
float width = parser.getAttributeFloatValue(null, "width", 1f);
float shift = parser.getAttributeFloatValue(null, "shift", 0.f);
boolean edgekeys = parser.getAttributeBooleanValue(null, "edgekeys", false);
String name = parser.getAttributeValue(null, attr);
int flags = 0;
if (name == null)
return 0;
String name_loc = stripPrefix(name, "loc ");
if (name_loc != null)
{
flags |= F_LOC;
name = name_loc;
}
ks[index] = KeyValue.getKeyByName(name);
return (flags << index);
}
static String stripPrefix(String s, String prefix)
{
return s.startsWith(prefix) ? s.substring(prefix.length()) : null;
}
public static Key parse(XmlPullParser parser) throws Exception
{
KeyValue[] ks = new KeyValue[9];
int keysflags = 0;
keysflags |= parse_key_attr(parser, "key0", ks, 0);
keysflags |= parse_key_attr(parser, "key1", ks, 1);
keysflags |= parse_key_attr(parser, "key2", ks, 2);
keysflags |= parse_key_attr(parser, "key3", ks, 3);
keysflags |= parse_key_attr(parser, "key4", ks, 4);
keysflags |= parse_key_attr(parser, "key5", ks, 5);
keysflags |= parse_key_attr(parser, "key6", ks, 6);
keysflags |= parse_key_attr(parser, "key7", ks, 7);
keysflags |= parse_key_attr(parser, "key8", ks, 8);
float width = attribute_float(parser, "width", 1f);
float shift = attribute_float(parser, "shift", 0.f);
boolean slider = attribute_bool(parser, "slider", false);
String indication = parser.getAttributeValue(null, "indication");
while (parser.next() != XmlResourceParser.END_TAG)
continue ;
return new Key(k0, k1, k2, k3, k4, width, shift, edgekeys, indication);
while (parser.next() != XmlPullParser.END_TAG)
continue;
return new Key(ks, keysflags, width, shift, slider, indication);
}
/** Whether key at [index] as [flag]. */
public boolean keyHasFlag(int index, int flag)
{
return (keysflags & (flag << index)) != 0;
}
/** New key with the width multiplied by 's'. */
public Key scaleWidth(float s)
{
return new Key(key0, key1, key2, key3, key4, width * s, shift, edgekeys,
indication);
return new Key(keys, keysflags, width * s, shift, slider, indication);
}
public void getKeys(Set<KeyValue> dst)
{
for (int i = 0; i < keys.length; i++)
if (keys[i] != null)
dst.add(keys[i]);
}
public KeyValue getKeyValue(int i)
{
Corner c;
switch (i)
{
case 0: c = key0; break;
case 1: c = key1; break;
case 2: c = key2; break;
case 3: c = key3; break;
case 4: c = key4; break;
default: c = null; break;
}
return (c == null) ? null : c.kv;
return keys[i];
}
public Key withKeyValue(int i, KeyValue kv)
{
Corner k0 = key0, k1 = key1, k2 = key2, k3 = key3, k4 = key4;
Corner k = Corner.of_kv(kv);
switch (i)
{
case 0: k0 = k; break;
case 1: k1 = k; break;
case 2: k2 = k; break;
case 3: k3 = k; break;
case 4: k4 = k; break;
}
return new Key(k0, k1, k2, k3, k4, width, shift, edgekeys, indication);
KeyValue[] ks = Arrays.copyOf(keys, keys.length);
ks[i] = kv;
int flags = (keysflags & ~(ALL_FLAGS << i));
return new Key(ks, flags, width, shift, slider, indication);
}
public Key withShift(float s)
{
return new Key(key0, key1, key2, key3, key4, width, s, edgekeys, indication);
}
/**
* See Pointers.onTouchMove() for the represented direction.
*/
public KeyValue getAtDirection(int direction)
{
Corner c = null;
if (edgekeys)
{
// \ 1 /
// \ /
// 3 0 2
// / \
// / 4 \
switch (direction)
{
case 2: case 3: c = key1; break;
case 4: case 5: c = key2; break;
case 6: case 7: c = key4; break;
case 8: case 1: c = key3; break;
}
}
else
{
// 1 | 2
// |
// --0--
// |
// 3 | 4
switch (direction)
{
case 1: case 2: c = key1; break;
case 3: case 4: c = key2; break;
case 5: case 6: c = key4; break;
case 7: case 8: c = key3; break;
}
}
return (c == null) ? null : c.kv;
return new Key(keys, keysflags, width, s, slider, indication);
}
public boolean hasValue(KeyValue kv)
{
return (hasValue(key0, kv) || hasValue(key1, kv) || hasValue(key2, kv) ||
hasValue(key3, kv) || hasValue(key4, kv));
}
private static boolean hasValue(Corner c, KeyValue kv)
{
return (c != null && c.kv.equals(kv));
}
}
public static final class Corner
{
public final KeyValue kv;
/** Whether the kv is marked with the "loc " prefix. To be removed if not
specified in the [extra_keys]. */
public final boolean localized;
protected Corner(KeyValue k, boolean l)
{
kv = k;
localized = l;
}
public static Corner parse_of_attr(XmlResourceParser parser, String attr) throws Exception
{
String name = parser.getAttributeValue(null, attr);
boolean localized = false;
if (name == null)
return null;
String name_loc = stripPrefix(name, "loc ");
if (name_loc != null)
{
localized = true;
name = name_loc;
}
return new Corner(KeyValue.getKeyByName(name), localized);
}
public static Corner of_kv(KeyValue kv)
{
return new Corner(kv, false);
}
private static String stripPrefix(String s, String prefix)
{
if (s.startsWith(prefix))
return s.substring(prefix.length());
else
return null;
for (int i = 0; i < keys.length; i++)
if (keys[i] != null && keys[i].equals(kv))
return true;
return false;
}
}
@@ -426,37 +407,45 @@ class KeyboardData
public Key apply(Key k)
{
return new Key(apply(k.key0), apply(k.key1), apply(k.key2),
apply(k.key3), apply(k.key4), k.width, k.shift, k.edgekeys,
k.indication);
}
private Corner apply(Corner c)
{
if (c == null)
return null;
KeyValue kv = apply(c.kv, c.localized);
if (kv == null)
return null;
return Corner.of_kv(kv);
KeyValue[] ks = new KeyValue[k.keys.length];
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.keysflags, k.width, k.shift, k.slider, k.indication);
}
}
/** Parsing utils */
/** Returns [false] on [END_DOCUMENT] or [END_TAG], [true] otherwise. */
private static boolean expect_tag(XmlResourceParser parser, String name) throws Exception
private static boolean expect_tag(XmlPullParser parser, String name) throws Exception
{
int status;
do
{
status = parser.next();
if (status == XmlResourceParser.END_DOCUMENT || status == XmlResourceParser.END_TAG)
if (status == XmlPullParser.END_DOCUMENT || status == XmlPullParser.END_TAG)
return false;
}
while (status != XmlResourceParser.START_TAG);
while (status != XmlPullParser.START_TAG);
if (!parser.getName().equals(name))
throw new Exception("Unknow tag: " + parser.getName());
return true;
}
private static boolean attribute_bool(XmlPullParser parser, String attr, boolean default_val)
{
String val = parser.getAttributeValue(null, attr);
if (val == null)
return default_val;
return val.equals("true");
}
private static float attribute_float(XmlPullParser parser, String attr, float default_val)
{
String val = parser.getAttributeValue(null, attr);
if (val == null)
return default_val;
return Float.parseFloat(val);
}
}

View File

@@ -0,0 +1,58 @@
package juloo.keyboard2;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class LauncherActivity extends Activity
{
/** Text is replaced when receiving key events. */
TextView _tryhere_text;
EditText _tryhere_area;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.launcher_activity);
_tryhere_text = (TextView)findViewById(R.id.launcher_tryhere_text);
_tryhere_area = (EditText)findViewById(R.id.launcher_tryhere_area);
_tryhere_area.addOnUnhandledKeyEventListener(
this.new Tryhere_OnUnhandledKeyEventListener());
}
public void launch_imesettings(View _btn)
{
startActivity(new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS));
}
final class Tryhere_OnUnhandledKeyEventListener implements View.OnUnhandledKeyEventListener
{
public boolean onUnhandledKeyEvent(View v, KeyEvent ev)
{
// Key release of modifiers would erase interesting data
if (KeyEvent.isModifierKey(ev.getKeyCode()))
return false;
StringBuilder s = new StringBuilder();
if (ev.isAltPressed()) s.append("Alt+");
if (ev.isShiftPressed()) s.append("Shift+");
if (ev.isCtrlPressed()) s.append("Ctrl+");
if (ev.isMetaPressed()) s.append("Meta+");
// s.append(ev.getDisplayLabel());
String kc = KeyEvent.keyCodeToString(ev.getKeyCode());
s.append(kc.replaceFirst("^KEYCODE_", ""));
_tryhere_text.setText(s.toString());
return true;
}
}
}

View File

@@ -0,0 +1,25 @@
package juloo.keyboard2;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.preference.ListPreference;
import android.util.AttributeSet;
public class LayoutListPreference extends ListPreference
{
public LayoutListPreference(Context context, AttributeSet attrs)
{
super(context, attrs);
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LayoutListPreference);
String defaultString = a.getString(R.styleable.LayoutListPreference_defaultString);
a.recycle();
Resources res = context.getResources();
String[] entries = res.getStringArray(R.array.pref_layout_entries);
entries[0] = defaultString;
setEntries(entries);
setEntryValues(res.getStringArray(R.array.pref_layout_values));
setSummary("%s");
setDefaultValue("none");
}
}

View File

@@ -48,6 +48,8 @@ public final class Pointers implements Handler.Callback
public void clear()
{
for (Pointer p : _ptrs)
stopKeyRepeat(p);
_ptrs.clear();
}
@@ -74,16 +76,24 @@ public final class Pointers implements Handler.Callback
return -1;
}
public int getKeyFlags(KeyboardData.Key key, KeyValue kv)
{
Pointer ptr = getLatched(key, kv);
if (ptr == null) return -1;
return ptr.flags;
}
/** Fake pointers are latched and not lockable. */
public void add_fake_pointer(KeyValue kv, KeyboardData.Key key, boolean locked)
{
if (getLatched(key, kv) != null)
return; // Already latched, don't add an other pointer.
Pointer ptr = new Pointer(-1, key, kv, 0.f, 0.f, Modifiers.EMPTY);
ptr.flags &= ~KeyValue.FLAG_LATCH;
ptr.flags |= KeyValue.FLAG_LOCK | KeyValue.FLAG_FAKE_PTR;
Pointer ptr = getLatched(key, kv);
if (ptr != null)
removePtr(ptr); // Already latched, replace pointer.
ptr = new Pointer(-1, key, kv, 0.f, 0.f, Modifiers.EMPTY);
ptr.flags &= ~(KeyValue.FLAG_LATCH | KeyValue.FLAG_LOCK);
ptr.flags |= KeyValue.FLAG_FAKE_PTR;
if (locked)
ptr.flags = (ptr.flags & ~KeyValue.FLAG_LOCK) | KeyValue.FLAG_LOCKED;
ptr.flags |= KeyValue.FLAG_LOCKED;
_ptrs.add(ptr);
}
@@ -101,6 +111,11 @@ public final class Pointers implements Handler.Callback
Pointer ptr = getPtr(pointerId);
if (ptr == null)
return;
if (ptr.sliding)
{
onTouchUp_sliding(ptr);
return;
}
stopKeyRepeat(ptr);
Pointer latched = getLatched(ptr);
if (latched != null) // Already latched
@@ -128,13 +143,9 @@ public final class Pointers implements Handler.Callback
}
}
public void onTouchCancel(int pointerId)
public void onTouchCancel()
{
Pointer ptr = getPtr(pointerId);
if (ptr == null)
return;
stopKeyRepeat(ptr);
removePtr(ptr);
clear();
_handler.onPointerFlagsChanged(true);
}
@@ -149,53 +160,59 @@ public final class Pointers implements Handler.Callback
public void onTouchDown(float x, float y, int pointerId, KeyboardData.Key key)
{
// Ignore new presses while a modulated key is active. On some devices,
// ghost touch events can happen while the pointer travels on top of other
// keys.
if (isModulatedKeyPressed())
// Ignore new presses while a sliding key is active. On some devices, ghost
// touch events can happen while the pointer travels on top of other keys.
if (isSliding())
return;
// Don't take latched modifiers into account if an other key is pressed.
// The other key already "own" the latched modifiers and will clear them.
Modifiers mods = getModifiers(isOtherPointerDown());
KeyValue value = handleKV(key.key0, mods);
KeyValue value = _handler.modifyKey(key.keys[0], mods);
Pointer ptr = new Pointer(pointerId, key, value, x, y, mods);
_ptrs.add(ptr);
startKeyRepeat(ptr);
_handler.onPointerDown(false);
}
static final int[] DIRECTION_TO_INDEX = new int[]{
7, 2, 2, 6, 6, 4, 4, 8, 8, 3, 3, 5, 5, 1, 1, 7
};
/**
* [direction] is an int between [0] and [15] that represent 16 sections of a
* circle, clockwise, starting at the top.
*/
KeyValue getKeyAtDirection(KeyboardData.Key k, int direction)
{
return k.keys[DIRECTION_TO_INDEX[direction]];
}
/*
* Get the KeyValue at the given direction. In case of swipe (!= 0), get the
* nearest KeyValue that is not key0.
* Get the KeyValue at the given direction. In case of swipe (direction !=
* null), get the nearest KeyValue that is not key0.
* Take care of applying [_handler.onPointerSwipe] to the selected key, this
* must be done at the same time to be sure to treat removed keys correctly.
* Return [null] if no key could be found in the given direction or if the
* selected key didn't change.
*/
private KeyValue getKeyAtDirection(Pointer ptr, int direction)
private KeyValue getNearestKeyAtDirection(Pointer ptr, Integer direction)
{
if (direction == 0)
return handleKV(ptr.key.key0, ptr.modifiers);
if (direction == null)
return _handler.modifyKey(ptr.key.keys[0], ptr.modifiers);
KeyValue k;
for (int i = 0; i > -3; i = (~i>>31) - i)
// [i] is [0, -1, 1, -2, 2, ...]
for (int i = 0; i > -4; i = (~i>>31) - i)
{
int d = (direction + i + 8 - 1) % 8 + 1;
int d = (direction + i + 16) % 16;
// Don't make the difference between a key that doesn't exist and a key
// that is removed by [_handler]. Triggers side effects.
k = _handler.modifyKey(ptr.key.getAtDirection(d), ptr.modifiers);
k = _handler.modifyKey(getKeyAtDirection(ptr.key, d), ptr.modifiers);
if (k != null)
return k;
}
return null;
}
private KeyValue handleKV(KeyboardData.Corner c, Modifiers modifiers)
{
if (c == null)
return null;
return _handler.modifyKey(c.kv, modifiers);
}
public void onTouchMove(float x, float y, int pointerId)
{
Pointer ptr = getPtr(pointerId);
@@ -205,45 +222,45 @@ public final class Pointers implements Handler.Callback
// The position in a IME windows is clampled to view.
// For a better up swipe behaviour, set the y position to a negative value when clamped.
if (y == 0.0) y = -400;
float dx = x - ptr.downX;
float dy = y - ptr.downY;
float dist = Math.abs(dx) + Math.abs(dy);
ptr.ptrDist = dist;
int direction;
if (ptr.sliding)
{
onTouchMove_sliding(ptr, dx);
return;
}
float dist = Math.abs(dx) + Math.abs(dy);
Integer direction;
if (dist < _config.swipe_dist_px)
{
direction = 0;
direction = null;
}
else
{
// One of the 8 directions:
// |\2|3/|
// |1\|/4|
// |-----|
// |8/|\5|
// |/7|6\|
direction = 1;
if (dx > 0) direction += 2;
if (dx > Math.abs(dy) || (dx < 0 && dx > -Math.abs(dy))) direction += 1;
if (dy > 0) direction = 9 - direction;
// See [getKeyAtDirection()] for the meaning. The starting point on the
// circle is the top direction.
double a = Math.atan2(dy, dx) + Math.PI;
// a is between 0 and 2pi, 0 is pointing to the left
// add 12 to align 0 to the top
direction = ((int)(a * 8 / Math.PI) + 12) % 16;
}
if (direction != ptr.selected_direction)
{
ptr.selected_direction = direction;
KeyValue newValue = getKeyAtDirection(ptr, direction);
if (newValue != null && (ptr.value == null || !newValue.equals(ptr.value)))
KeyValue newValue = getNearestKeyAtDirection(ptr, direction);
if (newValue != null && !newValue.equals(ptr.value))
{
int old_flags = ptr.flags;
ptr.value = newValue;
ptr.flags = newValue.getFlags();
// Keep the keyrepeat going between modulated keys.
if ((old_flags & ptr.flags & KeyValue.FLAG_PRECISE_REPEAT) == 0)
// Sliding mode is entered when key5 or key6 is down on a slider key.
if (ptr.key.slider &&
(newValue.equals(ptr.key.getKeyValue(5))
|| newValue.equals(ptr.key.getKeyValue(6))))
{
stopKeyRepeat(ptr);
startKeyRepeat(ptr);
startSliding(ptr, dy);
}
_handler.onPointerDown(true);
}
@@ -301,13 +318,11 @@ public final class Pointers implements Handler.Callback
_handler.onPointerFlagsChanged(shouldVibrate);
}
private boolean isModulatedKeyPressed()
boolean isSliding()
{
for (Pointer ptr : _ptrs)
{
if ((ptr.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
if (ptr.sliding)
return true;
}
return false;
}
@@ -322,7 +337,8 @@ public final class Pointers implements Handler.Callback
if (ptr.timeoutWhat == msg.what)
{
if (handleKeyRepeat(ptr))
_keyrepeat_handler.sendEmptyMessageDelayed(msg.what, nextRepeatInterval(ptr));
_keyrepeat_handler.sendEmptyMessageDelayed(msg.what,
_config.longPressInterval);
else
ptr.timeoutWhat = -1;
return true;
@@ -331,30 +347,13 @@ public final class Pointers implements Handler.Callback
return false;
}
private long nextRepeatInterval(Pointer ptr)
{
long t = _config.longPressInterval;
if (_config.preciseRepeat && (ptr.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
{
// Modulate repeat interval depending on the distance of the pointer
t = (long)((float)t * 2.f / modulatePreciseRepeat(ptr));
}
return t;
}
private static int uniqueTimeoutWhat = 0;
private void startKeyRepeat(Pointer ptr)
{
if (ptr.value == null)
return;
int what = (uniqueTimeoutWhat++);
ptr.timeoutWhat = what;
long timeout = _config.longPressTimeout;
// Faster repeat timeout for modulated keys
if ((ptr.flags & KeyValue.FLAG_PRECISE_REPEAT) != 0)
timeout /= 2;
_keyrepeat_handler.sendEmptyMessageDelayed(what, timeout);
_keyrepeat_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout);
}
private void stopKeyRepeat(Pointer ptr)
@@ -363,7 +362,6 @@ public final class Pointers implements Handler.Callback
{
_keyrepeat_handler.removeMessages(ptr.timeoutWhat);
ptr.timeoutWhat = -1;
ptr.repeatingPtrDist = -1.f;
}
}
@@ -376,22 +374,54 @@ public final class Pointers implements Handler.Callback
lockPointer(ptr, true);
return false;
}
// Stop repeating: Latched key, special keys
if (ptr.pointerId == -1 || (ptr.flags & KeyValue.FLAG_SPECIAL) != 0)
// Stop repeating: Latched key, no key
if (ptr.pointerId == -1 || ptr.value == null)
return false;
_handler.onPointerHold(ptr.value, ptr.modifiers);
KeyValue kv = KeyModifier.modify_long_press(ptr.value);
if (!kv.equals(ptr.value))
{
ptr.value = kv;
ptr.flags = kv.getFlags();
_handler.onPointerDown(true);
return true;
}
// Stop repeating: Special keys
if (kv.hasFlags(KeyValue.FLAG_SPECIAL))
return false;
_handler.onPointerHold(kv, ptr.modifiers);
return true;
}
private float modulatePreciseRepeat(Pointer ptr)
// Sliding
void startSliding(Pointer ptr, float initial_dy)
{
if (ptr.repeatingPtrDist < 0.f)
ptr.repeatingPtrDist = ptr.ptrDist; // First repeat
if (ptr.ptrDist > ptr.repeatingPtrDist * 2.f)
ptr.repeatingPtrDist = ptr.ptrDist / 2.f; // Large swipe, move the middle point
float left = ptr.repeatingPtrDist / 2.f;
float accel = (ptr.ptrDist - left) / (ptr.repeatingPtrDist - left);
return Math.min(8.f, Math.max(0.1f, accel));
stopKeyRepeat(ptr);
ptr.sliding = true;
ptr.sliding_count = (int)(initial_dy / _config.slide_step_px);
}
/** Handle a sliding pointer going up. Latched modifiers are not cleared to
allow easy adjustments to the cursors. The pointer is cancelled. */
void onTouchUp_sliding(Pointer ptr)
{
removePtr(ptr);
_handler.onPointerFlagsChanged(false);
}
/** Handle move events for sliding pointers. [dx] is distance travelled from
[downX]. */
void onTouchMove_sliding(Pointer ptr, float dx)
{
int count = (int)(dx / _config.slide_step_px);
if (count == ptr.sliding_count)
return;
int key_index = (count < ptr.sliding_count) ? 5 : 6;
KeyValue newValue = _handler.modifyKey(ptr.key.keys[key_index], ptr.modifiers);
ptr.sliding_count = count;
ptr.value = newValue;
if (newValue != null)
_handler.onPointerHold(newValue, ptr.modifiers);
}
private static final class Pointer
@@ -400,36 +430,36 @@ public final class Pointers implements Handler.Callback
public int pointerId;
/** The Key pressed by this Pointer */
public final KeyboardData.Key key;
/** Current direction. */
public int selected_direction;
/** Current direction. [null] means not swiping. */
public Integer selected_direction;
/** Selected value with [modifiers] applied. */
public KeyValue value;
public float downX;
public float downY;
/** Distance of the pointer to the initial press. */
public float ptrDist;
/** Modifier flags at the time the key was pressed. */
public Modifiers modifiers;
/** Flags of the value. Latch, lock and locked flags are updated. */
public int flags;
/** Identify timeout messages. */
public int timeoutWhat;
/** ptrDist at the first repeat, -1 otherwise. */
public float repeatingPtrDist;
/** Whether the pointer is "sliding" laterally on a key. */
public boolean sliding;
/** Number of event already caused by sliding. */
public int sliding_count;
public Pointer(int p, KeyboardData.Key k, KeyValue v, float x, float y, Modifiers m)
{
pointerId = p;
key = k;
selected_direction = 0;
selected_direction = null;
value = v;
downX = x;
downY = y;
ptrDist = 0.f;
modifiers = m;
flags = (v == null) ? 0 : v.getFlags();
timeoutWhat = -1;
repeatingPtrDist = -1.f;
sliding = false;
sliding_count = 0;
}
}

View File

@@ -1,9 +1,11 @@
package juloo.keyboard2;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
public class SettingsActivity extends PreferenceActivity
{
@@ -12,6 +14,10 @@ public class SettingsActivity extends PreferenceActivity
{
detectSystemTheme();
super.onCreate(savedInstanceState);
// The preferences can't be read when in direct-boot mode. Avoid crashing
// and don't allow changing the settings.
try { getPreferenceManager().getSharedPreferences(); }
catch (Exception _e) { fallbackEncrypted(); return; }
addPreferencesFromResource(R.xml.settings);
}
@@ -26,4 +32,18 @@ public class SettingsActivity extends PreferenceActivity
setTheme(android.R.style.Theme_DeviceDefault_Light);
}
}
void fallbackEncrypted()
{
// Can't communicate with the user here.
finish();
}
protected void onStop()
{
DirectBootAwarePreferences
.copy_preferences_to_protected_storage(this,
getPreferenceManager().getSharedPreferences());
super.onStop();
}
}

View File

@@ -3,6 +3,7 @@ package juloo.keyboard2;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.util.AttributeSet;
@@ -11,12 +12,20 @@ public class Theme
{
public final Paint keyBgPaint = new Paint();
public final Paint keyDownBgPaint = new Paint();
public final Paint keyBorderPaint = new Paint();
public final int lockedColor;
public final int activatedColor;
public final int labelColor;
public final int subLabelColor;
public final int secondaryLabelColor;
public final float keyBorderRadius;
public final float keyBorderWidth;
public final float keyBorderWidthActivated;
public final int keyBorderColorLeft;
public final int keyBorderColorTop;
public final int keyBorderColorRight;
public final int keyBorderColorBottom;
public final int colorNavBar;
public final boolean isLightNavBar;
@@ -30,7 +39,8 @@ public class Theme
public Theme(Context context, AttributeSet attrs)
{
TypedArray s = context.getTheme().obtainStyledAttributes(attrs, R.styleable.keyboard, 0, 0);
keyBgPaint.setColor(s.getColor(R.styleable.keyboard_colorKey, 0));
int colorKey = s.getColor(R.styleable.keyboard_colorKey, 0);
keyBgPaint.setColor(colorKey);
keyDownBgPaint.setColor(s.getColor(R.styleable.keyboard_colorKeyActivated, 0));
// colorKeyboard = s.getColor(R.styleable.keyboard_colorKeyboard, 0);
colorNavBar = s.getColor(R.styleable.keyboard_navigationBarColor, 0);
@@ -39,7 +49,16 @@ public class Theme
activatedColor = s.getColor(R.styleable.keyboard_colorLabelActivated, 0);
lockedColor = s.getColor(R.styleable.keyboard_colorLabelLocked, 0);
subLabelColor = s.getColor(R.styleable.keyboard_colorSubLabel, 0);
float secondaryLightOffset = s.getFloat(R.styleable.keyboard_secondaryLightOffset, 1.f);
secondaryLabelColor = adjustLight(labelColor, secondaryLightOffset);
keyBorderRadius = s.getDimension(R.styleable.keyboard_keyBorderRadius, 0);
keyBorderWidth = s.getDimension(R.styleable.keyboard_keyBorderWidth, 0);
keyBorderWidthActivated = s.getDimension(R.styleable.keyboard_keyBorderWidthActivated, 0);
keyBorderPaint.setStyle(Paint.Style.STROKE);
keyBorderColorLeft = s.getColor(R.styleable.keyboard_keyBorderColorLeft, colorKey);
keyBorderColorTop = s.getColor(R.styleable.keyboard_keyBorderColorTop, colorKey);
keyBorderColorRight = s.getColor(R.styleable.keyboard_keyBorderColorRight, colorKey);
keyBorderColorBottom = s.getColor(R.styleable.keyboard_keyBorderColorBottom, colorKey);
s.recycle();
_keyLabelPaint = initLabelPaint(Paint.Align.CENTER, null);
_keySubLabelPaint = initLabelPaint(Paint.Align.LEFT, null);
@@ -67,7 +86,15 @@ public class Theme
return _indicationPaint;
}
private Paint initLabelPaint(Paint.Align align, Typeface font)
int adjustLight(int color, float offset)
{
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
hsv[2] += offset;
return Color.HSVToColor(hsv);
}
Paint initLabelPaint(Paint.Align align, Typeface font)
{
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setTextAlign(align);
@@ -76,7 +103,7 @@ public class Theme
return (paint);
}
private static Typeface _key_font = null;
static Typeface _key_font = null;
static public Typeface getKeyFont(Context context)
{

View File

@@ -1,6 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by IcoMoon.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="16" viewBox="0 0 18 16">
<path fill="#000000" d="M17 2h-16c-0.55 0-1 0.45-1 1v10c0 0.55 0.45 1 1 1h16c0.55 0 1-0.45 1-1v-10c0-0.55-0.45-1-1-1zM10 4h2v2h-2v-2zM13 7v2h-2v-2h2zM7 4h2v2h-2v-2zM10 7v2h-2v-2h2zM4 4h2v2h-2v-2zM7 7v2h-2v-2h2zM2 4h1v2h-1v-2zM2 7h2v2h-2v-2zM3 12h-1v-2h1v2zM12 12h-8v-2h8v2zM16 12h-3v-2h3v2zM16 9h-2v-2h2v2zM16 6h-3v-2h3v2z"></path>
</svg>
<!-- materialdesignicons.com keyboard @Google -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,10H17V8H19M19,13H17V11H19M16,10H14V8H16M16,13H14V11H16M16,17H8V15H16M7,10H5V8H7M7,13H5V11H7M8,11H10V13H8M8,8H10V10H8M11,11H13V13H11M11,8H13V10H11M20,5H4C2.89,5 2,5.89 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7C22,5.89 21.1,5 20,5Z" /></svg>

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 364 B

2
srcs/special_font/13.svg Normal file
View File

@@ -0,0 +1,2 @@
<!-- materialdesignicons.com keyboard-settings Michael Richins @MrGrigri -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,10H17V8H19M19,13H17V11H19M16,10H14V8H16M16,13H14V11H16M16,17H8V15H16M7,10H5V8H7M7,13H5V11H7M8,11H10V13H8M8,8H10V10H8M11,11H13V13H11M11,8H13V10H11M20,5H4A2,2 0 0,0 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7A2,2 0 0,0 20,5M7,22H9V24H7V22M11,22H13V24H11V22M15,22H17V24H15V22Z" /></svg>

After

Width:  |  Height:  |  Size: 433 B

2
srcs/special_font/14.svg Normal file
View File

@@ -0,0 +1,2 @@
<!-- materialdesignicons.com keyboard-settings Michael Richins @MrGrigri -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7,22H9V24H7V22M11,22H13V24H11V22M15,22H17V24H15V22M4,5A2,2 0 0,0 2,7V17A2,2 0 0,0 4,19H20A2,2 0 0,0 22,17V7A2,2 0 0,0 20,5H4M4,7H20V17H4V7M5,8V10H7V8H5M8,8V10H10V8H8M11,8V10H13V8H11M14,8V10H16V8H14M17,8V10H19V8H17M5,11V13H7V11H5M8,11V13H10V11H8M11,11V13H13V11H11M14,11V13H16V11H14M17,11V13H19V11H17M8,14V16H16V14H8Z" /></svg>

After

Width:  |  Height:  |  Size: 473 B

View File

@@ -1,13 +1,10 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-20 0 1256 2048">
<g transform="matrix(1 0 0 -1 0 1536)">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-55 0 2103 2048">
<path fill="currentColor"
d="M589 493v151v0h637v-151h-637zM931.256 1002.78l-69.3145 -69.3145q-112.472 86.3154 -249.792 98.0859v99.3945q176.555 -11.7715 319.106 -128.166v0v0zM516.679 1031.55q-133.396 -10.4619 -249.792 -100.701q0 1.30859 -71.9297 74.5449l2.61523 -2.61523
q142.555 116.396 319.106 128.166v-99.3945v0v0zM197.572 860.229q-90.2393 -103.315 -107.24 -245.866h-99.3936q17.001 181.786 137.32 319.104l-6.53906 5.23145l3.92285 -2.61523l41.8506 -43.1582q30.0791 -31.3867 30.0791 -32.6953v0v0zM1137.89 614.361h-99.3936
q-17.001 141.241 -107.238 248.482l69.3135 70.6211q120.317 -137.318 137.318 -319.104v0v0zM1137.89 517.58q-14.3857 -189.633 -129.474 -326.953l-69.3135 70.6221q86.3154 111.164 99.3936 256.331h99.3936v0v0zM189.726 263.87h0.000976562
q-86.3154 107.239 -99.3936 253.716h-99.3945q13.0781 -189.633 128.165 -326.953l-3.92285 -3.92383q-1.30762 0 74.5449 77.1611v0zM939.103 121.32q-146.476 -124.242 -326.951 -136.015v99.3945q139.935 11.7705 257.639 105.935zM516.679 -14.7002
q-180.478 11.7715 -326.953 136.014l69.3145 69.3145q117.703 -90.2383 257.641 -105.934v-99.3945h-0.000976562h-0.000976562z" />
</g>
d="M127.905 602.248l-6.18555 -4.94824l3.92285 2.61523zM931.256 533.22l-69.3145 69.3145q-112.472 -86.3154 -249.792 -98.0859v-99.3945q176.555 11.7715 319.106 128.166zM516.679 504.45q-133.396 10.4619 -249.792 100.701q0.0234375 -1.28516 -69.3145 -71.9297
q142.558 -116.396 319.106 -128.166v99.3945zM1137.89 1018.42q-14.3857 189.633 -129.474 326.953l-69.3135 -70.6221q86.3154 -111.164 99.3936 -256.331h99.3936zM189.726 1272.13q-86.3145 -107.239 -99.3926 -253.716h-99.3945q13.0625 189.402 127.886 326.619
q12.8672 -13.8672 70.9014 -72.9033zM939.103 1414.68q-146.476 124.242 -326.948 136.018v-99.3945q139.935 -11.7705 257.639 -105.938zM516.684 1550.7q-180.482 -11.7715 -326.958 -136.016l69.3145 -69.3145q117.703 90.2383 257.644 105.936v99.3945zM-45 926v-150
h68.7334q35.2666 -94 104.487 -173.426l39.2725 40.499q30.5068 30.9268 30.0791 32.6953q-40.5723 46.2314 -66.0537 100.231h865.861h107.714q-35.0264 -94.1494 -104.52 -173.463l-69.3135 70.6211q40.3994 48.0137 66.1191 102.842h107.714v0h74.9062v150h-1225z
M115.181 1349.29q-0.307617 0 1.73828 -2.04492l2.18457 -1.87891z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

1
srcs/special_font/60.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 0 1168 2048"><path fill="currentColor" d="m931.256 1557.78-69.314-69.314Q749.47 1574.78 612.15 1586.55v99.395q176.555-11.772 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.701 0 1.309-71.93 74.545l2.616-2.615q142.554 116.396 319.106 128.166zm-319.107-171.321q-90.24-103.316-107.24-245.867H-9.062q17.002 181.786 137.32 319.104l-6.539 5.23 3.923-2.614 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.868h-99.394q-17 141.242-107.239 248.483l69.314 70.62q120.318-137.318 137.319-319.103zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.33zM189.726 818.867h.001q-86.315 107.239-99.394 253.716H-9.06Q4.017 882.95 119.104 745.63l-3.923-3.924q-1.308 0 74.545 77.16zm749.377-142.552Q792.627 552.073 612.151 540.3v99.394q139.935 11.77 257.639 105.935zM516.679 540.303q-180.478 11.77-326.953 136.013l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM648 1838H430v201h218z"/></svg>

After

Width:  |  Height:  |  Size: 976 B

1
srcs/special_font/61.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1168 2048"><path d="m931.256 1839.834-69.314-69.314q-112.472 86.315-249.792 98.086V1968q176.555-11.771 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.7 0 1.308-71.93 74.544l2.616-2.615q142.554 116.396 319.106 128.166v-99.395zm-319.107-171.32q-90.24-103.317-107.24-245.868H-9.062q17.001 181.786 137.32 319.104l-6.539 5.232 3.923-2.616 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.869h-99.394q-17 141.242-107.239 248.483l69.314 70.621q120.318-137.319 137.319-319.104zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.331h99.394zm-948.164-253.716h.001q-86.315 107.24-99.394 253.716H-9.06q13.078-189.633 128.165-326.953l-3.923-3.924q-1.308 0 74.545 77.161zM939.103 958.37Q792.627 834.127 612.151 822.355v99.395q139.935 11.77 257.639 105.934ZM516.679 822.357Q336.201 834.128 189.726 958.37l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM792 831.054q70-52 109.5-99.5t39.5-101.5q0-42-22.5-66t-73.5-24q-27 0-50 7.5t-49 18.5l-33-123q36-19 79.5-31.5t103.5-12.5q95 0 155.5 55t60.5 154q0 80-60.5 152t-187.5 128Z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

1
srcs/special_font/62.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 0 1168 2048"><path fill="currentColor" d="m931.256 1851.834-69.314-69.314q-112.472 86.315-249.792 98.086V1980q176.555-11.771 319.106-128.166zm-414.577 28.77q-133.396-10.462-249.792-100.7 0 1.308-71.93 74.544l2.616-2.615q142.554 116.396 319.106 128.166v-99.395zm-319.107-171.32q-90.24-103.317-107.24-245.868H-9.062q17.001 181.786 137.32 319.104l-6.539 5.232 3.923-2.616 41.85-43.158q30.08-31.387 30.08-32.695zm940.318-245.869h-99.394q-17 141.242-107.239 248.483l69.314 70.621q120.318-137.319 137.319-319.104zm0-96.778q-14.386-189.633-129.474-326.953l-69.314 70.622q86.316 111.164 99.394 256.331h99.394zm-948.164-253.716h.001q-86.315 107.24-99.394 253.716H-9.06q13.078-189.633 128.165-326.953l-3.923-3.924q-1.308 0 74.545 77.161zM939.103 970.37Q792.627 846.127 612.151 834.355v99.395q139.935 11.77 257.639 105.934ZM516.679 834.357Q336.201 846.128 189.726 970.37l69.314 69.314q117.703-90.238 257.64-105.933v-99.394zM623 840.054l-12-52q65-11 108-52t43-121q0-96-79-153t-226-57l-7 109q72 0 116 24.5t44 73.5q0 48-36 67t-123 26l32 135z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

38
sync_translations.py Normal file
View File

@@ -0,0 +1,38 @@
import xml.etree.ElementTree as ET
from xml.sax import saxutils
import glob
# Edit every strings.xml files:
# - Add missing translation as comments
# - Remove obsolete strings
# - Sort in the same order as the baseline
# The baseline is 'values/strings.xml', which is english.
def parse_strings_file(file):
def key(ent): return ent.get("name"), ent.get("product")
resrcs = ET.parse(file).getroot()
return { key(ent): ent for ent in resrcs if ent.tag == "string" }
def dump_entry(out, entry, comment):
out.write(" ")
if comment: out.write("<!-- ")
out.write(ET.tostring(entry, "unicode").strip())
if comment: out.write(" -->")
out.write("\n")
def write_updated_strings(out, baseline, strings):
out.write('<?xml version="1.0" encoding="utf-8"?>\n<resources>\n')
for key, baseline_entry in baseline.items():
if key in strings:
dump_entry(out, strings[key], False)
else:
dump_entry(out, baseline_entry, True)
out.write('</resources>\n')
baseline = parse_strings_file("res/values/strings.xml")
for strings_file in glob.glob("res/values-*/strings.xml"):
print(strings_file)
strings = dict(parse_strings_file(strings_file))
with open(strings_file, "w") as out:
write_updated_strings(out, baseline, strings)