【发布时间】:2021-04-19 07:42:55
【问题描述】:
我想在我的应用中支持华为设备的表情符号。对于所有其他供应商,我使用这样的代码来初始化 EmojiCompat:
val fontRequest = FontRequest(
"com.google.android.gms.fonts",
"com.google.android.gms",
"Noto Color Emoji Compat",
R.array.com_google_android_gms_fonts_certs
)
val config = FontRequestEmojiCompatConfig(context, fontRequest)
EmojiCompat.init(config)
但是对于华为设备,因为他们无法访问谷歌资源(我的猜测),它不起作用,并且 EmojiCompat 没有被初始化。我知道可以使用BundledEmojiCompatConfig,但我更愿意总是获取最新的字体。
对于华为设备,Google 的 providerAuthority/Package 是否有替代方案?
【问题讨论】:
-
我在
Font和FontRequest上搜索 HMS AppConnect 和 HMS Core 文档,似乎他们没有任何服务。你应该使用捆绑。 -
那是不幸的。我猜华为的生态系统还没有。感谢您的回答!
-
您遇到了什么具体错误?在哪个设备型号上?我刚刚在华为 Mate 30 Pro(没有 Google 服务)上测试了这个样本 github.com/android/user-interface-samples/tree/main/EmojiCompat,它正在工作
标签: android fonts emoji huawei-mobile-services google-fonts