gpt4 book ai didi

android - Nexus 和 Sony 设备上的通知图标看起来很糟糕

转载 作者:太空狗 更新时间:2023-10-29 13:14:45 27 4
gpt4 key购买 nike

我在我的应用程序的不同场景中呈现不同的通知。这些通知是使用以下代码创建的:

    protected void updateNotificationProgress() {
notification.setContentTitle(notificationConfig.getTitle())
.setContentText(String.format(getString(R.string.in_progress_formatted_string), (Utils.getUploadedFilesCount(this) + 1), Utils.getTotalUploadCount(this)))
.setContentIntent(notificationConfig.getPendingIntent(this))
.setSmallIcon(notificationConfig.getIconResourceID())
.setProgress(Utils.getTotalUploadCount(this), Utils.getUploadedFilesCount(this), false)
.setOngoing(true);

startForeground(UPLOAD_NOTIFICATION_ID, notification.build());
}

虽然在大多数设备(LG G3、Samsung Galaxy 设备)上,此通知如下所示:

enter image description here

enter image description here

在 Nexus 设备上,此图标如下所示:

enter image description here

enter image description here

为什么会发生这种情况,解决此问题的正确方法是什么?

最佳答案

从 I believe Lollipop 开始,操作系统会自动将您的图标更改为白色比例,以保持通知图标一致。

所以基本上我要说的是,如果两个设备都在 Lollipop 上,则您的 LG 设备没有遵循谷歌为通知设置的规则,并将它们更改为不这样做。

编辑

您看到某个应用的通知图标为彩色的原因是因为它们的目标 SDK (17) 仍低于 Lollipop (21),因此规则不适用于这些通知图标

关于android - Nexus 和 Sony 设备上的通知图标看起来很糟糕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36136213/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com