媒体通道通知栏图标过大 #129

This commit is contained in:
HapeLee
2025-10-24 00:30:08 +08:00
parent 3074f5a2cc
commit a1cfbbe8de
2 changed files with 31 additions and 31 deletions
@@ -443,23 +443,23 @@ class AudioPlayService : BaseService(),
* 更新媒体状态 * 更新媒体状态
*/ */
private fun upMediaSessionPlaybackState(state: Int) { private fun upMediaSessionPlaybackState(state: Int) {
mediaSessionCompat?.setPlaybackState( // mediaSessionCompat?.setPlaybackState(
PlaybackStateCompat.Builder() // PlaybackStateCompat.Builder()
.setActions(MEDIA_SESSION_ACTIONS) // .setActions(MEDIA_SESSION_ACTIONS)
.setState(state, exoPlayer.currentPosition, 1f) // .setState(state, exoPlayer.currentPosition, 1f)
.setBufferedPosition(exoPlayer.bufferedPosition) // .setBufferedPosition(exoPlayer.bufferedPosition)
.addCustomAction( // .addCustomAction(
APP_ACTION_STOP, // APP_ACTION_STOP,
getString(R.string.stop), // getString(R.string.stop),
R.drawable.ic_stop_black_24dp // R.drawable.ic_stop_black_24dp
) // )
.addCustomAction( // .addCustomAction(
APP_ACTION_TIMER, // APP_ACTION_TIMER,
getString(R.string.set_timer), // getString(R.string.set_timer),
R.drawable.ic_time_add_24dp // R.drawable.ic_time_add_24dp
) // )
.build() // .build()
) // )
} }
/** /**
@@ -442,20 +442,20 @@ abstract class BaseReadAloudService : BaseService(),
* 更新媒体状态 * 更新媒体状态
*/ */
private fun upMediaSessionPlaybackState(state: Int) { private fun upMediaSessionPlaybackState(state: Int) {
mediaSessionCompat.setPlaybackState( // mediaSessionCompat.setPlaybackState(
PlaybackStateCompat.Builder() // PlaybackStateCompat.Builder()
.setActions(MediaHelp.MEDIA_SESSION_ACTIONS) // .setActions(MediaHelp.MEDIA_SESSION_ACTIONS)
.setState(state, nowSpeak.toLong(), 1f) // .setState(state, nowSpeak.toLong(), 1f)
// 为系统媒体控件添加定时按钮 // // 为系统媒体控件添加定时按钮
.addCustomAction( // .addCustomAction(
PlaybackStateCompat.CustomAction.Builder( // PlaybackStateCompat.CustomAction.Builder(
"ACTION_ADD_TIMER", // "ACTION_ADD_TIMER",
getString(R.string.set_timer), // getString(R.string.set_timer),
R.drawable.ic_time_add_24dp // R.drawable.ic_time_add_24dp
).build() // ).build()
) // )
.build() // .build()
) // )
} }
/** /**