* CI: Run 'check_layout.py'
Ensures that 'check_layout.output' is not outdated.
Also, update it.
* CI: Check new store descriptions
When a store description is added, 'python3 sync_translations.py' leaves
an untracked file that is not checked.
This makes sure that untracked store descriptions are noticed in CI.
Themes do not dim secondary keys the same way due to the "offset"
mechanism. Instead, use a ratio that is the same for every themes.
It's still possible to override this ratio per theme.
The kind field wasn't large enough to hold the new Compose_pending kind.
The flags field is reduced in size by removing a free spot.
The FLAGS_BITS mask is defined in a safer way.
compile.py implements a parser for X11's Compose.pre files. A lot of
code is necessary to interpret character names but thanksfully, the name
of most characters is contained in the file.
The state machine is compiled into two char arrays which unfortunately
requires an expensive initialisation and allocation.
The COMPOSE_PENDING modifier indicate whether a compose sequence is in
progress. The new key of kind Compose_pending sets the current state of
the sequence.
The compose sequences are compiled into a state machine by a python
script into a compact encoding.
The state of the pending compose is determined by the index of a state.
The pin entry layout shouldn't be inverted as the letter indications
would be meaningless and the order would be opposite to what the option
specifies.
The enter and action key are swapped as the automatic swapping is also
removed.
Incompatible APIs were used in the custom layouts and the extra keys
options.
Add @TargetApi annotations to help catch similar issues in the future
with the help of 'gradle lint'.
Android 3.0 (API level 11) was released in Feb 2011.
These versions were already unsupported due to unavoidable calls to:
- MotionEvent.getActionMasked() (API 8)
And avoidable calls to:
- SharedPreferences.Editor.putStringSet() (API 11)
This makes translation easier as there's a single file to edit at.
Existing short and full descriptions are conserved.
sync_translations.py takes care of updating the metadata files.
The metadata directories are renamed to match the language codes used in `res/`.
Contributing guidelines are updated accordingly.
This allows to use modifiers in combination with other inputs like a
mouse click, for example under termux-x11.
The key down event and notification about modifiers changing are sent
down to KeyEventHandler. A mutable state remember for which modifier
down events have been sent.
When pressing down a modifier with one finger and typing with the
other, it might appear that the modifier is released after the first
time an other key is pressed and then pressed and released for the
following keys.
This prevents unintentionally type two modified keys instead of one
when the second key is pressed while the other is not yet released.
This separates the layout definitions from the special layouts
(bottom_row, greekmath) and other unrelated files (method, settings).
This is also a more intuitive location for layouts and make the resource
directory easier to navigate.
Under the hood, layouts are copied back into
build/generated-resources/xml.
To detect voice IMEs, Unexpected Keyboard calls InputMethodManager.getEnabledInputMethodList
Internally, this method eventually calls a method that returns a filtered list of packages that may not include the installed voice IME, and thus Unexpected Keyboard unexpectedly claims no voice input is installed because it can't see it.
The fix is to explicitly state in the manifest that we want to query for other IMEs, based on https://developer.android.com/training/package-visibility/declaring
This is not an issue with Google's voice input or other preinstalled voice inputs because they usually have android:forceQueryable=true, but this is an issue with third-party voice inputs such as FUTO Voice Input. Launching the voice input app after activating the keyboard also usually makes the package visible, so a consistent way to replicate this issue on modern Android is to reboot the device and try triggering voice input from the keyboard
Android's shouldOfferSwitchingToNextInputMethod() method might return
false when an other IME is installed, perhaps when the other IME doesn't
specify android:supportsSwitchingToNextInputMethod="true".