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