Tweak library continue reading button

This commit is contained in:
arkon 2022-11-10 22:07:21 -05:00
parent 340357d158
commit c76d5dd30c

View File

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