From bf021a9c3cd7b6f0446457682405f32299a74c52 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Wed, 21 Sep 2022 14:40:34 +0600 Subject: [PATCH 1/6] source tag added in app detail page --- .../e/apps/api/fused/FusedAPIImpl.kt | 10 ++- .../e/apps/application/ApplicationFragment.kt | 4 ++ .../res/layout/fragment_application_title.xml | 61 ++++++++++++++----- 3 files changed, 59 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt index 5f6d9c092..9d3c42a23 100644 --- a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt @@ -850,6 +850,7 @@ class FusedAPIImpl @Inject constructor( response?.let { it.updateStatus() it.updateType() + it.updateSource() it.updateFilterLevel(authData) } }) @@ -1054,7 +1055,7 @@ class FusedAPIImpl @Inject constructor( private fun getCategoryIconName(category: FusedCategory): String { var categoryTitle = if (category.tag.getOperationalTag() - .contentEquals(AppTag.GPlay().getOperationalTag()) + .contentEquals(AppTag.GPlay().getOperationalTag()) ) category.id else category.title if (categoryTitle.contains(CATEGORY_TITLE_REPLACEABLE_CONJUNCTION)) { @@ -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.transformToList(): List { val list = mutableListOf() this.forEach { diff --git a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt index 365a5473e..ecc11a4e8 100644 --- a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt +++ b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt @@ -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 { diff --git a/app/src/main/res/layout/fragment_application_title.xml b/app/src/main/res/layout/fragment_application_title.xml index 65109c8b0..ac40d983f 100644 --- a/app/src/main/res/layout/fragment_application_title.xml +++ b/app/src/main/res/layout/fragment_application_title.xml @@ -19,9 +19,9 @@ + android:layout_height="wrap_content" + android:orientation="vertical"> - + android:backgroundTint="@color/colorBackground"> - - + 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"> + + + + + + + + + \ No newline at end of file -- GitLab From fb09bba67fd593478a9e6ba540a8fbf3dec31c94 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Wed, 21 Sep 2022 17:35:32 +0600 Subject: [PATCH 2/6] ui of source tag updated --- .../e/apps/application/ApplicationFragment.kt | 2 +- .../res/layout/fragment_application_title.xml | 59 ++++++++----------- 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt index ecc11a4e8..14be0e64d 100644 --- a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt +++ b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt @@ -323,7 +323,7 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) { } categoryTitle.text = it.category if (it.origin == Origin.CLEANAPK) { - sourceTagCardView.visibility = View.VISIBLE + sourceTag.visibility = View.VISIBLE sourceTag.text = it.source } if (origin == Origin.CLEANAPK) { diff --git a/app/src/main/res/layout/fragment_application_title.xml b/app/src/main/res/layout/fragment_application_title.xml index ac40d983f..7aa2e1d57 100644 --- a/app/src/main/res/layout/fragment_application_title.xml +++ b/app/src/main/res/layout/fragment_application_title.xml @@ -80,49 +80,36 @@ android:background="@color/colorBackground" android:backgroundTint="@color/colorBackground"> - - - - + tools:text="Open Source" /> - - - - + tools:text="Racing" /> -- GitLab From ad9c0d11e6817614da65048aeffa91be8aec77b6 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Fri, 23 Sep 2022 06:21:04 +0600 Subject: [PATCH 3/6] fixed: tags position in app detail page --- app/src/main/res/layout/fragment_application_download.xml | 1 + app/src/main/res/layout/fragment_application_title.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/res/layout/fragment_application_download.xml b/app/src/main/res/layout/fragment_application_download.xml index c8f15a915..fcf28d6f1 100644 --- a/app/src/main/res/layout/fragment_application_download.xml +++ b/app/src/main/res/layout/fragment_application_download.xml @@ -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"> diff --git a/app/src/main/res/layout/fragment_application_title.xml b/app/src/main/res/layout/fragment_application_title.xml index 7aa2e1d57..e158b1f5a 100644 --- a/app/src/main/res/layout/fragment_application_title.xml +++ b/app/src/main/res/layout/fragment_application_title.xml @@ -76,6 +76,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end" + android:layout_marginTop="10dp" android:layout_marginBottom="1dp" android:background="@color/colorBackground" android:backgroundTint="@color/colorBackground"> -- GitLab From 724e6abd9a17909778601b35625f5670f77d5334 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Tue, 4 Oct 2022 19:35:11 +0600 Subject: [PATCH 4/6] fixed UI title segment of app detail page --- app/build.gradle | 2 ++ .../foundation/e/apps/application/ApplicationFragment.kt | 4 ++++ app/src/main/res/layout/fragment_application_title.xml | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 79c8acd73..e881e5c4b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -149,6 +149,8 @@ dependencies { implementation "androidx.viewpager2:viewpager2:1.0.0" implementation "androidx.recyclerview:recyclerview:1.2.1" + implementation 'com.google.android.flexbox:flexbox:3.0.0' + //logger implementation 'com.jakewharton.timber:timber:5.0.1' diff --git a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt index 88d93e7ff..b84fbca35 100644 --- a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt +++ b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt @@ -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 diff --git a/app/src/main/res/layout/fragment_application_title.xml b/app/src/main/res/layout/fragment_application_title.xml index e158b1f5a..b87327fa1 100644 --- a/app/src/main/res/layout/fragment_application_title.xml +++ b/app/src/main/res/layout/fragment_application_title.xml @@ -26,7 +26,9 @@ -- GitLab From bbef16ae41bd0f87a60c209522b3c10ab91861d7 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Tue, 4 Oct 2022 19:35:11 +0600 Subject: [PATCH 5/6] fixed UI title segment of app detail page --- .../main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt | 7 ++++--- .../foundation/e/apps/application/ApplicationFragment.kt | 4 ++++ app/src/main/res/layout/fragment_application_title.xml | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt index 9d3c42a23..955572c8b 100644 --- a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt @@ -1391,10 +1391,11 @@ class FusedAPIImpl @Inject constructor( } 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) + 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.transformToList(): List { diff --git a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt index 88d93e7ff..b84fbca35 100644 --- a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt +++ b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt @@ -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 diff --git a/app/src/main/res/layout/fragment_application_title.xml b/app/src/main/res/layout/fragment_application_title.xml index e158b1f5a..b87327fa1 100644 --- a/app/src/main/res/layout/fragment_application_title.xml +++ b/app/src/main/res/layout/fragment_application_title.xml @@ -26,7 +26,9 @@ -- GitLab From 1e55767263ba7c20499bf4f9adc261322c247dd5 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Wed, 5 Oct 2022 19:30:00 +0600 Subject: [PATCH 6/6] dependency of flexbox removed --- app/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e881e5c4b..79c8acd73 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -149,8 +149,6 @@ dependencies { implementation "androidx.viewpager2:viewpager2:1.0.0" implementation "androidx.recyclerview:recyclerview:1.2.1" - implementation 'com.google.android.flexbox:flexbox:3.0.0' - //logger implementation 'com.jakewharton.timber:timber:5.0.1' -- GitLab