Update local source icon and differentiate from fallback source icon

Closes #8934
This commit is contained in:
arkon 2023-01-16 22:54:45 -05:00
parent 1a4dad72a9
commit 2695a4d8c7
11 changed files with 14 additions and 6 deletions

View File

@ -31,6 +31,7 @@ import eu.kanade.domain.source.model.Source
import eu.kanade.presentation.util.rememberResourceBitmapPainter import eu.kanade.presentation.util.rememberResourceBitmapPainter
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.lang.withIOContext
private val defaultModifier = Modifier private val defaultModifier = Modifier
@ -60,13 +61,20 @@ fun SourceIcon(
modifier = modifier.then(defaultModifier), modifier = modifier.then(defaultModifier),
) )
} }
else -> { source.id == LocalSource.ID -> {
Image( Image(
painter = painterResource(R.mipmap.ic_local_source), painter = painterResource(R.mipmap.ic_local_source),
contentDescription = null, contentDescription = null,
modifier = modifier.then(defaultModifier), modifier = modifier.then(defaultModifier),
) )
} }
else -> {
Image(
painter = painterResource(R.mipmap.ic_default_source),
contentDescription = null,
modifier = modifier.then(defaultModifier),
)
}
} }
} }
@ -90,17 +98,17 @@ fun ExtensionIcon(
is Extension.Installed -> { is Extension.Installed -> {
val icon by extension.getIcon(density) val icon by extension.getIcon(density)
when (icon) { when (icon) {
Result.Error -> Image(
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_local_source),
contentDescription = null,
modifier = modifier,
)
Result.Loading -> Box(modifier = modifier) Result.Loading -> Box(modifier = modifier)
is Result.Success -> Image( is Result.Success -> Image(
bitmap = (icon as Result.Success<ImageBitmap>).value, bitmap = (icon as Result.Success<ImageBitmap>).value,
contentDescription = null, contentDescription = null,
modifier = modifier, modifier = modifier,
) )
Result.Error -> Image(
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
contentDescription = null,
modifier = modifier,
)
} }
} }
is Extension.Untrusted -> Image( is Extension.Untrusted -> Image(

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB