Add error state to MangaCover composable (#7022)

* Add error state to MangaCover

- Add error drawable when thumbnailUrl isn't able to be loaded
- Tweak usage of MangaCover

* Change `contentDescription` to be nullable

As the invoke function makes default nulls
This commit is contained in:
Andreas
2022-04-27 15:24:35 +02:00
committed by GitHub
parent 259c370eb9
commit adf02e53fd
3 changed files with 46 additions and 24 deletions

View File

@@ -25,7 +25,6 @@ import androidx.paging.compose.items
import eu.kanade.domain.history.model.HistoryWithRelations
import eu.kanade.presentation.components.EmptyScreen
import eu.kanade.presentation.components.MangaCover
import eu.kanade.presentation.components.MangaCoverAspect
import eu.kanade.presentation.util.horizontalPadding
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
@@ -168,12 +167,11 @@ fun HistoryItem(
.padding(horizontal = horizontalPadding, vertical = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
MangaCover(
MangaCover.Book(
modifier = Modifier
.fillMaxHeight()
.clickable(onClick = onClickCover),
data = history.thumbnailUrl,
aspect = MangaCoverAspect.COVER
)
Column(
modifier = Modifier