mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Add: Loading indicator for vertical lists
This commit is contained in:
parent
ce1cfeb79a
commit
c9637fa647
@ -101,13 +101,20 @@ fun <T> VerticalItemList(
|
|||||||
.background(backgroundColor),
|
.background(backgroundColor),
|
||||||
contentAlignment = if (list.isNullOrEmpty()) Alignment.Center else Alignment.TopStart
|
contentAlignment = if (list.isNullOrEmpty()) Alignment.Center else Alignment.TopStart
|
||||||
) {
|
) {
|
||||||
if (!list.isNullOrEmpty()) {
|
when {
|
||||||
LazyColumn(verticalArrangement = spacedBy(4.dp)) {
|
list == null -> Text(
|
||||||
items(items = list, key = itemKey, itemContent = itemContent)
|
text = stringResource(id = R.string.loading_list),
|
||||||
|
color = MaterialTheme.colorScheme.onBackground
|
||||||
|
)
|
||||||
|
!list.isNullOrEmpty() -> {
|
||||||
|
LazyColumn(verticalArrangement = spacedBy(4.dp)) {
|
||||||
|
items(items = list, key = itemKey, itemContent = itemContent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else Text(
|
else -> Text(
|
||||||
text = stringResource(id = R.string.no_applications_available),
|
text = stringResource(id = R.string.no_applications_available),
|
||||||
color = MaterialTheme.colorScheme.onBackground
|
color = MaterialTheme.colorScheme.onBackground
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -204,4 +204,5 @@
|
|||||||
<string name="favorite_remove">Remove from favorites</string>
|
<string name="favorite_remove">Remove from favorites</string>
|
||||||
<string name="favorite_add">Add to favorites</string>
|
<string name="favorite_add">Add to favorites</string>
|
||||||
<string name="open">Open</string>
|
<string name="open">Open</string>
|
||||||
|
<string name="loading_list">Loading list…</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user