Repository navigation
android keyboard: emoji shortcodes (:fire β π₯) in labs - #3023
Open
opencodejr[bot] wants to merge 1 commit into
Open
opencodejr[bot] wants to merge 1 commit into
opencodejr[bot] wants to merge 1 commit into
Conversation
opencodejr
Bot
force-pushed
the
agent/issue-3009
branch
2 times, most recently
from
November 28, 2026 05:09
325fc68 to
f0b37d5
Compare
opencodejr
Bot
force-pushed
the
agent/issue-3009
branch
from
November 28, 2026 05:16
f0b37d5 to
71741b9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Labs βΊ Keyboard βΊ Emoji shortcodes (off by default) to the Android keyboard, ported from iPhone Hex's lab (#2432). Requested in #3009 by @dgunay; this is a fresh implementation from the iOS source, no code taken from the fork.
Behaviour (toggle on)
:nameafter a space, a line break or the start of the field shows up to 3 emoji in the strip, best in the middle. An exact name or alias comes first, then emoji whose name or keywords start with the name (:pizβ π). Only one emoji per family is shown.:name. A closing:after a full name (:fire:) does the same. No space is added.EmojiShortcode.token: at least two ASCII letters or digits, then letters, digits,_,+and-. Soabc:pizza,:p,:-D,:+1and10:30stay text. Matching ignores case and reads_,+and-as spaces (:thumbs_upβ π).TYPE_NULLeditors.Paint.hasGlyph) are dropped. Their line numbers are kept, so the tables still point at the right emoji.Changes
android/scripts/build-emoji-shortcodes.pybuildsassets/emoji/shortcodes-en.txt(168 KB) from iOS'semoji-index-en.txt. It keeps each emoji's version, family and search words, plus word and phrase postings at or above iPhone's 0.85 strong line, and checks that a few required shortcodes are present.typing/EmojiShortcode.kt: the index parser and a Kotlin port of iPhone's token, matching (exact hits, prefix search scoring, one per family) and completion.keyboard/EmojiShortcodes.kt: lazy background loader, modelled onEmojiWords.KeyboardEngine: shows shortcode emoji after typing or deleting token characters, handles the closing:, and takes strip picks. A tap on a stale shortcode emoji is ignored rather than typed as a word, and the strip is cleared when the cursor leaves the token.Suggestion.Kind.Shortcode, placed like words (best in the middle) and described as an emoji for accessibility.emojiShortcodespreference, a Labs βΊ Keyboard toggle, English and Chinese strings, and a README paragraph.Differences from iPhone
Testing
EmojiShortcodeTest(JVM) against the bundled asset: token rules, exact-first ranking, aliases and case, one per family, the closing colon taking only full names, skipping undrawable emoji, and strip order../gradlew :app:compileDebugKotlin :app:testDebugUnitTest: all 407 unit tests pass.:fireβ π₯ π π§―,:pizβ π,:okβ π π π.python3 scripts/code-shape.py --check: no problems.Closes #3009