Added colored notification on A12 and fixed unreadable colors on light mode on A12
This commit is contained in:
parent
404bc0ff12
commit
d1f2cac5c0
4 changed files with 12 additions and 7 deletions
|
@ -32,7 +32,8 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.activities.MainActivity
|
import code.name.monkey.retromusic.activities.MainActivity
|
||||||
import code.name.monkey.retromusic.extensions.surfaceColor
|
import code.name.monkey.retromusic.extensions.isColorLight
|
||||||
|
import code.name.monkey.retromusic.extensions.isSystemDarkModeEnabled
|
||||||
import code.name.monkey.retromusic.glide.GlideApp
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||||
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
|
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
|
||||||
|
@ -80,6 +81,7 @@ class PlayingNotificationClassic(
|
||||||
setContentIntent(clickIntent)
|
setContentIntent(clickIntent)
|
||||||
setDeleteIntent(deleteIntent)
|
setDeleteIntent(deleteIntent)
|
||||||
setCategory(NotificationCompat.CATEGORY_SERVICE)
|
setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||||
|
setColorized(true)
|
||||||
priority = NotificationCompat.PRIORITY_MAX
|
priority = NotificationCompat.PRIORITY_MAX
|
||||||
setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||||
setCustomContentView(notificationLayout)
|
setCustomContentView(notificationLayout)
|
||||||
|
@ -153,7 +155,12 @@ class PlayingNotificationClassic(
|
||||||
setBackgroundColor(bgColorFinal)
|
setBackgroundColor(bgColorFinal)
|
||||||
setNotificationContent(ColorUtil.isColorLight(bgColorFinal))
|
setNotificationContent(ColorUtil.isColorLight(bgColorFinal))
|
||||||
} else {
|
} else {
|
||||||
setNotificationContent(!ColorUtil.isColorLight(context.surfaceColor()))
|
if (PreferenceUtil.isColoredNotification) {
|
||||||
|
color = bgColor
|
||||||
|
setNotificationContent(color.isColorLight)
|
||||||
|
} else {
|
||||||
|
setNotificationContent(!context.isSystemDarkModeEnabled())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onUpdate()
|
onUpdate()
|
||||||
}
|
}
|
||||||
|
@ -256,7 +263,8 @@ class PlayingNotificationClassic(
|
||||||
R.drawable.ic_pause_white_48dp
|
R.drawable.ic_pause_white_48dp
|
||||||
else
|
else
|
||||||
R.drawable.ic_play_arrow_white_48dp, primaryColor
|
R.drawable.ic_play_arrow_white_48dp, primaryColor
|
||||||
), NOTIFICATION_CONTROLS_SIZE_MULTIPLIER)
|
), NOTIFICATION_CONTROLS_SIZE_MULTIPLIER
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setPlaying(isPlaying: Boolean, onUpdate: () -> Unit) {
|
override fun setPlaying(isPlaying: Boolean, onUpdate: () -> Unit) {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<bool name="md3_available">true</bool>
|
<bool name="md3_available">true</bool>
|
||||||
<bool name="md3_enabled">true</bool>
|
<bool name="md3_enabled">true</bool>
|
||||||
|
|
||||||
<bool name="colored_notification_available">false</bool>
|
|
||||||
<integer name="overScrollMode">0</integer>
|
<integer name="overScrollMode">0</integer>
|
||||||
<bool name="wallpaper_accent_enabled">false</bool>
|
<bool name="wallpaper_accent_enabled">false</bool>
|
||||||
<bool name="wallpaper_accent_visible">false</bool>
|
<bool name="wallpaper_accent_visible">false</bool>
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
<bool name="md3_available">false</bool>
|
<bool name="md3_available">false</bool>
|
||||||
<bool name="md3_enabled">false</bool>
|
<bool name="md3_enabled">false</bool>
|
||||||
|
|
||||||
<bool name="colored_notification_available">true</bool>
|
|
||||||
<integer name="overScrollMode">2</integer>
|
<integer name="overScrollMode">2</integer>
|
||||||
<bool name="allowBackup">true</bool>
|
<bool name="allowBackup">true</bool>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="colored_notification"
|
android:key="colored_notification"
|
||||||
android:layout="@layout/list_item_view_switch"
|
android:layout="@layout/list_item_view_switch"
|
||||||
app:isPreferenceVisible="@bool/colored_notification_available"
|
|
||||||
android:summary="@string/pref_summary_colored_notification"
|
android:summary="@string/pref_summary_colored_notification"
|
||||||
android:title="@string/pref_title_colored_notification" />
|
android:title="@string/pref_title_colored_notification" />
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue