Fixed notification coloring
This commit is contained in:
parent
3454d32850
commit
1970ecceea
1 changed files with 4 additions and 8 deletions
|
|
@ -16,7 +16,6 @@ import android.os.Build;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.support.v7.graphics.Palette;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
|
|
@ -219,14 +218,11 @@ public class PlayingNotificationHelper {
|
||||||
notificationLayout.setImageViewBitmap(R.id.icon, albumArt);
|
notificationLayout.setImageViewBitmap(R.id.icon, albumArt);
|
||||||
notificationLayoutBig.setImageViewBitmap(R.id.icon, albumArt);
|
notificationLayoutBig.setImageViewBitmap(R.id.icon, albumArt);
|
||||||
if (isColored) {
|
if (isColored) {
|
||||||
Palette.Swatch vibrantSwatch = Palette.from(albumArt).resizeBitmapSize(100).generate().getVibrantSwatch();
|
int bgColor = ColorUtil.generateColor(service, albumArt);
|
||||||
if (vibrantSwatch != null) {
|
|
||||||
int bgColor = vibrantSwatch.getRgb();
|
|
||||||
setBackgroundColor(bgColor);
|
setBackgroundColor(bgColor);
|
||||||
setNotificationTextDark(ColorUtil.useDarkTextColorOnBackground(bgColor));
|
setNotificationTextDark(ColorUtil.useDarkTextColorOnBackground(bgColor));
|
||||||
backgroundColorSet = true;
|
backgroundColorSet = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
notificationLayout.setImageViewResource(R.id.icon, R.drawable.default_album_art);
|
notificationLayout.setImageViewResource(R.id.icon, R.drawable.default_album_art);
|
||||||
notificationLayoutBig.setImageViewResource(R.id.icon, R.drawable.default_album_art);
|
notificationLayoutBig.setImageViewResource(R.id.icon, R.drawable.default_album_art);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue