From 1970ecceea4f555220b6596a7e0f20c677007070 Mon Sep 17 00:00:00 2001 From: Karim Abou Zeid Date: Fri, 14 Aug 2015 21:32:04 +0200 Subject: [PATCH] Fixed notification coloring --- .../gramophone/helper/PlayingNotificationHelper.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java b/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java index 44b765e1..b980c166 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java +++ b/app/src/main/java/com/kabouzeid/gramophone/helper/PlayingNotificationHelper.java @@ -16,7 +16,6 @@ import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.NotificationCompat; -import android.support.v7.graphics.Palette; import android.view.View; import android.widget.RemoteViews; @@ -219,13 +218,10 @@ public class PlayingNotificationHelper { notificationLayout.setImageViewBitmap(R.id.icon, albumArt); notificationLayoutBig.setImageViewBitmap(R.id.icon, albumArt); if (isColored) { - Palette.Swatch vibrantSwatch = Palette.from(albumArt).resizeBitmapSize(100).generate().getVibrantSwatch(); - if (vibrantSwatch != null) { - int bgColor = vibrantSwatch.getRgb(); - setBackgroundColor(bgColor); - setNotificationTextDark(ColorUtil.useDarkTextColorOnBackground(bgColor)); - backgroundColorSet = true; - } + int bgColor = ColorUtil.generateColor(service, albumArt); + setBackgroundColor(bgColor); + setNotificationTextDark(ColorUtil.useDarkTextColorOnBackground(bgColor)); + backgroundColorSet = true; } } else { notificationLayout.setImageViewResource(R.id.icon, R.drawable.default_album_art);