Skip to content

Commit

Permalink
fix icon size of status bar lyric
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Oct 26, 2024
1 parent 275a586 commit b08f9a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private class InnerMeiZuLyricsMediaNotificationProvider(context: Context)
}

@OptIn(UnstableApi::class)
class MeiZuLyricsMediaNotificationProvider(private val context: MediaSessionService,
class MeiZuLyricsMediaNotificationProvider(context: MediaSessionService,
private val tickerProvider: () -> CharSequence?)
: MediaNotification.Provider {
private val inner = InnerMeiZuLyricsMediaNotificationProvider(context).apply {
Expand Down Expand Up @@ -72,7 +72,8 @@ class MeiZuLyricsMediaNotificationProvider(private val context: MediaSessionServ

private fun MediaNotification.applyNotificationFlags(onlyUpdateTicker: Boolean) {
notification.apply {
extras.putInt("ticker_icon", R.drawable.ic_gramophone_monochrome)
extras.putInt("ticker_icon", R.drawable.ic_gramophone_mono16)
// set to true if icon changed and SysUI has to dispose of cached one
extras.putBoolean("ticker_icon_switch", false)
// Keep the status bar lyrics scrolling
flags = flags.or(FLAG_ALWAYS_SHOW_TICKER)
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_gramophone_mono16.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="209"
android:viewportHeight="179">
<group android:scaleY="0.8564583333" android:translateY="12.8469791667">
<path
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"
android:fillColor="#363644"/>
<path
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"
android:fillColor="#363644"/>
</group>
</vector>

0 comments on commit b08f9a1

Please sign in to comment.