Update local source icon and differentiate from fallback source icon
Closes #8934
@ -31,6 +31,7 @@ import eu.kanade.domain.source.model.Source
|
||||
import eu.kanade.presentation.util.rememberResourceBitmapPainter
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.extension.model.Extension
|
||||
import eu.kanade.tachiyomi.source.LocalSource
|
||||
import eu.kanade.tachiyomi.util.lang.withIOContext
|
||||
|
||||
private val defaultModifier = Modifier
|
||||
@ -60,13 +61,20 @@ fun SourceIcon(
|
||||
modifier = modifier.then(defaultModifier),
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
source.id == LocalSource.ID -> {
|
||||
Image(
|
||||
painter = painterResource(R.mipmap.ic_local_source),
|
||||
contentDescription = null,
|
||||
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 -> {
|
||||
val icon by extension.getIcon(density)
|
||||
when (icon) {
|
||||
Result.Error -> Image(
|
||||
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_local_source),
|
||||
contentDescription = null,
|
||||
modifier = modifier,
|
||||
)
|
||||
Result.Loading -> Box(modifier = modifier)
|
||||
is Result.Success -> Image(
|
||||
bitmap = (icon as Result.Success<ImageBitmap>).value,
|
||||
contentDescription = null,
|
||||
modifier = modifier,
|
||||
)
|
||||
Result.Error -> Image(
|
||||
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
|
||||
contentDescription = null,
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
}
|
||||
is Extension.Untrusted -> Image(
|
||||
|
BIN
app/src/main/res/mipmap-hdpi/ic_default_source.webp
Normal file
After Width: | Height: | Size: 882 B |
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_default_source.webp
Normal file
After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 610 B |
BIN
app/src/main/res/mipmap-xhdpi/ic_default_source.webp
Normal file
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_default_source.webp
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_default_source.webp
Normal file
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.5 KiB |