Skip to content

Android: Labs › Emoji search - #2965

Draft
R44VC0RP wants to merge 17 commits into
devfrom
android-emoji-search
Draft

R44VC0RP wants to merge 17 commits into
devfrom
android-emoji-search

Conversation

@R44VC0RP

Copy link
Copy Markdown
Collaborator

From a Hex Preview tester's feedback that Ryan tagged: "why can't I search emojies???". Hex for iPhone has emoji search; this brings it to Android.

What changes

New lab, Labs › Keyboard › Emoji search, off by default.

  • On: the emoji panel gets a Search emoji bar at its top (the grid gives up 48 dp for it; the panel's height is unchanged).
  • Typing: tapping the bar brings the keys back under a search field in the strip's place. Every key (letters, ?123, space, delete) types into the search, never into the app's field (KeyboardEngine.emojiQuery, the same idea as iPhone's EmojiRoutedTarget). Nothing typed there is suggested, autocorrected, swiped, learned by adaptive touch or kept; shift starts lowercase.
  • Results follow each key, in two rows where the panel's extra height is (above the field), so the keyboard never changes height. Ranking is the iPhone's, term for term (EmojiLibrary.search + EmojiSuggester.search): each word typed must start a word of the emoji's English name or keywords; whole name words, then name prefixes, then keywords; among equals a short name the query fills, then your recent emoji and the twelve everyday ones. Up to 60.
  • Empty query: your recently used emoji first (the panel's own Recently used list), then the everyday ones, then the smileys.
  • Picking types the emoji into the app's field, adds it to Recently used, and leaves the search open for more. ✕ or Return goes back to the panel (as on iPhone); Back leaves the search and the panel for the letters, typing into the field again. The emoji key also goes back to the panel.
  • Off: the panel has no bar; nothing else changes.

Data (new asset: 86 KB)

assets/emoji/search-en.txt: 1,923 lines of emoji<TAB>name words|keywords, cut from the iPhone keyboard's emoji-index-en.txt (Unicode emoji-test 18.0, CLDR 49 annotations under the Unicode License already in assets/licenses/unicode.txt, plus Hex's chat words) by the new android/scripts/build-emoji-search.py, which keeps only that column. 86 KB raw, about 32 KB compressed in the APK. Read once, off the main thread, the first time a search opens, and kept to emoji the phone can draw (Paint.hasGlyph, as Emoji suggestions does). English only. No network request.

Wording for Ryan to approve

English 简体中文
Row Emoji search 表情符号搜索
Detail Adds a search bar to the emoji panel: type an English word, like “laugh”, to find one 在表情符号面板中添加搜索栏:输入英文单词(例如“laugh”)即可查找表情符号
Bar / field hint Search emoji 搜索表情符号
No matches No emoji 没有表情符号
✕ (TalkBack) Close search 关闭搜索

Checks

  • :app:testDebugUnitTest: 404 tests pass, including five new ones in EmojiKeywordsTest.kt: name and keyword matches on the real asset (heart → ❤️, thumbs up → 👍, laugh → 😂, party → 🎉), word starts, case and accent folding, the ranking order and recent boost, the empty-query order, and the query's typing, delete and Return.
  • Release build: :app:minifyReleaseWithR8 passes.
  • API 36 emulator, light and dark: bar shown only with the lab on; search, pick (inserted into the field, search stays), ✕, Return, Back (field typing again), Recently used updated; settings row in English and Chinese. Screenshots and a short screen recording are with the coordinating session.

Notes

  • Skin tones: results show the default emoji; a toned pick still works from the grid. Follow-up if wanted.
  • Docs: android/README.md and docs/features/README.md updated.

R44VC0RP and others added 17 commits November 27, 2026 10:14
A tester asked to keep the space bar's hold for moving the cursor: today a
still hold opens the dictation-language menu and ends the press, so hold
then slide never moves the cursor. With the new lab on, a still hold for
Android's touch-and-hold delay turns the space bar into a trackpad (a click
says it took), one character per 12.6 dp from where the finger was held, as
iPhone Hex's trackpad, and lifting types nothing whether or not it moved.
Taps and plain slides are unchanged. The language stays in the Hex menu's
Language page, and TalkBack's long click on the space bar still opens it.
Off (the default), holding opens the menu exactly as before.

Verified: :app:testDebugUnitTest (400 tests, including the new
aHeldSpaceBarMovesTheCursorFromWhereItWasHeldAndTypesNothing) and the
release build's R8 step pass; on an API 36 emulator, hold-slide moved the
cursor, hold-release typed nothing, a tap typed a space, and with the lab
off the hold opened the language menu.
A tester asked to adjust how long a long press takes. Letter holds used a
fixed 300 ms and the space bar Android's touch-and-hold delay. The new
Labs › Keyboard › Hold delay row offers Short (200 ms), Default (300 ms)
and Long (500 ms), inside Gboard's Key long press delay slider (100 to
700 ms, 300 default). Default is today's timing exactly, so it is the lab
off. The space bar keeps Android's delay at Default and is scaled by the
same share otherwise (400 ms becomes 266 or 666 ms), so it always waits
longer than a letter. Pop-ups, haptics and Delete's repeat are unchanged.

