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

Commit 51f769be authored by Hasib Prince's avatar Hasib Prince
Browse files

ux improvement

parent 9b2d274f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ class FusedAPIImpl @Inject constructor(
                        CleanAPKInterface.APP_SOURCE_FOSS
                    ).body()
                    response?.home?.let {
                        list.addAll(generateCleanAPKHome(it, applicationType))
                        list.addAll(generateCleanAPKHome(it, APP_TYPE_OPEN))
                    }
                }

@@ -164,7 +164,7 @@ class FusedAPIImpl @Inject constructor(
                        CleanAPKInterface.APP_SOURCE_ANY
                    ).body()
                    response?.home?.let {
                        list.addAll(generateCleanAPKHome(it, applicationType))
                        list.addAll(generateCleanAPKHome(it, APP_TYPE_PWA))
                    }
                }
            }
@@ -1180,7 +1180,10 @@ class FusedAPIImpl @Inject constructor(
                }
            }
        }
        return list
        return list.map {
            it.source = prefType
            it
        }
    }

    private suspend fun fetchGPlayHome(authData: AuthData): List<FusedHome> {
+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
+35 −8
Original line number Diff line number Diff line
@@ -19,8 +19,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="5dp">

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/titleTV"
            android:layout_width="match_parent"
@@ -30,7 +36,28 @@
            android:paddingEnd="10dp"
            android:textColor="?android:textColorPrimary"
            android:textSize="18sp"
        android:textStyle="bold" />
            android:textStyle="bold"
            android:ellipsize="end"
            android:lines="1"
            android:layout_toStartOf="@id/categoryTag"/>

        <TextView
            android:id="@+id/categoryTag"
            android:background="@drawable/bg_tag_rounded"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAllCaps="false"
            android:textColor="#626262"
            android:textSize="15sp"
            android:paddingTop="2dp"
            android:paddingBottom="2dp"
            android:paddingStart="6dp"
            android:paddingEnd="6dp"
            android:layout_alignParentEnd="true"
            android:visibility="gone"
            tools:text="Open Source"/>

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"