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

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

Merge branch '5096-open_source_pwa_label' into 'main'

5096 open source pwa label

See merge request !201
parents 63617ee6 1e557672
Loading
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -851,6 +851,7 @@ class FusedAPIImpl @Inject constructor(
            response?.let {
                it.updateStatus()
                it.updateType()
                it.updateSource()
                it.updateFilterLevel(authData)
            }
        })
@@ -1394,6 +1395,14 @@ class FusedAPIImpl @Inject constructor(
        this.type = if (this.is_pwa) Type.PWA else Type.NATIVE
    }

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

    private fun MutableList<Artwork>.transformToList(): List<String> {
        val list = mutableListOf<String>()
        this.forEach {
+8 −0
Original line number Diff line number Diff line
@@ -181,6 +181,10 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) {
        if (applicationViewModel.appStatus.value == null) {
            applicationViewModel.appStatus.value = it.status
        }

        if (it.other_images_path.isEmpty()) {
            binding.recyclerView.visibility = View.GONE
        }
        screenshotsRVAdapter.setData(it.other_images_path)

        // Title widgets
@@ -322,6 +326,10 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) {
                appAuthor.text = it
            }
            categoryTitle.text = it.category
            if (it.origin == Origin.CLEANAPK) {
                sourceTag.visibility = View.VISIBLE
                sourceTag.text = it.source
            }
            if (origin == Origin.CLEANAPK) {
                appIcon.load(CleanAPKInterface.ASSET_URL + it.icon_image_path)
            } else {
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_marginStart="20dp"
    android:layout_marginEnd="20dp"
    android:layout_marginTop="10dp"
    android:gravity="end"
    android:orientation="horizontal">

+35 −14
Original line number Diff line number Diff line
@@ -19,14 +19,16 @@
<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"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp"
        android:orientation="horizontal">

        <androidx.cardview.widget.CardView
@@ -72,28 +74,47 @@
        </LinearLayout>
    </LinearLayout>

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

        <com.google.android.material.textview.MaterialTextView
        <TextView
            android:id="@+id/sourceTag"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_tag_rounded"
            android:paddingStart="10dp"
            android:paddingTop="4dp"
            android:paddingEnd="10dp"
            android:paddingBottom="4dp"
            android:textAllCaps="false"
            android:textColor="#626262"
            android:layout_marginEnd="10dp"
            android:textSize="14sp"
            android:visibility="gone"
            tools:text="Open Source" />

        <TextView
            android:id="@+id/categoryTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/colorAccent"
            android:textSize="16sp"
            android:layout_margin="4dp"
            android:background="@drawable/bg_tag_rounded"
            android:paddingStart="10dp"
            android:paddingTop="4dp"
            android:paddingEnd="10dp"
            android:paddingBottom="4dp"
            android:textAllCaps="false"
            android:textColor="#626262"
            android:textSize="14sp"
            android:layout_marginEnd="20dp"
            tools:text="Racing" />
    </androidx.cardview.widget.CardView>

    </LinearLayout>


</LinearLayout>
 No newline at end of file