abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2View.java
AgeCommit message (Collapse)AuthorFilesLines
2022-10-24Draw letter indication on the pin layoutJules Aguillon1-1/+18
There is no way to type letters on the pin layout, the indication are decoration only. Use the E.161 standard.
2022-10-23Add optional NumPadGero Streng1-2/+6
Shows a NumPad depending on preference: Never/Landscape/Always
2022-10-23Add the capslock keyJules Aguillon1-2/+2
The key enable caps lock immediately. It does nothing if caps lock is already enabled. It is not present on the keyboard by default but a place is defined on every layout, top-right of the shift key. It can be enabled in the settings. The icon is from materialdesignicons.com.
2022-09-24Improve the auto capitalisationJules Aguillon1-17/+15
- Detect when the input box is cleared - Avoid looking up keys on the keyboard every time the shift state needs to change.
2022-07-30Fix crash when auto-capitalisation runs too soonJules Aguillon1-0/+2
This is unexpected but happens once.
2022-07-24Hold any modifier to lockJules Aguillon1-1/+3
Modifiers can be locked with a long press. The key repeat mechanism is re-used and the press timeout is the same. Every modifiers can be locked that way, not only the "lockable" ones. The previous behavior can be enabled in the settings (for shift only) but the default is changed.
2022-07-24Automatic capitalisation at beginning of sentencesJules Aguillon1-0/+21
Keep track of end-of-sentence characters while typing and automatically enable shift when appropriate. The last few characters just before the cursor need to be queried in some cases: Begin of input, cursor has moved or text is deleted. This might have a performance cost. This normally only enable shift but it also needs to disable shift when the cursor moves.
2022-06-24Revert "Remove the vibration settings"Jules Aguillon1-0/+2
Bring back the "Vibration" option. The duration option isn't added back because the vibration settings are still handled by Android. In fact, the option has no effect if the vibration are disabled in the system settings. This partially reverts commit ef03dfed5c802a855c4655204eee39a8769cfed7.
2022-06-24Fix localized key not in predefined positionJules Aguillon1-12/+16
The "loc " prefix for predefining a place for an "extra key" was broken since 31d6a70. The FLAG_LOCALIZED flag cannot be used anymore, as adding it to any key would turn it into a different key that wouldn't be recognized by parts of the code comparing the keys (placing the extra keys). Add an other layer in KeyboardData to store such informations.
2022-06-06Remove the interval between vibrationsJules Aguillon1-12/+3
This is no longer necessary since repeating key no longer cause a vibration.
2022-06-06Remove the vibration settingsJules Aguillon1-11/+4
Instead of using the vibrator directly, use performHapticFeedback, which will integrate better with the system settings.
2022-06-05Refactor: Abstract KeyValue fieldsJules Aguillon1-6/+6
The meaning of the public fields of KeyValue was quite complicated and not handled consistently accross the app. Make these fields private and add a more abstract API on top. The meaning of these fields changed recently and it wasn't an easy change. I plan on making more changes in the future.
2022-06-05Stop using flags for modifiersJules Aguillon1-11/+11
There was no free bits left to add new modifiers. Instead of increasing the width of the 'flags' field, refactor the way modifiers are represented and used. Modifers are now represented as independent values and stored in the 'code' field. A flag is added to distinguish between modifiers and keys with a key event. The most notable change is that modifiers can no longer be or-ed into a single value but have to be represented as an array.
2022-05-08Fix vibration when pointer move slightlyJules Aguillon1-14/+5
Fix the bug introduced in the parent commit.
2022-05-08Better handling of removed keys and swipe getureJules Aguillon1-1/+3
The "closest key" logic must be careful not to reveal keys removed by a modifier. Must check [_handler.onPointerSwipe] for every candidate values. [selected_value] is changed back to [selected_direction]. This adds a new bug: When the direction change, the selected value might not change but a vibration will be triggered anyway.
2022-05-07Set the color of the navigation barJules Aguillon1-0/+29
Since SDK 21, applications can set the background color of the navigation bar. This is normally simply an item in a theme but it is more complicated for keyboards.
2022-04-30Record activated modifiers on key downJules Aguillon1-8/+8
The View no longer keeps flags for something other than rendering.
2022-03-19Allow modifiers to hide keysJules Aguillon1-6/+7
Modifiers can temporarily remove a key from the layout by returning 'null'. Make sure pointer handling code handle these modified keys gracefully and doesn't trigger a key event and a vibration for the removed key.
2022-03-15Handle CANCEL touch eventsJules Aguillon1-3/+6
Handling this event is part of the API but was never done. This caused unstoppable key-repeat. This event isn't common, the only way I found on Android 10 is to switch to the emoji keyboard while holding a key. Some apps might cause this event more often.
2022-03-13Avoid showing some symbols twice in Fn modeJules Aguillon1-24/+17
2022-03-05Improve the code for dynamic updates of the layoutJules Aguillon1-22/+1
2022-02-27Reduce the text size for some keysJules Aguillon1-2/+2
The symbols are now smaller for Shift, Space, Backspace, Delete and some keys on the bottom row. The previous rule was to make the text smaller for symbols made of several characters. This is changed to a flag approach.
2022-02-27Compute text size depending on actual row heightJules Aguillon1-19/+25
Use the height of the row currently being rendered instead of the base row size. Concretely, the bottom row is slightly smaller and will get slightly smaller text. Also: - Rewrite the label rendering code - Render labels at the middle of the key (was slightly off)
2022-02-27Compute text size relative to key heightJules Aguillon1-5/+6
Instead of a fixed size that don't work at all for bigger screens. Other tweaks: - Use the value-land dimens to vary 'extra_horizontal_margin' - Move label size to Config, because it can change at runtime (rotation) - Slightly decrease the size of "long" symbols
2022-02-20Move pointer handling code to its own classJules Aguillon1-267/+91
Separate the concerns and have a clearer interface between the two parts of the code.
2022-02-06Allow egde keys instead of corner keys (swipe vertically/horizontally)Max Schillinger1-16/+54
Add a new boolean parameter "edgekeys" for defining keys that have the additional (swipe) keys on the edges (top, right, left, bottom) instead of at the corners (top left, top right, bottom left, bottom right).
2022-01-30Improve Action key detectionJules Aguillon1-8/+1
There were two problems: - The Action key was swapped when it shouldn't be. The flag 'IME_FLAG_NO_ENTER_ACTION' wasn't interpreted correctly for inputs that specified both an action and this flag. - The value 'IME_ACTION_UNSPECIFIED' should remove the Action key.
2022-01-15Fix miscalculation of the space between the keysJules Aguillon1-7/+7
'keyVerticalInterval' was mistakenly used to compute the height of the keyboard and the vertical position of keys. While the code handling pointers did not use this value, the hit box of the bottom row was shifted by several pixels. Make sure 'keyVerticalInterval' is only used for rendering and not for placing the keys.
2022-01-10Swap the Enter and Action keys when neededJules Aguillon1-2/+11
When IME_FLAG_NO_ENTER_ACTION is set.
2022-01-09Add the Action keyJules Aguillon1-2/+11
It is placed on the top-right of the enter key on every layouts. It sends a special event (performEditorAction) instead of writing a newline. The "actionId" is passed through the EditorInfo object in an obfuscated way so it's not clear whether it's using the right one.
2022-01-09Allow to hide more keys than just accentsJules Aguillon1-2/+2
Add the "FLAGS_LANGS" set of flags, which will be used to hide individual keys that are not accents.
2021-12-30Improve the "precision" optionJules Aguillon1-2/+2
Now named "swiping distance". Changed to a dropdown.
2021-12-30Move the border radius from Config to ThemeJules Aguillon1-4/+2
Also, draw activated keys with a round border too.
2021-12-28Separate "handler" codeJules Aguillon1-2/+2
As with the previous commit, remove casts of the context. The "handler" object is referenced in the "config" object for now.
2021-12-28Turn Config into a singleton objectJules Aguillon1-3/+3
The goal is to remove a cast of the 'context' into 'Keyboard2'.
2021-12-26Move Theme code to its own classJules Aguillon1-50/+14
2021-12-19Auto-format Java and XML filesJules Aguillon1-298/+298
Use xmllint. Re-indent Java files using spaces.
2021-12-05Avoid using getWidth() from onMeasure()Jules Aguillon1-6/+7
2021-05-09Add the accents preferenceJules Aguillon1-6/+6
This replaces the "disable accent keys" checkbox. The default should work for anyone: Accents will be hidden unless the user has the french language installed. The value "show every accents" is useful for versions of android that don't have subtypes.
2021-05-01Fix rendering of the first labelJules Aguillon1-7/+8
Caused by a shared Paint not correctly resetted.
2021-04-29Highlight activated keysJules Aguillon1-10/+37
2021-04-29Slightly reduce the size of the bottom rowJules Aguillon1-20/+18
2021-04-29Fix modifiersJules Aguillon1-42/+60
Fixes: - Toggling off a modifier was not possible in the corners (eg. accents). - Modifiers on the same key can't be activated at the same time. - Characters on the same key as a modifier weren't working properly.
2021-04-29Add the "layout" option againJules Aguillon1-2/+5
Some versions of android don't allow to configure several languages.
2021-04-25Tweak dimensionsJules Aguillon1-8/+8
Increase a bit labels size and reduce empty space between keys.
2021-04-24Scale down larger symbolsJules Aguillon1-7/+17
2021-04-24Add the label size optionJules Aguillon1-1/+1
2021-04-24Allow different sizesJules Aguillon1-42/+42
Improve Paint code.
2021-04-20Disable vibration when holding keysJules Aguillon1-4/+0
2021-04-20Add a setting for precise repeatJules Aguillon1-1/+1