浏览代码

Tweak library continue reading button

arkon 2 年之前
父节点
当前提交
c76d5dd30c
共有 1 个文件被更改,包括 21 次插入21 次删除
  1. 21 21
      app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt

+ 21 - 21
app/src/main/java/eu/kanade/presentation/components/CommonMangaItem.kt

@@ -48,7 +48,7 @@ object CommonMangaItemDefaults {
     const val BrowseFavoriteCoverAlpha = 0.34f
 }
 
-private val ContinueReadingButtonSize = 38.dp
+private val ContinueReadingButtonSize = 32.dp
 private const val GridSelectedCoverAlpha = 0.76f
 
 /**
@@ -119,10 +119,10 @@ private fun BoxScope.CoverTextOverlay(
             .fillMaxWidth()
             .align(Alignment.BottomCenter),
     )
-    val endPadding = if (showContinueReadingButton) ContinueReadingButtonSize else 8.dp
+    val endPadding = if (showContinueReadingButton) ContinueReadingButtonSize else 0.dp
     GridItemTitle(
         modifier = Modifier
-            .padding(start = 8.dp, top = 8.dp, end = endPadding, bottom = 8.dp)
+            .padding(start = 8.dp, top = 8.dp, end = endPadding + 8.dp, bottom = 8.dp)
             .align(Alignment.BottomStart),
         title = title,
         style = MaterialTheme.typography.titleSmall.copy(
@@ -355,25 +355,25 @@ fun MangaListItem(
 private fun BoxScope.ContinueReadingButton(
     onClickContinueReading: () -> Unit,
 ) {
-    FilledIconButton(
-        onClick = {
-            onClickContinueReading()
-        },
+    Box(
         modifier = Modifier
-            .size(ContinueReadingButtonSize)
-            .padding(3.dp)
-            .align(Alignment.BottomEnd),
-        shape = MaterialTheme.shapes.small,
-        colors = IconButtonDefaults.filledIconButtonColors(
-            containerColor = MaterialTheme.colorScheme.primaryContainer,
-            contentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer),
-        ),
+            .align(Alignment.BottomEnd)
+            .padding(horizontal = 4.dp, vertical = 8.dp),
     ) {
-        Icon(
-            imageVector = Icons.Filled.PlayArrow,
-            contentDescription = "",
-            modifier = Modifier
-                .size(15.dp),
-        )
+        FilledIconButton(
+            onClick = onClickContinueReading,
+            modifier = Modifier.size(ContinueReadingButtonSize),
+            shape = MaterialTheme.shapes.small,
+            colors = IconButtonDefaults.filledIconButtonColors(
+                containerColor = MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.9f),
+                contentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer),
+            ),
+        ) {
+            Icon(
+                imageVector = Icons.Filled.PlayArrow,
+                contentDescription = "",
+                modifier = Modifier.size(16.dp),
+            )
+        }
     }
 }