Fix notification color

This commit is contained in:
h4h13 2019-11-01 22:40:37 +05:30
parent 24fbc59b11
commit df013ec904
5 changed files with 11 additions and 10 deletions

View file

@ -23,6 +23,7 @@ import android.graphics.Color
import android.graphics.drawable.Drawable
import android.widget.RemoteViews
import androidx.core.app.NotificationCompat
import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R
@ -113,7 +114,7 @@ class PlayingNotificationOreo : PlayingNotification() {
override fun onLoadFailed(e: Exception?, errorDrawable: Drawable?) {
super.onLoadFailed(e, errorDrawable)
update(null, Color.TRANSPARENT)
update(null, ATHUtil.resolveColor(service, R.attr.colorPrimary, Color.WHITE))
}
private fun update(bitmap: Bitmap?, bgColor: Int) {
@ -127,7 +128,7 @@ class PlayingNotificationOreo : PlayingNotification() {
}
if (!PreferenceUtil.getInstance(service).coloredNotification()) {
bgColorFinal = Color.WHITE
bgColorFinal = ATHUtil.resolveColor(service, R.attr.colorPrimary, Color.WHITE)
}
setBackgroundColor(bgColorFinal)
setNotificationContent(ColorUtil.isColorLight(bgColorFinal))