Browse Source

feature# 调整按钮顺序:上一章,播放,停止,下一章,定时

tick 2 years ago
parent
commit
f4e07a777c
1 changed files with 6 additions and 6 deletions
  1. 6 6
      app/src/main/java/io/legado/app/service/BaseReadAloudService.kt

+ 6 - 6
app/src/main/java/io/legado/app/service/BaseReadAloudService.kt

@@ -487,7 +487,7 @@ abstract class BaseReadAloudService : BaseService(),
 
     private fun choiceMediaStyle(): androidx.media.app.NotificationCompat.MediaStyle {
         val mediaStyle = androidx.media.app.NotificationCompat.MediaStyle()
-            .setShowActionsInCompactView(0, 2, 4);
+            .setShowActionsInCompactView(1, 2, 4);
         if (isVivoDevice) {
             //fix #4090 android 14 can not show play control in lock screen
             mediaStyle.setMediaSession(mediaSessionCompat.sessionToken)
@@ -528,11 +528,6 @@ abstract class BaseReadAloudService : BaseService(),
             .setLights(0, 0, 0)
         builder.setLargeIcon(cover)
         // 按钮定义 :  停止, 上一章, 播放, 下一章, 定时
-        builder.addAction(
-            R.drawable.ic_stop_black_24dp,
-            getString(R.string.stop),
-            aloudServicePendingIntent(IntentAction.stop)
-        )
         builder.addAction(
             R.drawable.ic_skip_previous,
             getString(R.string.previous_chapter),
@@ -551,6 +546,11 @@ abstract class BaseReadAloudService : BaseService(),
                 aloudServicePendingIntent(IntentAction.pause)
             )
         }
+        builder.addAction(
+            R.drawable.ic_stop_black_24dp,
+            getString(R.string.stop),
+            aloudServicePendingIntent(IntentAction.stop)
+        )
         builder.addAction(
             R.drawable.ic_skip_next,
             getString(R.string.next_chapter),