The label size was computed against the width of keys on the keyboard,
which resulted in a different label size on different layouts.
Notably, it made the labels very small on a 11 columns layout and
relatively larger on the numpad.
The label size is now computed against a baseline of 1/10 of the width
of the screen.
This changes layout switching logic to detect screen width rather than increasingly specific portrait/landscape/unfolded state.
This reduces number of different auto-layouts back to 2: narrow devices (such as a phone in portrait) and wide devices (such as a phone in landscape or a tablet).
Make vertical sliders slower. The intention is to make the up/down
slider slower, as we have less visibility and do smaller movements in
that direction.
* Fix extra bottom margin when navbar buttons absent
Fix the extra space that was appearing when the gesture-navigation bar
didn't contain the "switch IME" or "close IME" buttons.
This was found on OneUI 7 with the two "keyboard key" related options
turned off.
* Remove unneeded nav bar detection and width computation
Emptying the selection with the spacebar slider puts the selection mode
in an unexpected state. This checks that this doesn't happen.
The selection ends can now cross each other, reversing the selection
order. Special care is made to make sure that the sliders go in the
expected direction.
Pointers is changed to send a `onPointerDown` for the first slider event
instead of a `onPointerHold`. This event is detected in
`KeyEventHandler` and the selection ends are reordered if needed when
sliding again.
* Add <row scale=""> attribute
Scale the width of the keys in the row to match a value. Useful to
remove space on the right of the row without adding a 'width' attribute
to each key.
* layouts: Use the 'scale=""' attribute in builtin layouts
This removes the very specific 'width' values.
The calculation for the size of each rows now avoid making the keyboard
bigger than the screen if the Keyboard Height option is unusually high.
The height calculation with the default settings is changed slightly, it
is now assuming that a layout is 3.95 rows high instead of 4. This is
because the bottom row is usually 0.95% the size of other rows.
The label size is computed relatively to the width of the keyboard when
the height is larger than 3/2 of the width. This ensures that the labels
have a reasonable size when the keyboard height increases.
* Add AndroidX WindowManager
unfortunately, this seems to be the only way to get fold state, native Android APIs are internal. To add this, we need to update some dependencies, raise java version and raise compile SDK.
* adds separate layouts and separate layout settings for folded and unfolded state of the device.
The affected settings are:
+ the margin bottom settings
+ the horizontal margin settings
+ the keyboard height settings
* Update shell.nix
The distance at which a swipe was considered successful was reduced in
188c682 to allow making circle gestures on a key that also had a slider.
It was also useful in reducing accidental sliding.
This is impractical for normal typing so it is reverted. The reduced
range continues to be used for sliders.
The number row option is changed into a ListPreference and controls whether the number row contains symbols or not.
Co-authored-by: Joey Schaff <j@jaoh.xyz>
* Selection mode: Space to cancel the selection
This adds the "selection mode", which is activated when text is selected
in the text box. The selection mode is exited when the selection is
cleared.
While the selection mode is activated, the Space and Esc keys are
modified into the "selection cancel" key, which remove the selection
without changing the text.
The space bar is otherwise easy to type by accident during a selection
and causes the selected text to be deleted.
* Selection mode: Move each ends of selection separately with slider
When the selection mode is activated, the space bar sliders change how
they affect the selection:
- The left side of the slider moves the left position of the selection.
To shrink the selection from the left side, the slider must be
activated by sliding to the left, extending the selection
temporarilly, then by sliding to the right.
- The right side of the slider affects the right position if the
selection.
* Construct a single handler
* Add a delay after a Keyevent key in a macro
Add a delay before sending the next key to avoid race conditions causing
keys to be handled in the wrong order. Notably, KeyEvent keys handling
is scheduled differently than the other edit functions.
These keys are the equivalent of ctrl+backspace and ctrl+delete,
respectively.
They can be reached with Gesture+backspace and Gesture+delete
respectively.
Many kind of KeyValues don't need to be wrapped into a Macro to show a
specific symbol. This is especially useful as Macro keys are not
affected by modifiers.
The parser is changed to have a fast-path when a key value is not a
macro.