diff --git a/src/main/kotlin/com/looker/droidify/database/DatabaseX.kt b/src/main/kotlin/com/looker/droidify/database/DatabaseX.kt index f139becb..2bf22262 100644 --- a/src/main/kotlin/com/looker/droidify/database/DatabaseX.kt +++ b/src/main/kotlin/com/looker/droidify/database/DatabaseX.kt @@ -21,7 +21,7 @@ import kotlinx.coroutines.launch CategoryTemp::class, Installed::class, Lock::class - ], version = 5 + ], version = 6 ) @TypeConverters(Converters::class) abstract class DatabaseX : RoomDatabase() { diff --git a/src/main/kotlin/com/looker/droidify/database/entity/Product.kt b/src/main/kotlin/com/looker/droidify/database/entity/Product.kt index 4830f8ac..9e353670 100644 --- a/src/main/kotlin/com/looker/droidify/database/entity/Product.kt +++ b/src/main/kotlin/com/looker/droidify/database/entity/Product.kt @@ -18,7 +18,7 @@ open class Product( var repositoryId: Long, var packageName: String ) { - var name: String = "" + var label: String = "" var summary: String = "" var description: String = "" var added: Long = 0L @@ -45,7 +45,7 @@ open class Product( constructor( repositoryId: Long, packageName: String, - name: String, + label: String, summary: String, description: String, added: Long, @@ -66,7 +66,7 @@ open class Product( changelog: String = "", whatsNew: String = "" ) : this(repositoryId, packageName) { - this.name = name + this.label = label this.summary = summary this.description = description this.added = added @@ -104,7 +104,7 @@ open class Product( ProductItem( repositoryId, packageName, - name, + label, summary, icon, metadataIcon, @@ -135,7 +135,7 @@ open class Product( class ProductTemp( repositoryId: Long, packageName: String, - name: String, + label: String, summary: String, description: String, added: Long, @@ -158,7 +158,7 @@ class ProductTemp( ) : Product( repositoryId = repositoryId, packageName = packageName, - name = name, + label = label, summary = summary, description = description, added = added, @@ -183,7 +183,7 @@ class ProductTemp( fun Product.asProductTemp(): ProductTemp = ProductTemp( repositoryId = repositoryId, packageName = packageName, - name = name, + label = label, summary = summary, description = description, added = added, diff --git a/src/main/kotlin/com/looker/droidify/index/IndexHandler.kt b/src/main/kotlin/com/looker/droidify/index/IndexHandler.kt index d14c7cd2..f92c48f7 100644 --- a/src/main/kotlin/com/looker/droidify/index/IndexHandler.kt +++ b/src/main/kotlin/com/looker/droidify/index/IndexHandler.kt @@ -92,7 +92,7 @@ class IndexHandler(private val repositoryId: Long, private val callback: Callbac fun build(): Product = Product( repositoryId = repositoryId, packageName = packageName, - name = name, + label = name, summary = summary, description = description, added = added, diff --git a/src/main/kotlin/com/looker/droidify/index/IndexV1Parser.kt b/src/main/kotlin/com/looker/droidify/index/IndexV1Parser.kt index 838439d1..feec018a 100644 --- a/src/main/kotlin/com/looker/droidify/index/IndexV1Parser.kt +++ b/src/main/kotlin/com/looker/droidify/index/IndexV1Parser.kt @@ -219,7 +219,7 @@ object IndexV1Parser { return Product( repositoryId = repositoryId, packageName = packageName, - name = name, + label = name, summary = summary, description = description, added = added, diff --git a/src/main/kotlin/com/looker/droidify/ui/adapters/AppDetailAdapter.kt b/src/main/kotlin/com/looker/droidify/ui/adapters/AppDetailAdapter.kt index c70549b5..ce057836 100644 --- a/src/main/kotlin/com/looker/droidify/ui/adapters/AppDetailAdapter.kt +++ b/src/main/kotlin/com/looker/droidify/ui/adapters/AppDetailAdapter.kt @@ -148,7 +148,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) : val product: Product ) : Item() { override val descriptor: String - get() = "app_info.${product.name}" + get() = "app_info.${product.label}" override val viewType: ViewType get() = ViewType.APP_INFO @@ -645,7 +645,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) : } val description = formatHtml(productRepository.first.description).apply { - if (productRepository.first.let { it.summary.isNotEmpty() && it.name != it.summary }) { + if (productRepository.first.let { it.summary.isNotEmpty() && it.label != it.summary }) { if (isNotEmpty()) { insert(0, "\n\n") } @@ -1111,7 +1111,7 @@ class AppDetailAdapter(private val callbacks: Callbacks) : placeholder(holder.defaultIcon) error(holder.defaultIcon) } - holder.name.text = item.product.name + holder.name.text = item.product.label holder.packageName.apply { text = item.product.packageName } diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/AppDetailFragment.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/AppDetailFragment.kt index cfc9b885..22e5e2ff 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/AppDetailFragment.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/AppDetailFragment.kt @@ -348,7 +348,7 @@ class AppDetailFragment() : ScreenFragment(), AppDetailAdapter.Callbacks { ?.let { (it.layoutManager as LinearLayoutManager).findFirstVisibleItemPosition() != 0 } == true launch { collapsingToolbar.title = - if (showPackageName) products[0].first.name.trimAfter(' ', 2) + if (showPackageName) products[0].first.label.trimAfter(' ', 2) else getString(R.string.application) } } @@ -465,7 +465,7 @@ class AppDetailFragment() : ScreenFragment(), AppDetailAdapter.Callbacks { } else Unit } AppDetailAdapter.Action.SHARE -> { - shareIntent(packageName, products[0].first.name) + shareIntent(packageName, products[0].first.label) } }::class } @@ -552,7 +552,7 @@ class AppDetailFragment() : ScreenFragment(), AppDetailAdapter.Callbacks { .firstOrNull() if (productRepository != null) { downloadConnection.binder?.enqueue( - packageName, productRepository.first.name, + packageName, productRepository.first.label, productRepository.second, release ) } diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt index 178d9a9f..a6164d4e 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt @@ -345,7 +345,7 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), AppDetailAdapter.Call } else Unit } AppDetailAdapter.Action.SHARE -> { - shareIntent(packageName, productRepos[0].first.name) + shareIntent(packageName, productRepos[0].first.label) } }::class } @@ -433,7 +433,7 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), AppDetailAdapter.Call .firstOrNull() if (productRepository != null) { downloadConnection.binder?.enqueue( - packageName, productRepository.first.name, + packageName, productRepository.first.label, productRepository.second, release ) } diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/InstalledFragment.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/InstalledFragment.kt index 5f62b793..f48366bf 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/InstalledFragment.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/InstalledFragment.kt @@ -56,7 +56,7 @@ class InstalledFragment : MainNavFragmentX() { } ) { Scaffold { _ -> - ProductsVerticalRecycler(it.sortedBy(Product::name), repositories, + ProductsVerticalRecycler(it.sortedBy(Product::label), repositories, onUserClick = { item -> AppSheetX(item.packageName) .showNow(parentFragmentManager, "Product ${item.packageName}") diff --git a/src/main/kotlin/com/looker/droidify/utility/Utils.kt b/src/main/kotlin/com/looker/droidify/utility/Utils.kt index 40f17117..03107957 100644 --- a/src/main/kotlin/com/looker/droidify/utility/Utils.kt +++ b/src/main/kotlin/com/looker/droidify/utility/Utils.kt @@ -102,7 +102,7 @@ object Utils { if (productRepository != null && it != null && binder != null) { binder.enqueue( packageName, - productRepository.first.name, + productRepository.first.label, productRepository.second, it )