Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
I use another span for the custom background, such as ReplacementSpan, and draw the background, which has the same issue.
When the emoji in the clickable link, the highlight is also can not support it.
When the emoji in the clickable link, the highlight is also can not support it.
so...@google.com <so...@google.com> #3
Nona, could you please help triaging this one? Thanks!
se...@google.com <se...@google.com> #5
Thanks for the report!
I will fix the background issue on this bug.
Looking at the clickable link, it appears correct in my quick repro. Please file a separate bug for that with repro screenshot and code listing, thanks!
bu...@google.com <bu...@google.com> #9
Hi. I've received your bug and will wait until https://android-review.googlesource.com/2153805 is closed and then unCc myself.
bu...@google.com <bu...@google.com> #11
Hi. I've received your bug and will wait until https://android-review.googlesource.com/2153805 is closed and then assign the bug to seanmcq@google.com and unCc myself.
ap...@google.com <ap...@google.com> #12
Project: platform/frameworks/support
Branch: androidx-main
commit 15ef5cb171dd7b91555fda17a41a12029b60f320
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Jul 14 16:11:33 2022
Draw background in EmojiSpan
TextLine draws ReplacementSpans prior to configuring BackgroundSpans,
in a separate for loop. As a result, replacement spans don't honor surrounding
backgrounds.
Change EmojiSpan to apply background itself, as if TextLayout had correctly
rastered behind the replacement span or updated the TextPaint with bgColor.
Test: ./gradlew :e2:e2:cAT
Bug: b/230525134
Relnote: "Emoji2 will now correctly draw backgrounds from BackgroundSpan."
Change-Id: Ide6a8542179a2676cefc16dcf3f3d43e6f376de6
M emoji2/emoji2/src/androidTest/java/androidx/emoji2/text/EmojiSpanTest.java
M samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/MainFragment.java
M emoji2/emoji2/src/main/java/androidx/emoji2/text/TypefaceEmojiSpan.java
M samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/ConfigLayout.java
https://android-review.googlesource.com/2153805
Branch: androidx-main
commit 15ef5cb171dd7b91555fda17a41a12029b60f320
Author: Sean McQuillan <seanmcq@google.com>
Date: Thu Jul 14 16:11:33 2022
Draw background in EmojiSpan
TextLine draws ReplacementSpans prior to configuring BackgroundSpans,
in a separate for loop. As a result, replacement spans don't honor surrounding
backgrounds.
Change EmojiSpan to apply background itself, as if TextLayout had correctly
rastered behind the replacement span or updated the TextPaint with bgColor.
Test: ./gradlew :e2:e2:cAT
Bug:
Relnote: "Emoji2 will now correctly draw backgrounds from BackgroundSpan."
Change-Id: Ide6a8542179a2676cefc16dcf3f3d43e6f376de6
M emoji2/emoji2/src/androidTest/java/androidx/emoji2/text/EmojiSpanTest.java
M samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/MainFragment.java
M emoji2/emoji2/src/main/java/androidx/emoji2/text/TypefaceEmojiSpan.java
M samples/SupportEmojiDemos/src/main/java/com/example/android/support/text/emoji/ConfigLayout.java
se...@google.com <se...@google.com>
na...@google.com <na...@google.com> #14
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.emoji2:emoji2:1.3.0-alpha01
Description
Version used:
Devices/Android versions reproduced on:
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
SpannableString name = new SpannableString("Test š«š«š« emoji");
name.setSpan(new BackgroundColorSpan(Color.RED), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Textview tv = findViewbyId(R.id.text)
tv.setText(name);