Verified: :app:testDebugUnitTest (400 tests, including the new
holdDelayDefaultKeepsTodaysTimingAndTheSpaceBarScales) and the release
build's R8 step pass; on an API 36 emulator a held e showed its accents at
240 ms only with Short, at 350 ms with Default but not Long, and a 520 ms
space hold opened the language menu with Short and Default but not Long.
A tester asked why emoji can't be searched; Hex for iPhone can. With the
new lab on, the emoji panel gets a Search emoji bar. Tapping it brings the
keys back under a search field in the strip's place; every key types into
the query (KeyboardEngine.emojiQuery), never the app's field, with no
suggestions, corrections, swipes, adaptive touch or learning, and nothing
kept. Results follow each key in two rows in the panel's extra height, so
the keyboard keeps its height, ranked as iPhone Hex's EmojiLibrary.search
plus EmojiSuggester's everyday boost, with recent emoji lifted among
equals; an empty query shows recents, then the everyday emoji. A pick types
into the app's field and joins Recently used; the close button and Return
go back to the panel, and Back leaves for the letters (an
OnBackInvokedCallback on Android 13+, the key on 12). Off, the panel is
unchanged.

The index is a new 86 KB asset (1,923 emoji: name words and keywords),
generated from the iOS emoji index by android/scripts/build-emoji-search.py,
read the first time a search opens and kept to emoji the phone can draw.
No network request.

Verified: :app:testDebugUnitTest (404 tests, including five new search
tests in EmojiKeywordsTest) and the release build's R8 step pass; on an API
36 emulator in light and dark: search, pick, close, Return, Back, recents,
and the lab off.
dev pruned the Android feature-map tree from docs/features/README.md (#2979), so
that file takes dev's version; the lab's row in android/README.md is kept before
**Keyboard › Spatial autocorrect**, and the HexSettings and TypingPreferences
conflicts keep both sides' rows (Delete words when held, then Hold space to move
the cursor).
Conflicts are adjacent additions: the Page list and its Labs parent keep Hold
delays and Sounds; the Labs card keeps Delete words when held, then Hold delay;
the page switch keeps both cards. dev's reworked hold in typesOnLift is kept
(talks, flick and Click when a hold opens) with its delay now read from
TypingPreferences.holdDelay; docs/features/README.md takes dev's pruned version
(#2979) and the lab's row in android/README.md is kept.
The space bar's hold is now one line: #2963's holdSpace, scheduled with
#2964's delay (HoldDelay.space). The Labs card and android/README.md keep the
Hold delay row and the Hold space to move the cursor row, both kept across the
merge of origin/dev.
docs/features/README.md takes dev's pruned version (#2979); the lab's row in
android/README.md is kept. The delete-slide guard keeps the search's (no delete
slide while a search is open) on dev's renamed strip call (showStrip), and the
search also clears the strip through showStrip.
The space bar's hold keeps the search's guard (no menu or trackpad while the
emoji search is open) on #2963's holdSpace, and the held trackpad's first
character still waits for a whole step. The Labs strings and the README keep
both labs' rows.
The space bar's hold is now one line: #2963's holdSpace, scheduled with
#2964's delay (HoldDelay.space). The Labs card and android/README.md keep the
Hold delay row and the Hold space to move the cursor row, both kept across the
merge of origin/dev.
Both labs' strings are kept, and the README keeps Hold delay, Hold space to
move the cursor and Emoji search in the order the Labs card shows them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant