File tree Expand file tree Collapse file tree
ui/src/main/java/com/thelightphone/lp3Keyboard/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1414# Kotlin code style for this project: "official" or "obsolete":
1515kotlin.code.style =official
1616android.useAndroidX =true
17- projectVersion =0.0.10
17+ projectVersion =0.0.11
Original file line number Diff line number Diff line change 1+ package com.thelightphone.lp3Keyboard.ui
2+
3+ fun isEmojiCodePoint (cp : Int ): Boolean {
4+ // ZWJ and variation selector-16 are combiners, not standalone glyphs.
5+ if (cp == 0x200D || cp == 0xFE0F ) return false
6+ return cp in 0x1F000 .. 0x1FFFF || // Most modern emoji (supplementary plane)
7+ cp in 0x2300 .. 0x23FF || // Misc Technical (⌚ ⌛ ⏰ …)
8+ cp in 0x2600 .. 0x27BF || // Misc Symbols, Dingbats (☀ ✨ ❤ …)
9+ cp in 0x2B00 .. 0x2BFF // Misc Symbols & Arrows
10+ }
11+
12+ fun parseEmojiString (allEmojis : String? ): List <Int >? {
13+ if (allEmojis == null ) return null
14+ val codePoints = mutableListOf<Int >()
15+ var i = 0
16+ while (i < allEmojis.length) {
17+ val cp = allEmojis.codePointAt(i)
18+ if (isEmojiCodePoint(cp)) codePoints.add(cp)
19+ i + = Character .charCount(cp)
20+ }
21+ return codePoints
22+ }
You can’t perform that action at this time.
0 commit comments