Fixed
Status Update
Comments
ig...@irl.com <ig...@irl.com> #2
We started noticing this on Android 8 and 8.1 devices after we upgraded appcompat library from 1.3.1 to 1.4.0. Seems like that the newest library is using a different/newer classes for handling emojis.
se...@google.com <se...@google.com> #3
Thanks for the report, this is a combination we didn't predict and need to resolve.
In the current version of the libraries, precomputed text won't work with the presence of emoji in 1.4.0. There is no workaround using precomputed text in the current library, so the best solution is to `setText` as proposed.
Notes for resolution (options discussed):
1. Disabling emoji processing for precomputed text from InputFilter etc
2. Integrate emoji into PrecomputedTextCompat to apply emoji processing prior to precomputation (needs research)
In the current version of the libraries, precomputed text won't work with the presence of emoji in 1.4.0. There is no workaround using precomputed text in the current library, so the best solution is to `setText` as proposed.
Notes for resolution (options discussed):
1. Disabling emoji processing for precomputed text from InputFilter etc
2. Integrate emoji into PrecomputedTextCompat to apply emoji processing prior to precomputation (needs research)
se...@google.com <se...@google.com> #4
Going live in next release.
In current release I would recommend one of
- disabling emoji2 on TextViews with precomputed text
- disabling precomputed text if EmojiCompat.process(source) adds any Spans (this may be done/checked on background thread)
To resolve this, precomputed text will be discarded iff an EmojiSpan is being added. This cost will only be incurred if the text requires a replacement span due to platform missing an emoji.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit db5061885534c4b23d4ab3a9246ee9cace4119d8
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Mar 08 14:47:07 2022
Unprecompute text when adding emoji
Emoji2 will now unwrap PrecomputedText to add emoji automatically. This
has the effect of discarding precomputed text when emoji spans are added.
Apps wishing to optimize this may call EmojiCompat.procss manually, then
avoid the PrecomutedText path if any spans are added.
Relnote: "Emoji2 will add emoji to PrecomputedText by discarding
previously precomputed text layout."
Fixes: b/211231958
Test: ./gradlew :e2:e2-bun:cAT
Change-Id: I47d066f5cd1f61e0d6338ecc133879fe5bda7e27
M emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/viewstests/EmojiTextViewProcessTest.java
A emoji2/emoji2/src/main/java/androidx/emoji2/text/UnprecomputeTextOnModificationSpannable.java
M emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiProcessor.java
https://android-review.googlesource.com/2025744
Branch: androidx-main
commit db5061885534c4b23d4ab3a9246ee9cace4119d8
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Mar 08 14:47:07 2022
Unprecompute text when adding emoji
Emoji2 will now unwrap PrecomputedText to add emoji automatically. This
has the effect of discarding precomputed text when emoji spans are added.
Apps wishing to optimize this may call EmojiCompat.procss manually, then
avoid the PrecomutedText path if any spans are added.
Relnote: "Emoji2 will add emoji to PrecomputedText by discarding
previously precomputed text layout."
Fixes:
Test: ./gradlew :e2:e2-bun:cAT
Change-Id: I47d066f5cd1f61e0d6338ecc133879fe5bda7e27
M emoji2/emoji2-bundled/src/androidTest/java/androidx/emoji2/bundled/viewstests/EmojiTextViewProcessTest.java
A emoji2/emoji2/src/main/java/androidx/emoji2/text/UnprecomputeTextOnModificationSpannable.java
M emoji2/emoji2/src/main/java/androidx/emoji2/text/EmojiProcessor.java
x3...@gmail.com <x3...@gmail.com> #6
Can I know in which appcompat version that includes this fix? I'm using appcompat v1.4.1 and suddenly receive a lot of such crash :(
se...@google.com <se...@google.com> #7
This fix will be in the next stable release.
kc...@gmail.com <kc...@gmail.com> #8
Hi someone is using my device for a business, Google ads, and a YouTube channel. The YouTube is mashup and I found a name in my Facebook where it should have only been my name. Now when I go to look up the emoji comments from the above I'll get a page saying I can't access and it won't let me go.
kc...@gmail.com <kc...@gmail.com> #9
I'd like to know if you can look into this or how will it go?
Description
Component used: Emoji2 Version used: 1.0.0, 1.0.1 Devices/Android versions reproduced on: API 30 Emulator with Google apis
What is the expected behaviour when using
TextView.setTextFuture
with text which contains emojis?At the moment we're seeing plain text that contains emojis be replaced with
EmojiSpans
which are not compatible withTextView.setTextFuture
.Our workaround is to process all text and check for instances of
MetricAffectingSpan
, if an instance is found we replacesetTextFuture
withsetText