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

Commit bd8c6fa6 authored by Hasib Prince's avatar Hasib Prince
Browse files

Merge branch '282-multiple_app_source' into 'main'

multiple source handling for Home/category page

See merge request !180
parents 6da4e723 17914931
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -135,8 +135,7 @@ dependencies {
    // Optional -- mockito-kotlin
    testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
    testImplementation 'org.mockito:mockito-inline:2.13.0'


    testImplementation "androidx.arch.core:core-testing:2.1.0"

    // Coil and PhotoView
    implementation "io.coil-kt:coil:1.4.0"
+0 −1
Original line number Diff line number Diff line
@@ -125,7 +125,6 @@ class DownloadManager @Inject constructor(
        } catch (e: Exception) {
            Timber.e(e)
        }

    }

    private fun tickerFlow(downloadId: Long, period: Duration, initialDelay: Duration = Duration.ZERO) = flow {
+296 −195

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -20,5 +20,6 @@ package foundation.e.apps.api.fused.data

data class FusedHome(
    val title: String = String(),
    val list: List<FusedApp> = emptyList()
    val list: List<FusedApp> = emptyList(),
    var source: String = String()
)
+17 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
package foundation.e.apps.home.model

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.LifecycleOwner
import androidx.recyclerview.widget.LinearLayoutManager
@@ -26,6 +27,8 @@ import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import foundation.e.apps.AppInfoFetchViewModel
import foundation.e.apps.MainActivityViewModel
import foundation.e.apps.R
import foundation.e.apps.api.fused.FusedAPIImpl
import foundation.e.apps.api.fused.FusedAPIInterface
import foundation.e.apps.api.fused.data.FusedApp
import foundation.e.apps.api.fused.data.FusedHome
@@ -70,6 +73,20 @@ class HomeParentRVAdapter(
        homeChildRVAdapter.setData(fusedHome.list)

        holder.binding.titleTV.text = fusedHome.title

        when (fusedHome.source) {
            FusedAPIImpl.APP_TYPE_OPEN -> {
                holder.binding.categoryTag.visibility = View.VISIBLE
                holder.binding.categoryTag.text = holder.binding.root.context.getString(R.string.open_source)
            }
            FusedAPIImpl.APP_TYPE_PWA -> {
                holder.binding.categoryTag.visibility = View.VISIBLE
                holder.binding.categoryTag.text = holder.binding.root.context.getString(R.string.pwa)
            }
            else -> {
                holder.binding.categoryTag.visibility = View.GONE
            }
        }
        holder.binding.childRV.apply {
            recycledViewPool.setMaxRecycledViews(0, 0)
            adapter = homeChildRVAdapter
Loading