Skip to content

Commit

Permalink
fix icon for status bar lyric
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Oct 25, 2024
1 parent 3e27720 commit 428aaa0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,25 @@ class MeiZuLyricsMediaNotificationProvider(private val context: MediaSessionServ
mediaSession, customLayout, actionFactory
) {
onNotificationChangedCallback.onNotificationChanged(it.also {
if (ticker != null) {
it.notification.apply {
extras.putInt("ticker_icon", R.drawable.ic_gramophone_monochrome)
extras.putBoolean("ticker_icon_switch", false)
}
}
if (tickerProvider() != null) {
updateTickerLater(mediaSession)
}
})
}.also {
if (ticker != null && isManualNotificationUpdate) {
if (ticker != null) {
it.notification.apply {
extras.putInt("ticker_icon", R.drawable.ic_gramophone_monochrome)
extras.putBoolean("ticker_icon_switch", false)
}
}
if (ticker != null && isManualNotificationUpdate) {
it.notification.apply {
// Keep the status bar lyrics scrolling
flags = flags.or(FLAG_ALWAYS_SHOW_TICKER)
// Only update the ticker (lyrics), and do not update other properties
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/drawable/ic_gramophone_monochrome.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="20.555dp" android:viewportHeight="179" android:viewportWidth="209" android:width="24dp">

<path android:fillColor="#ffffff" android:pathData="M99.2,43.4c-10.5,0 -19,4.8 -19,10.7c0,5.9 8.5,10.7 19,10.7c10.5,0 19,-4.8 19,-10.7C118.2,48.2 109.6,43.4 99.2,43.4z"/>

<path android:fillColor="#ffffff" android:pathData="M205.2,57.1L108.3,1c-2.4,-1.4 -5.3,-1.4 -7.6,0l-96.9,56C1.4,58.4 0,61 0,63.7v51.7c0,2.7 1.5,5.3 3.8,6.6l96.9,56c2.4,1.4 5.3,1.4 7.6,0l96.9,-56c2.4,-1.4 3.8,-3.9 3.8,-6.6V63.7C209,61 207.5,58.4 205.2,57.1L205.2,57.1zM99.2,82.4c-27.6,0 -50,-12.7 -50,-28.2s22.4,-28.2 50,-28.2c27.6,0 50,12.7 50,28.2S126.8,82.4 99.2,82.4zM180.5,65.8l-54.8,32c-0.5,0.3 -1.1,0.5 -1.7,0.5h-15.8c-1.9,0 -3.4,-1.5 -3.4,-3.4c0,-1.9 1.5,-3.4 3.4,-3.4h14.9l49,-28.6l-6,-3.5c-1.6,-0.9 -2.2,-3 -1.2,-4.6c0.9,-1.6 3,-2.2 4.6,-1.2l11.1,6.4c1.1,0.6 1.7,1.7 1.7,2.9S181.6,65.2 180.5,65.8z"/>

</vector>
<inset xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true" android:insetTop="1.7255dp" android:insetBottom="1.7255dp">
<vector android:height="20.555dp" android:viewportHeight="179" android:viewportWidth="209" android:width="24dp">

<path android:fillColor="#ffffff" android:pathData="M99.2,43.4c-10.5,0 -19,4.8 -19,10.7c0,5.9 8.5,10.7 19,10.7c10.5,0 19,-4.8 19,-10.7C118.2,48.2 109.6,43.4 99.2,43.4z"/>

<path android:fillColor="#ffffff" android:pathData="M205.2,57.1L108.3,1c-2.4,-1.4 -5.3,-1.4 -7.6,0l-96.9,56C1.4,58.4 0,61 0,63.7v51.7c0,2.7 1.5,5.3 3.8,6.6l96.9,56c2.4,1.4 5.3,1.4 7.6,0l96.9,-56c2.4,-1.4 3.8,-3.9 3.8,-6.6V63.7C209,61 207.5,58.4 205.2,57.1L205.2,57.1zM99.2,82.4c-27.6,0 -50,-12.7 -50,-28.2s22.4,-28.2 50,-28.2c27.6,0 50,12.7 50,28.2S126.8,82.4 99.2,82.4zM180.5,65.8l-54.8,32c-0.5,0.3 -1.1,0.5 -1.7,0.5h-15.8c-1.9,0 -3.4,-1.5 -3.4,-3.4c0,-1.9 1.5,-3.4 3.4,-3.4h14.9l49,-28.6l-6,-3.5c-1.6,-0.9 -2.2,-3 -1.2,-4.6c0.9,-1.6 3,-2.2 4.6,-1.2l11.1,6.4c1.1,0.6 1.7,1.7 1.7,2.9S181.6,65.2 180.5,65.8z"/>

</vector>
</inset>

0 comments on commit 428aaa0

Please sign in to comment.