mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Add: Basic apps' Compose items recyclers
This commit is contained in:
parent
058d34dfed
commit
a4105940a1
@ -0,0 +1,40 @@
|
|||||||
|
package com.looker.droidify.ui.compose
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.compose.foundation.layout.Arrangement.Absolute.spacedBy
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.LazyRow
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.looker.droidify.database.Product
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ProductsVerticalRecycler(productsList: List<Product>) {
|
||||||
|
LazyColumn(
|
||||||
|
verticalArrangement = spacedBy(2.dp)
|
||||||
|
) {
|
||||||
|
items(productsList) { product: Product ->
|
||||||
|
product.data_item?.let { item ->
|
||||||
|
ProductRow(item.name, item.version, item.summary, onUserClick = {
|
||||||
|
Log.d(this.toString(), "You clicked $it")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ProductsHorizontalRecycler(productsList: List<Product>) {
|
||||||
|
LazyRow(
|
||||||
|
horizontalArrangement = spacedBy(2.dp)
|
||||||
|
) {
|
||||||
|
items(productsList) { product: Product ->
|
||||||
|
product.data_item?.let { item ->
|
||||||
|
ProductColumn(item.name, item.version, onUserClick = {
|
||||||
|
Log.d(this.toString(), "You clicked $it")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user