为什么库存图像资源在通知中模糊不清?

时间:2018-08-22 08:49:54

标签: android android-notifications

您知道为什么这些媒体控件显得模糊吗? Notifications

我正在创建图标,这样:

start = Icon.createWithResource(this, android.R.drawable.ic_media_play);
pause = Icon.createWithResource(this, android.R.drawable.ic_media_pause);
reset = Icon.createWithResource(this, android.R.drawable.ic_media_previous);
finish = Icon.createWithResource(this, R.drawable.ic_media_stop);

然后创建各种Notification.Action实例:

public Notification.Action getStartAction() {
    PendingIntent pendingIntent = getPendingIntent(NOTI_START_CLICKED);
    return new Notification.Action.Builder(start, "Start", pendingIntent).build();
}

然后添加到Notification.Builder

Notification noti = getNotificationBuilder(time, description)
            .addAction(getResetAction())
            .addAction(getFinishAction())
            .addAction(getStartAction())
            .setStyle(new Notification.MediaStyle().
                    setShowActionsInCompactView(0, 1, 2))
            .build();
    notificationManager.notify(MEDITATION_NOTIFICATION_ID, noti);

finish图标是我自己的,而其他图标都来自框架,所以我不明白为什么它们不那么清晰。它是由compileSdkVersion 27 Oreo构建的,并在运行8.1.0的Nexus 5X上运行。

0 个答案:

没有答案