Fix notification color
This commit is contained in:
parent
24fbc59b11
commit
df013ec904
5 changed files with 11 additions and 10 deletions
File diff suppressed because one or more lines are too long
|
@ -23,6 +23,7 @@ import android.graphics.Color
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.widget.RemoteViews
|
import android.widget.RemoteViews
|
||||||
import androidx.core.app.NotificationCompat
|
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.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
@ -113,7 +114,7 @@ class PlayingNotificationOreo : PlayingNotification() {
|
||||||
|
|
||||||
override fun onLoadFailed(e: Exception?, errorDrawable: Drawable?) {
|
override fun onLoadFailed(e: Exception?, errorDrawable: Drawable?) {
|
||||||
super.onLoadFailed(e, errorDrawable)
|
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) {
|
private fun update(bitmap: Bitmap?, bgColor: Int) {
|
||||||
|
@ -127,7 +128,7 @@ class PlayingNotificationOreo : PlayingNotification() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PreferenceUtil.getInstance(service).coloredNotification()) {
|
if (!PreferenceUtil.getInstance(service).coloredNotification()) {
|
||||||
bgColorFinal = Color.WHITE
|
bgColorFinal = ATHUtil.resolveColor(service, R.attr.colorPrimary, Color.WHITE)
|
||||||
}
|
}
|
||||||
setBackgroundColor(bgColorFinal)
|
setBackgroundColor(bgColorFinal)
|
||||||
setNotificationContent(ColorUtil.isColorLight(bgColorFinal))
|
setNotificationContent(ColorUtil.isColorLight(bgColorFinal))
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/smallIcon"
|
android:id="@+id/smallIcon"
|
||||||
android:layout_width="12dp"
|
android:layout_width="14dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="14dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
tools:src="@drawable/ic_audiotrack_black_24dp"
|
tools:src="@drawable/ic_audiotrack_black_24dp"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
@ -57,8 +57,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/arrow"
|
android:id="@+id/arrow"
|
||||||
android:layout_width="12dp"
|
android:layout_width="14dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="14dp"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/ic_keyboard_arrow_down_black_24dp"
|
android:src="@drawable/ic_keyboard_arrow_down_black_24dp"
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:paddingBottom="4dp">
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<string name="action_about">Acerca de Retro Music Player</string>
|
<string name="action_about">Acerca de Retro Music Player</string>
|
||||||
<string name="action_add_to_favorites">Añadir a favoritos</string>
|
<string name="action_add_to_favorites">Añadir a favoritos</string>
|
||||||
<string name="action_add_to_playing_queue">Añadir a la cola de reproducción</string>
|
<string name="action_add_to_playing_queue">Añadir a la cola de reproducción</string>
|
||||||
<string name="action_add_to_playlist">Spanish</string>
|
<string name="action_add_to_playlist">Añadir a la lista de reproducción</string>
|
||||||
<string name="action_clear_playing_queue">Borrar cola de reproducción</string>
|
<string name="action_clear_playing_queue">Borrar cola de reproducción</string>
|
||||||
<string name="action_clear_playlist">Limpiar lista</string>
|
<string name="action_clear_playlist">Limpiar lista</string>
|
||||||
<string name="action_delete">Eliminar</string>
|
<string name="action_delete">Eliminar</string>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<string name="accent_color">Accent color</string>
|
<string name="accent_color">Accent color</string>
|
||||||
<string name="accent_color_desc">The theme accent color, defaults to teal</string>
|
<string name="accent_color_desc">The theme accent color, defaults to teal</string>
|
||||||
|
|
||||||
<string name="action_about">About</string>
|
<string name="action_about">action_add_to_playlist</string>
|
||||||
<string name="action_add_to_favorites">Add to favorites</string>
|
<string name="action_add_to_favorites">Add to favorites</string>
|
||||||
<string name="action_add_to_playing_queue">Add to playing queue</string>
|
<string name="action_add_to_playing_queue">Add to playing queue</string>
|
||||||
<string name="action_add_to_playlist">Add to playlist</string>
|
<string name="action_add_to_playlist">Add to playlist</string>
|
||||||
|
|
Loading…
Reference in a new issue