mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Add placeholder color for Compose manga covers
This commit is contained in:
@@ -5,7 +5,9 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.graphics.painter.ColorPainter
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.unit.dp
|
||||
import coil.compose.AsyncImage
|
||||
@@ -25,6 +27,7 @@ fun MangaCover(
|
||||
) {
|
||||
AsyncImage(
|
||||
model = data,
|
||||
placeholder = ColorPainter(CoverPlaceholderColor),
|
||||
contentDescription = contentDescription,
|
||||
modifier = modifier
|
||||
.aspectRatio(aspect.ratio)
|
||||
@@ -32,3 +35,5 @@ fun MangaCover(
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
|
||||
private val CoverPlaceholderColor = Color(0x1F888888)
|
||||
|
||||
@@ -76,7 +76,7 @@ fun HistoryScreen(
|
||||
onClickResume: (HistoryWithRelations) -> Unit,
|
||||
onClickDelete: (HistoryWithRelations, Boolean) -> Unit,
|
||||
) {
|
||||
val nestedSrollInterop = rememberNestedScrollInteropConnection(composeView)
|
||||
val nestedScrollInterop = rememberNestedScrollInteropConnection(composeView)
|
||||
TachiyomiTheme {
|
||||
val state by presenter.state.collectAsState()
|
||||
val history = state.list?.collectAsLazyPagingItems()
|
||||
@@ -91,7 +91,7 @@ fun HistoryScreen(
|
||||
}
|
||||
else -> {
|
||||
HistoryContent(
|
||||
nestedScroll = nestedSrollInterop,
|
||||
nestedScroll = nestedScrollInterop,
|
||||
history = history,
|
||||
onClickItem = onClickItem,
|
||||
onClickResume = onClickResume,
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.google.android.material.composethemeadapter3.createMdc3Theme
|
||||
@Composable
|
||||
fun TachiyomiTheme(content: @Composable () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
var (colorScheme, typography) = createMdc3Theme(
|
||||
val (colorScheme, typography) = createMdc3Theme(
|
||||
context = context
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user