mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* Android keyboard: Gboard's key geometry, the Hex mark in the strip, and the recording bar growing out of it What changed, and why: thumbs trained on Gboard should land right on Hex, and the strip should look and act like the iPhone keyboard's. - Geometry (KeyboardMetrics, new KeyRowLayout): measured from Gboard on a Pixel 8 emulator (API 36) in the same field: row 1's keycaps 52.2 dp below the top, 47 dp keycaps on a 58.9 dp pitch with 5.33 dp gaps, row 4 ending 12 dp above the system's bar, 7 dp corners, 26 sp letters. Hex's keys now sit within a pixel of Gboard's on API 36 and API 31. Every point of the key area types a key: gaps split down the middle, row 2's outer keys and the bottom row reach the edges, row 1 reaches 2 dp into the strip, as Gboard's do (black-box taps). Landscape uses Gboard's 43 dp rows. - Bottom row: ?123, comma, space, period, enter (Gboard's without its emoji key). The Hex key moved to the strip's trailing end, where Gboard has its mic and the iPhone keyboard has the Hex mark. - The globe key is removed: Android draws its own keyboard switcher in the navigation bar whenever two keyboards are on (checked with 3-button navigation on API 31 and gesture navigation on API 36); Hex menu gets a Next keyboard row for devices that hide it. - Edge to edge: keys stay above systemBars() (Android 14+ reports the IME's 48 dp back/switcher bar as the caption bar; navigationBars alone is the 24 dp handle, which let row 4 run 16 dp into it). - Strip: the likeliest word in the middle slot (Gboard and iPhone); when space would autocorrect, what you typed in quotes on the left and the fix in a word-width chip in the middle (KeyboardEngine passes TypingWord.replacement() through the surface; the fix itself is unchanged). - Recording: the Hex mark turns into ✓ in place (same view, so a hold's finger-up still finishes), the waveform's well grows leftwards out of it and ✕ fades in beside it; ✓ becomes the spinner. - Shift shows outline, filled, and filled-with-bar for off, on and caps lock on a grey key. - The decoder now gets the space bar's keycap (KeyGrid space, from #2241), so a tap just above space can read as a missed space. Replaced: the bottom-row Hex key and globe key; swipe-up-only on the Hex key (any 10 dp slide opens the menu now, as on iPhone); the black shift key when shifted; best suggestion on the left. Verified (emulator only, Mac Studio; Ryan has no Android phone): assembleDebug, testDebugUnitTest (16 tests) and lintDebug (warnings only, same kinds as before) pass. Pixel 8 AVDs at API 36 and 31, probe app's text field next to Gboard: key rectangles measured from screenshots match Gboard's within a pixel; edge, gap and above-row taps type the same keys as Gboard's (one difference: Gboard types q 18 px above row 1's keycap, Hex 21); typing "teh" shows “Teh” | The (chip) | They, space types "The ", delete restores "Teh"; a WAV through the emulator microphone dictated the full sentence into the field with the new recording bar, light and dark; Hex menu opens on a slide. * Android keyboard: slide on the space bar to move the cursor, as on Gboard What changed: a slide on space now moves the cursor along the text at once. Measured from Gboard on a Pixel 8 emulator (API 36, black box): the first character after about 45 px (17 dp) of travel and one more every 33 px (12.6 dp), linear, both ways; Hex uses those numbers. It moves whole characters (an emoji with a skin tone is one) by setting the selection from where the slide began; without a known cursor position, or in a password field whose text it shouldn't read, it steps with arrow keys. Why: Android users slide on space to place the cursor; Hex had no cursor control at all. Spaces are never lost: a press that lifts within 180 ms types its space however far it drifted, and so does any press that never started moving the cursor, even one that slid off the key. Replaced: before, a press that left the space key's bounds typed nothing. Long press, held still, still opens Hex's dictation-language menu (Gboard types a space there); once the finger moves it doesn't. Verified (emulator only, Pixel 8 AVDs, probe app field "The quick brown fox jumps over the lazy dog", cursor at the end, 'input swipe' gestures): - quick taps of 60, 100 and 150 ms drifting 8, 21, 31, 42 and 63 px (up to 24 dp) typed a space 15 of 15 times on API 36 and on API 31; Gboard: 15 of 15; - slides over 300 ms of 21/42/63/126/252/525 px: Hex space, space, 1, 3, 7, 15 characters left; Gboard exactly the same; right at the end of the text moves nothing; up types a space; - differences: Gboard types a space for some 200 ms flicks (63 and 252 px) where Hex moves the cursor; a still hold opens Hex's menu where Gboard types a space (decided); - "ab👍🏽cd": 3 characters left lands before the emoji's start (offset 2), 5 at 0; password field: 160 px moved 4 characters with arrow keys; - testDebugUnitTest: three new cases in InsertionTest (drifting taps, slide steps, emoji steps), 19 tests pass. * Android keyboard: work out the autocorrection chip after a 100 ms pause, not inside the keystroke What changed: the strip's correction chip (#2249) asked the decoder for what space would do on every letter, inside the key's own handling. Measured on the API 31 emulator (temporary timing around KeyboardEngine.letter, 108 letters of a typed sentence with typos): that search took 1.97 ms median, 16.1 ms p95 and 21 ms at worst, 77% of each keystroke (letter() 3.1 ms median, 19.0 ms p95). Now the letter commits and the suggestions show at once, and the chip is worked out 100 ms later unless another letter came first (then it waits again). Space still decides its correction itself, exactly as before, so what gets typed doesn't change. After (same run): letter() 1.36 ms median, 4.3 ms p95; the deferred chip 1.5 ms median, 5.3 ms p95, between keys. The typed sentence came out identical before and after ("The quick brown fox jumps over the lady dog ... because people like to write long sentnces"). Emulator only; a phone's CPU is slower, so the gap there is larger. Replaced: the inline chip computation. * Android keyboard: slide left from delete to delete words, and delete repeats at Gboard's pace What changed (measured from Gboard on a Pixel 8 emulator, API 36, black box, and matched): - Slide left from delete: past about 140 px (53 dp) the word before the cursor is selected in the field, one more word every 95 px (36 dp); sliding back selects fewer; lifting deletes what is selected, and nothing if the finger came back. Words are what Option-Delete takes: "far away from home" selects "home", then "from home". Not in password fields, with a selection, or when the cursor position is unknown (then delete works as before). - A press that drifts up to about 32 dp is still one delete; one that went further and selected nothing deletes nothing, as Gboard's does. - Held still, delete repeats after 400 ms every 50 ms, and stops repeating once the finger moves. Replaced: 380 ms then every 65 ms, and a repeat that kept going while the finger slid. Why: Gboard users delete words with this slide; iPhone Hex has its own live version (DeleteWordSwipe), but on Android the platform convention is select, then delete on lift. Verified (emulator only, Pixel 8, probe field "The quick brown fox jumps over the lazy dog and runs far away from home", cursor at the end): - slides over 500 ms of 60/107/130/160/190/214/250/300/350 px: Hex 1 character, nothing, nothing, 1, 1, 1, 2, 2, 3 words, the same as Gboard on every one (API 36; 60/107/214 also on API 31); 428 px gave 3 or 4 words between runs (Gboard 4, it sits on the boundary); - 330 px out in 30 px steps and back to 120 px: selection 1, 2, 3, 2, 1, 0 words, nothing deleted, as Gboard; - holds of 400/800/1200/2000/3000 ms deleted 1/8/16/31/51 characters (Gboard 1/8/16/31/50); - testDebugUnitTest: 20 tests pass (word lengths and the gesture added to InsertionTest). |
||
| .. | ||
| src | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||