ExtensionScreen: Adjust item visual (#8120)

* ExtensionScreen: Adjust item visual

* Move install status view and add progress indicator
* Add secondary item modifier to info texts
* Wrap info texts with FlowRow in case of unavailable space
* Remove language text in non-installed items

Extra content:
* Change the list key to be more consistent
* General cleanups

* typo
This commit is contained in:
Ivan Iskandar
2022-10-01 21:32:08 +07:00
committed by GitHub
parent 80b2ebc45b
commit 58c47c4c50
4 changed files with 113 additions and 89 deletions

View File

@@ -81,12 +81,11 @@ fun ExtensionIcon(
is Extension.Available -> {
AsyncImage(
model = extension.iconUrl,
contentDescription = "",
contentDescription = null,
placeholder = ColorPainter(Color(0x1F888888)),
error = rememberResourceBitmapPainter(id = R.drawable.cover_error),
modifier = modifier
.clip(RoundedCornerShape(4.dp))
.then(defaultModifier),
.clip(RoundedCornerShape(4.dp)),
)
}
is Extension.Installed -> {
@@ -94,20 +93,20 @@ fun ExtensionIcon(
when (icon) {
Result.Error -> Image(
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_local_source),
contentDescription = "",
modifier = modifier.then(defaultModifier),
contentDescription = null,
modifier = modifier,
)
Result.Loading -> Box(modifier = modifier.then(defaultModifier))
Result.Loading -> Box(modifier = modifier)
is Result.Success -> Image(
bitmap = (icon as Result.Success<ImageBitmap>).value,
contentDescription = "",
modifier = modifier.then(defaultModifier),
contentDescription = null,
modifier = modifier,
)
}
}
is Extension.Untrusted -> Image(
imageVector = Icons.Default.Dangerous,
contentDescription = "",
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.error),
modifier = modifier.then(defaultModifier),
)