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

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

source tag added in app detail page

parent 2de8a99e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -850,6 +850,7 @@ class FusedAPIImpl @Inject constructor(
            response?.let {
                it.updateStatus()
                it.updateType()
                it.updateSource()
                it.updateFilterLevel(authData)
            }
        })
@@ -1389,6 +1390,13 @@ class FusedAPIImpl @Inject constructor(
        this.type = if (this.is_pwa) Type.PWA else Type.NATIVE
    }

    private fun FusedApp.updateSource() {
        this.source =
            if (this.origin == Origin.CLEANAPK && this.is_pwa) context.getString(R.string.pwa)
            else if (this.origin == Origin.CLEANAPK) context.getString(R.string.open_source)
            else ""
    }

    private fun MutableList<Artwork>.transformToList(): List<String> {
        val list = mutableListOf<String>()
        this.forEach {
+4 −0
Original line number Diff line number Diff line
@@ -322,6 +322,10 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) {
                appAuthor.text = it
            }
            categoryTitle.text = it.category
            if (it.origin == Origin.CLEANAPK) {
                sourceTagCardView.visibility = View.VISIBLE
                sourceTag.text = it.source
            }
            if (origin == Origin.CLEANAPK) {
                appIcon.load(CleanAPKInterface.ASSET_URL + it.icon_image_path)
            } else {
+46 −15
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
@@ -72,6 +72,37 @@
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end"
        android:layout_marginBottom="1dp"
        android:background="@color/colorBackground"
        android:backgroundTint="@color/colorBackground">

        <androidx.cardview.widget.CardView
            android:id="@+id/sourceTagCardView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end"
            android:layout_marginEnd="15dp"
            android:layout_marginBottom="1dp"
            android:background="@color/colorBackground"
            android:backgroundTint="@color/colorBackground"
            android:elevation="2dp"
            android:visibility="gone"
            app:cardCornerRadius="5dp">

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/sourceTag"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="4dp"
                android:textColor="@color/colorAccent"
                android:textSize="16sp"
                tools:text="PWA" />
        </androidx.cardview.widget.CardView>

        <androidx.cardview.widget.CardView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
@@ -81,19 +112,19 @@
            android:background="@color/colorBackground"
            android:backgroundTint="@color/colorBackground"
            android:elevation="2dp"
        app:cardCornerRadius="5dp"
        >
            app:cardCornerRadius="5dp">

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/categoryTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="4dp"
                android:textColor="@color/colorAccent"
                android:textSize="16sp"
            android:layout_margin="4dp"
                tools:text="Racing" />
        </androidx.cardview.widget.CardView>

    </LinearLayout>


</LinearLayout>
 No newline at end of file