Procházet zdrojové kódy

feat: 听书相关

HapeLee před 3 měsíci
rodič
revize
669ec3c772

+ 9 - 0
app/src/main/java/io/legado/app/ui/book/readaloud/player/ReadAloudPlayerScreen.kt

@@ -333,6 +333,15 @@ fun ReadAloudPlayerScreenContent(
                         SmallPlainButton(
                         SmallPlainButton(
                             onClick = {
                             onClick = {
                                 coroutineScope.launch {
                                 coroutineScope.launch {
+                                    if (horizontalPagerState.currentPage != 0) {
+                                        horizontalPagerState.animateScrollToPage(
+                                            page = 0,
+                                            animationSpec = tween(
+                                                durationMillis = 520,
+                                                easing = FastOutSlowInEasing,
+                                            ),
+                                        )
+                                    }
                                     verticalPagerState.animateScrollToPage(
                                     verticalPagerState.animateScrollToPage(
                                         page = if (verticalPagerState.currentPage == 0) 1 else 0,
                                         page = if (verticalPagerState.currentPage == 0) 1 else 0,
                                         animationSpec = tween(
                                         animationSpec = tween(

+ 1 - 1
app/src/main/java/io/legado/app/ui/book/readaloud/player/ReadAloudPlayerViewModel.kt

@@ -64,7 +64,7 @@ class ReadAloudPlayerViewModel(
             ReadAloudBgMode.Solid -> ReadAloudBgMode.Blur
             ReadAloudBgMode.Solid -> ReadAloudBgMode.Blur
             ReadAloudBgMode.Blur -> ReadAloudBgMode.FlowingLight
             ReadAloudBgMode.Blur -> ReadAloudBgMode.FlowingLight
             ReadAloudBgMode.FlowingLight -> ReadAloudBgMode.Transparent
             ReadAloudBgMode.FlowingLight -> ReadAloudBgMode.Transparent
-            else -> ReadAloudBgMode.Blur
+            else -> ReadAloudBgMode.Solid
         }
         }
         AppConfigStore.putInt(PreferKey.readAloudPlayerBgMode, next)
         AppConfigStore.putInt(PreferKey.readAloudPlayerBgMode, next)
     }
     }