mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +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),
|
||||
contentAlignment = if (list.isNullOrEmpty()) Alignment.Center else Alignment.TopStart
|
||||
) {
|
||||
if (!list.isNullOrEmpty()) {
|
||||
LazyColumn(verticalArrangement = spacedBy(4.dp)) {
|
||||
items(items = list, key = itemKey, itemContent = itemContent)
|
||||
when {
|
||||
list == null -> Text(
|
||||
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(
|
||||
text = stringResource(id = R.string.no_applications_available),
|
||||
color = MaterialTheme.colorScheme.onBackground
|
||||
)
|
||||
else -> Text(
|
||||
text = stringResource(id = R.string.no_applications_available),
|
||||
color = MaterialTheme.colorScheme.onBackground
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -204,4 +204,5 @@
|
||||
<string name="favorite_remove">Remove from favorites</string>
|
||||
<string name="favorite_add">Add to favorites</string>
|
||||
<string name="open">Open</string>
|
||||
<string name="loading_list">Loading list…</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user