hex/android/app/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 7ed860ff63
Android keyboard: emoji panel memory, Hex menu on a field type change, Auto-capitalisation off, French touch geometry (#2311)
* Android keyboard: one emoji picker instead of a new one per opening; the Hex menu closes when the app changes the field's type

Emoji panel memory
- openEmoji made a new AndroidX EmojiPickerView every time and removed the old one, which was never
  collected: each EmojiView draws into its own ARGB bitmap, so every opening kept about 5 MB of native
  heap (and the old views on the Java heap). Over 50 openings, from a fresh process:
  API 36: PSS 82 -> 359 MB, native 20 -> 272 MB, Java 17 -> 38 MB
  API 31: PSS 63 -> 310 MB, native 15 -> 231 MB, Java 11 -> 37 MB
  The meminfo Graphics and GL mtrack rows stayed at 0 throughout: none of it is the emulator's software
  graphics, it is the pickers' bitmaps in the app's own heap, as it would be on a phone.
- Now the keys keep one picker for their life, hidden while closed. A new picker was what refreshed the
  Recently used row (the picker reads recents as it starts), so each opening hands it the recents again
  (setRecentEmojiProvider refreshes the row) and taps its Recently used tab, so it opens at the top as a
  new one did. RecentEmoji keeps the recents where AndroidX's own provider does (its preferences file and
  key, newest first), because that provider is internal; recents chosen before carry over. The grid is
  sized once (again only if the panel's height changes).
- After, same 50 openings: API 36 PSS 82 -> 91 MB, native 20 -> 25 MB; API 31 PSS 63 -> 74 MB, native
  15 -> 21 MB.

Hex menu and a field changing type in place
- With the Hex menu open, an app restarting input on the same box with another type (text to password)
  left the menu over the new field's keys. HexKeyboard notes the field's inputType and imeOptions; when a
  restart changes them, onStartInputView closes the menu without setting typing up (closeMenu(configure =
  false)), since configureTyping right after it draws the keys once. The same type restarting (a chat app
  clearing its box) leaves the menu open.

Verified (emulator only, Pixel 8, API 36 and 31): the memory figures above; an emoji picked from People,
the panel closed and reopened: it opens at Recently used with that emoji first; menu open, field turned
password: the letter keys with the password note; menu open, same type restarted: menu stays.

* Android keyboard: Auto-capitalisation off adds no capitals; AZERTY's touch geometry from its own rows

From the typing helper's end-to-end check (bb4674ab).

Auto-capitalisation
- configureTyping now hands the typing model the setting (TypingWord.addsCapitals = Auto-capitalisation),
  on a new word and on the kept one, so with it off autocorrect and suggestions add no capitals either.
  Checked live in a sentence-capitalising field, typing "i think id help on monday ": on gives "I think
  I'd help on Monday ", off gives "i think i'd help on monday ".

French geometry
- KeyPlaneView.geometry() took the key pitch from q, w and a. On AZERTY those sit on other rows, so the
  decoder got 160 x -155 px instead of 107 x 155, which loosened the touch model and turned off the
  bottom row's missed-space reading. It now measures from the layout's first two keys and the first key
  of the row under them (KeyboardLetters.rows), and leaves the apostrophe out of the letter centres.
- Pitches logged live (Pixel 8, before -> after): en, es, it 107x155 -> 107x155; de, nb 97.5x155 ->
  97.5x155; fr 160x-155 -> 107x155 (26 of its 27 keys, without the apostrophe).
- French, typed at the key centres: "il aecgaple a la orison " -> "il aecgaple à la prison "; "lanprison "
  -> "la prison " (n on the bottom row read as the missed space).

Lost tap after the automatic capital: not reproduced, nothing changed
- A capitalised first letter and the second 0, 10, 20, 40 and 80 ms after it lifted, and 30 ms before it
  lifted (overlapping), 100 sentences each in a done field: 600 of 600 landed whole.

Verified (emulator only, Pixel 8, API 36): the above; assembleDebug, testDebugUnitTest and lintDebug pass.
2026-11-21 22:51:10 -05:00
..
main Android keyboard: emoji panel memory, Hex menu on a field type change, Auto-capitalisation off, French touch geometry (#2311) 2026-11-21 22:51:10 -05:00
release Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
test/java/ly/anoma/hex Android typing: end-to-end check fixes, Auto-capitalisation off, French and Italian words between words (#2308) 2026-11-21 22:01:36 -05:00