diff --git a/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt b/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt index 21d6f5c59a3e964414f4561c04f5b15a82613ad8..f33fe1e916dbcc6c5605b0ce8d28bfbdc6a7a582 100644 --- a/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt +++ b/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt @@ -24,9 +24,9 @@ import androidx.work.Configuration import dagger.hilt.android.HiltAndroidApp import foundation.e.apps.manager.pkg.PkgManagerBR import foundation.e.apps.manager.pkg.PkgManagerModule +import foundation.e.apps.manager.workmanager.InstallWorkManager import foundation.e.apps.setup.tos.TOS_VERSION import foundation.e.apps.utils.modules.DataStoreModule -import foundation.e.apps.manager.workmanager.InstallWorkManager import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch diff --git a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt index bbdce8fb3bd93207a4d14df98f7a1b2a3eee87e1..377d0be8ac54e3f669ee23da919ba194ec605c69 100644 --- a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt @@ -232,7 +232,10 @@ class FusedAPIImpl @Inject constructor( return gPlayAPIRepository.listAppCategoryUrls(browseUrl, authData) } - suspend fun getAppsAndNextClusterUrl(browseUrl: String, authData: AuthData): Pair, String> { + suspend fun getAppsAndNextClusterUrl( + browseUrl: String, + authData: AuthData + ): Pair, String> { return gPlayAPIRepository.getAppsAndNextClusterUrl(browseUrl, authData).let { Pair(it.first.map { app -> app.transformToFusedApp() }, it.second) } @@ -366,7 +369,10 @@ class FusedAPIImpl @Inject constructor( } private fun getCategoryIconName(category: FusedCategory): String { - var categoryTitle = category.title + var categoryTitle = if (category.tag.getOperationalTag() + .contentEquals(AppTag.GPlay().getOperationalTag()) + ) category.id else category.title + if (categoryTitle.contains(CATEGORY_TITLE_REPLACEABLE_CONJUNCTION)) { categoryTitle = categoryTitle.replace(CATEGORY_TITLE_REPLACEABLE_CONJUNCTION, "and") } @@ -468,7 +474,9 @@ class FusedAPIImpl @Inject constructor( } private fun Category.transformToFusedCategory(): FusedCategory { + val id = this.browseUrl.substringAfter("cat=").substringBefore("&c=") return FusedCategory( + id = id.lowercase(), title = this.title, browseUrl = this.browseUrl, imageUrl = this.imageUrl, diff --git a/app/src/main/java/foundation/e/apps/api/fused/utils/CategoryUtils.kt b/app/src/main/java/foundation/e/apps/api/fused/utils/CategoryUtils.kt index a4647c52b5e421f82495095bbf48952f9e810185..f3dfe82affccb80da532aae3e0114addf8dc552d 100644 --- a/app/src/main/java/foundation/e/apps/api/fused/utils/CategoryUtils.kt +++ b/app/src/main/java/foundation/e/apps/api/fused/utils/CategoryUtils.kt @@ -167,9 +167,9 @@ object CategoryUtils { R.drawable.ic_cat_travel "pwa_business" -> R.drawable.ic_business - "watch_faces" -> + "watch_face" -> R.drawable.ic_watchface - "watch_apps" -> + "android_wear" -> R.drawable.ic_watch_apps else -> R.drawable.ic_cat_default diff --git a/app/src/main/java/foundation/e/apps/utils/enums/AppTag.kt b/app/src/main/java/foundation/e/apps/utils/enums/AppTag.kt index 0f13ea18c25373a03830919e5c8aa5758567b03f..5a5361dd82bc4ec5f38921475c0946e236e3c28a 100644 --- a/app/src/main/java/foundation/e/apps/utils/enums/AppTag.kt +++ b/app/src/main/java/foundation/e/apps/utils/enums/AppTag.kt @@ -26,9 +26,9 @@ package foundation.e.apps.utils.enums * Issue: https://gitlab.e.foundation/e/backlog/-/issues/5364 */ sealed class AppTag(val displayTag: String) { - class OpenSource(displayTag: String): AppTag(displayTag) - class PWA(displayTag: String): AppTag(displayTag) - class GPlay(displayTag: String = ""): AppTag(displayTag) + class OpenSource(displayTag: String) : AppTag(displayTag) + class PWA(displayTag: String) : AppTag(displayTag) + class GPlay(displayTag: String = "") : AppTag(displayTag) /** * In many places in the code, checks are for hard coded string "Open Source". @@ -38,5 +38,4 @@ sealed class AppTag(val displayTag: String) { return if (this is OpenSource) "Open Source" else this::class.java.simpleName } - -} \ No newline at end of file +}