HapeLee 3 months ago
parent
commit
2e1afff1e3
1 changed files with 30 additions and 37 deletions
  1. 30 37
      app/src/main/java/io/legado/app/ui/book/info/BookInfoScreen.kt

+ 30 - 37
app/src/main/java/io/legado/app/ui/book/info/BookInfoScreen.kt

@@ -620,15 +620,6 @@ private fun BookInfoBackdrop(
     usesDefaultCover: Boolean,
     onNetworkCoverLoadError: (String?) -> Unit,
 ) {
-    if (!style.showCover) {
-        Box(
-            modifier = Modifier
-                .fillMaxSize()
-                .clearAndSetSemantics { }
-                .background(LegadoTheme.colorScheme.surface)
-        )
-        return
-    }
     val backdropState = remember(
         book.name,
         book.author,
@@ -653,34 +644,36 @@ private fun BookInfoBackdrop(
             .fillMaxSize()
             .clearAndSetSemantics { }
     ) {
-        Crossfade(
-            targetState = backdropState,
-            animationSpec = tween(800),
-            label = "BackdropCrossfade"
-        ) { currentBook ->
-            BookCoverImage(
-                name = currentBook.name,
-                author = currentBook.author,
-                path = currentBook.coverPath,
-                sourceOrigin = currentBook.sourceOrigin,
-                memoryCacheKey = currentBook.coverPath?.let { "$it#book-info-backdrop" },
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .height(480.dp)
-                    .then(
-                        if (style.blurCover) {
-                            Modifier.blur(24.dp)
-                        } else {
-                            Modifier
-                        }
-                    ),
-                contentScale = ContentScale.Crop,
-                showLoadingPlaceholder = false,
-                onError = { onNetworkCoverLoadError(currentBook.coverPath) },
-                requestBuilder = {
-                    size(Size(384, 384))
-                }
-            )
+        if (style.showCover) {
+            Crossfade(
+                targetState = backdropState,
+                animationSpec = tween(800),
+                label = "BackdropCrossfade"
+            ) { currentBook ->
+                BookCoverImage(
+                    name = currentBook.name,
+                    author = currentBook.author,
+                    path = currentBook.coverPath,
+                    sourceOrigin = currentBook.sourceOrigin,
+                    memoryCacheKey = currentBook.coverPath?.let { "$it#book-info-backdrop" },
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .height(480.dp)
+                        .then(
+                            if (style.blurCover) {
+                                Modifier.blur(24.dp)
+                            } else {
+                                Modifier
+                            }
+                        ),
+                    contentScale = ContentScale.Crop,
+                    showLoadingPlaceholder = false,
+                    onError = { onNetworkCoverLoadError(currentBook.coverPath) },
+                    requestBuilder = {
+                        size(Size(384, 384))
+                    }
+                )
+            }
         }
         if (style.blurCover) {
             Box(