abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2View.java
AgeCommit message (Collapse)AuthorFilesLines
2025-07-01Fix extra bottom margin when navbar buttons absent (#1024)Jules Aguillon1-29/+24
* 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
2025-06-29Fix unwanted bottom margin on Samsung OneUI 7 (#1022)Jules Aguillon1-18/+3
This fixes the unwanted margin at the bottom of the screen on Samsung One UI 7 based on Android 15.
2025-05-30Fix high keyboard height making it overflowsJules Aguillon1-7/+7
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.
2025-05-30Fix label size when the keyboard is unusually highJules Aguillon1-5/+18
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.
2025-03-22Fix label brightness not being appliedJules Aguillon1-4/+2
This is due to Paint.setColor overriding any alpha value set with Paint.setAlpha. Bug was added in 653c598.
2025-03-15Selection mode (#913)Jules Aguillon1-0/+7
* 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.
2025-02-27Fix miscalculation of the bottom marginJules Aguillon1-4/+4
'_marginBottom' might be uninitialized when used.
2025-02-09Refactor: Compute appearance values before onDrawJules Aguillon1-48/+30
This moves some computations that used to be done during onDraw into the new Theme.Computed class. This also removes Paint objects from the Theme class, making it data-only. This is a requirement for making some keys render differently.
2024-12-31Refactor: Simplify double tap for capslockJules Aguillon1-5/+0
This doesn't fix a bug but remove some tricky code. The shift key is no longer different when the "double tap for capslock" option is on. The handling of the option is moved to Pointer instead and becomes simpler.
2024-12-28Fix status bar artifact on opens and closesJules Aguillon1-1/+1
On API 30 to 34, the status bar changes color when the keyboard appears and disappears. A ghost of the changed status bar is animated by the same animation used for the keyboard, which is unexpected.
2024-12-26Remove labels for the anti-clockwise circle gestureJules Aguillon1-24/+4
These labels are often unwanted and easily collide with other labels.
2024-12-26Proper support for Android 15 edge-to-edge (#848)Jules Aguillon1-18/+48
The keyboard background now extends under the system bars and display cutout on Android 15 but the keys do not. The back and IME switching buttons that appear in the navigation bar require special care to not overlap with the keyboard. The launcher and settings activity are also fixed.
2024-12-24Fix unecessary bottom margin on Android 14Jules Aguillon1-2/+2
2024-12-24Fix keyboard drawing behind nav bar on Android 15Jules Aguillon1-4/+9
Bug added in 038f693.
2024-06-06Don't cap indication lengthJules Aguillon1-2/+5
This was inadvertently changed when the anti-circle gesture was introduced, which use the same rendering logic.
2024-05-29Fix overflow due to navigation on the right and cutouts (#641)Jules Aguillon1-0/+15
Take display cutouts and navigation bars when computing the keyboard width on SDK >= 30.
2024-05-29Configure anticircle gesture per-key (#644)Jules Aguillon1-11/+26
This adds the new 'anticircle' attribute to layouts '<key>' elements that configure the key to send when doing a anti-clockwise circle gesture on it. Labels are drawn the same way as indication. Updated docs.
2024-04-01refactor: Apply the modmap in KeyModifierJules Aguillon1-9/+1
This makes possible to apply other modifiers to mapped keys and ensures that the modmap really override the shift key behavior.
2024-03-11refactor: Use internal flags in PointersJules Aguillon1-1/+1
'FLAG_LOCKED' and 'FLAG_FAKE_PTR' are only used within Pointers. Define new flags in Pointers and remove these from KeyValue. Also allows to define new flags.
2024-03-03Fix auto-capitalisation disabling locked shiftJules Aguillon1-13/+1
Shift locked via the "caps lock" key use the "fake pointer" mechanism that is also used by auto-capitalisation. Make sure that unlatching a fake pointer do not disabled a locked modifier. The implementation is moved into the Pointers class for a safer API and easier implementation.
2024-02-17compose: Grey out keys that are not in sequenceJules Aguillon1-4/+8
Keys that are not in the pending compose sequence are greyed out with the new 'FLAG_GREYED' flag.
2024-02-17Compose keyJules Aguillon1-7/+25
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.
2024-02-10Fix various linter warningsJules Aguillon1-1/+3
Among others: - Use `apply` instead of `commit` when saving shared preferences. - Avoid inlined Api - Remove unused resources
2024-02-10Custom border settings (#524)RetrogisusDEV1-4/+10
2024-01-28Redefined the key margin options in percentJules Aguillon1-4/+8
Define the key margin options relative to the baseline dimensions of keys. This removes the doubling of the horizontal margin in landscape mode.
2024-01-26Send down event for modifiers on timeJules Aguillon1-2/+7
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.
2024-01-13Refactor: Keyboard2View: Take layout id attrJules Aguillon1-1/+6
Removes EmojiBottomRow.
2024-01-09Revert "Remove the vibration settings"Jules Aguillon1-1/+1
This reverts commits ef03dfed5c802a855c4655204eee39a8769cfed7 and ff01678ba688778d67f824a0be56634974c1b0e8. The "vibration duration" slider is bought back. The "vibration enabled" option is replaced by "custom vibration", which switch between the system haptic feedback or the custom vibration. The slider is greyed when "custom vibration" is unchecked and is allowed to have a value of 0 to disable vibrations within the app. The intermediate values "light", "medium" and "strong" are removed and no migration of the setting is made.
2023-09-10Refactor: Compute key positions in layoutsJules Aguillon1-0/+3
`KeyboardData.getKeys()` now returns a map of the keys present on the layout to their position. Positions are the row, column and swipe direction. The computed map is cached in the KeyboardData object as it might be accessed later by `findKeyWithValue`, which now do less work.
2023-08-26Disable automatically Shift when pressing CtrlJules Aguillon1-2/+3
Automatic capitalisation might interferes with keyboard shortcuts.
2023-08-07Don't elide label of non-string keysJules Aguillon1-1/+5
Several non-string keys can have a large label that shouldn't be elided, for example ctrl, meta, send. Also, change the cutoff to 3 characters as labels are easily colliding.
2023-08-06Elide custom keys labelsJules Aguillon1-1/+2
Make the font smaller for custom keys with a length above 1. Draw up to 4 characters on keys.
2023-06-03More control over vibrationJules Aguillon1-8/+1
The newer haptic feedback API that is used instead of the vibrator service since ef03dfe doesn't work for everyone. The new vibration option allow to choose both the newer API ("system") and the older API ("strong", "medium", "light").
2023-06-03Per-layout shift modmapJules Aguillon1-2/+11
Specify the behavior of shift for a layout. This is intended for locales that use the same alphabet but have different capital letters (eg. Bengali). The modmap is defined like this: <keyboard> <modmap> <shift a="a" b="A"/> </modmap> </keyboard>
2023-03-05Refactor: Remove KeyboardData.CornerJules Aguillon1-5/+5
The Corner class is removed. The "localized" flag for all the corners is held in a bitfield.
2023-03-03Allow 8 symbols per keyJules Aguillon1-19/+21
'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-02Fix caps lock stopped by auto-capitalisationJules Aguillon1-0/+9
Auto-capitalisation triggers when the backspace key is used. Make sure to not remove a locked shift pointer.
2023-02-26Fix miscalculated keyboard height with number rowJules Aguillon1-1/+0
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-01-30Apply modify_layout to text layout onlyJules Aguillon1-1/+1
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to implement more complicated transformations to the layouts.
2023-01-15Separate option for bottom margin in landscape modeJules Aguillon1-2/+2
A large margin in portrait mode is desirable but generally not in landscape mode.
2023-01-15Separate option for horizontal margin in landscape modeJules Aguillon1-5/+5
A separate option is needed, the +25dp offset wasn't enough.
2022-12-11Make the keyboard transparent (#252)Chasm Solacer1-2/+6
* 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-04Correctly handle pointer cancel eventsJules Aguillon1-1/+1
The cancel event ends the motion, it doesn't apply to a single pointer like it was previously expected.
2022-11-13Fix missing version checkJules Aguillon1-7/+10
setSystemGestureExclusionRects is API 29. Broken since d644d2b, which almost got into the release!
2022-11-13Draw borders and update themesJules Aguillon1-3/+37
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-13Highlight activated keys labelJules Aguillon1-3/+2
Rendering change only.
2022-11-13Refactor: Move editing code from to KeyEventHandlerJules Aguillon1-2/+2
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-11Add option for brightness of labelsJules Aguillon1-0/+2
The brightness value is used as the alpha value when drawing the labels.
2022-11-11Dim secondary keysJules Aguillon1-4/+6
Reduce the constrast of "secondary" labels. Modifiers (except diacritics), event and keyevent keys are considered secondary.
2022-11-11Disable the back-gesture on the keyboard areaJules Aguillon1-0/+16
as well as other system gestures that would interfere with the keyboard's own swipe gesture.