Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67ab650b authored by Hasib Prince's avatar Hasib Prince
Browse files

App Lounge: fixed category icon for different language

parent 537921e2
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+10 −2
Original line number Diff line number Diff line
@@ -232,7 +232,10 @@ class FusedAPIImpl @Inject constructor(
        return gPlayAPIRepository.listAppCategoryUrls(browseUrl, authData)
    }

    suspend fun getAppsAndNextClusterUrl(browseUrl: String, authData: AuthData): Pair<List<FusedApp>, String> {
    suspend fun getAppsAndNextClusterUrl(
        browseUrl: String,
        authData: AuthData
    ): Pair<List<FusedApp>, 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,
+2 −2
Original line number Diff line number Diff line
@@ -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
+4 −5
Original line number Diff line number Diff line
@@ -38,5 +38,4 @@ sealed class AppTag(val displayTag: String) {
        return if (this is OpenSource) "Open Source"
        else this::class.java.simpleName
    }

}