mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: Allow modifying vertical lists
This commit is contained in:
parent
466af7faa5
commit
c2b2eb44d5
@ -30,11 +30,12 @@ import com.looker.droidify.ui.compose.components.RepositoryItem
|
|||||||
fun ProductsVerticalRecycler(
|
fun ProductsVerticalRecycler(
|
||||||
productsList: List<Product>?,
|
productsList: List<Product>?,
|
||||||
repositories: Map<Long, Repository>,
|
repositories: Map<Long, Repository>,
|
||||||
|
modifier: Modifier = Modifier.fillMaxSize(),
|
||||||
onUserClick: (ProductItem) -> Unit = {},
|
onUserClick: (ProductItem) -> Unit = {},
|
||||||
onFavouriteClick: (ProductItem) -> Unit = {},
|
onFavouriteClick: (ProductItem) -> Unit = {},
|
||||||
onInstallClick: (ProductItem) -> Unit = {}
|
onInstallClick: (ProductItem) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
VerticalItemList(list = productsList) {
|
VerticalItemList(list = productsList, modifier = modifier) {
|
||||||
it.toItem().let { item ->
|
it.toItem().let { item ->
|
||||||
ProductsListItem(
|
ProductsListItem(
|
||||||
item,
|
item,
|
||||||
@ -84,7 +85,7 @@ fun RepositoriesRecycler(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun <T> VerticalItemList(
|
fun <T> VerticalItemList(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier.fillMaxSize(),
|
||||||
backgroundColor: Color = MaterialTheme.colorScheme.background,
|
backgroundColor: Color = MaterialTheme.colorScheme.background,
|
||||||
list: List<T>?,
|
list: List<T>?,
|
||||||
itemKey: ((T) -> Any)? = null,
|
itemKey: ((T) -> Any)? = null,
|
||||||
@ -92,7 +93,6 @@ fun <T> VerticalItemList(
|
|||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxSize()
|
|
||||||
.background(backgroundColor),
|
.background(backgroundColor),
|
||||||
contentAlignment = if (list.isNullOrEmpty()) Alignment.Center else Alignment.TopStart
|
contentAlignment = if (list.isNullOrEmpty()) Alignment.Center else Alignment.TopStart
|
||||||
) {
|
) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user