mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: Replace item with toItem to include installed info
This commit is contained in:
parent
865664cad2
commit
f49e3cdeab
@ -47,18 +47,18 @@ open class Product {
|
||||
val versionCode: Long
|
||||
get() = selectedReleases.firstOrNull()?.versionCode ?: 0L
|
||||
|
||||
val item: ProductItem
|
||||
get() = ProductItem(
|
||||
repository_id,
|
||||
package_name,
|
||||
fun toItem(installed: Installed? = null): ProductItem =
|
||||
ProductItem(
|
||||
repositoryId,
|
||||
packageName,
|
||||
name,
|
||||
summary,
|
||||
icon,
|
||||
metadataIcon,
|
||||
version,
|
||||
"",
|
||||
compatible != 0,
|
||||
false,
|
||||
compatible,
|
||||
canUpdate(installed),
|
||||
0
|
||||
)
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ class SyncService : ConnectionService<SyncService.Binder>() {
|
||||
searchQuery = "",
|
||||
section = Section.All,
|
||||
order = Order.NAME
|
||||
).map { it.item }
|
||||
).map { it.toItem() }
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
@ -35,7 +35,7 @@ fun ProductsVerticalRecycler(
|
||||
onInstallClick: (ProductItem) -> Unit = {}
|
||||
) {
|
||||
VerticalItemList(list = productsList) {
|
||||
it.item.let { item ->
|
||||
it.toItem().let { item ->
|
||||
ProductsListItem(
|
||||
item,
|
||||
repositories[item.repositoryId],
|
||||
@ -58,7 +58,7 @@ fun ProductsHorizontalRecycler(
|
||||
horizontalArrangement = spacedBy(2.dp)
|
||||
) {
|
||||
items(productsList ?: emptyList()) { product ->
|
||||
product.item.let { item ->
|
||||
product.toItem().let { item ->
|
||||
ProductCard(item, repositories[item.repositoryId], onUserClick)
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ class InstalledFragment : MainNavFragmentX() {
|
||||
}
|
||||
binding.buttonUpdateAll.setOnClickListener {
|
||||
viewModel.secondaryProducts.value?.let {
|
||||
mainActivityX.syncConnection.binder?.updateApps(it.map(Product::item))
|
||||
mainActivityX.syncConnection.binder?.updateApps(it.map(Product::toItem))
|
||||
}
|
||||
}
|
||||
mainActivityX.menuSetup.observe(viewLifecycleOwner) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user