From 8e15a0f4d2f251b36d2666cee1b08cee8db4f4b8 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 16 Dec 2022 07:54:06 +0530 Subject: [PATCH 1/4] set install button width to wrap_content --- app/src/main/res/layout/application_list_item.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/application_list_item.xml b/app/src/main/res/layout/application_list_item.xml index c73e70a81..bf6f7ef8c 100644 --- a/app/src/main/res/layout/application_list_item.xml +++ b/app/src/main/res/layout/application_list_item.xml @@ -129,7 +129,7 @@ Date: Fri, 16 Dec 2022 07:55:59 +0530 Subject: [PATCH 2/4] programmatically set max size of install button --- .../apps/applicationlist/ApplicationListRVAdapter.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt index 0c45331ab..8afb2e0c6 100644 --- a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt @@ -133,6 +133,8 @@ class ApplicationListRVAdapter( setAppIcon(searchApp, shimmerDrawable) removeIsPurchasedObserver(holder) + setInstallButtonDimensions(view) + if (appInfoFetchViewModel.isAppInBlockedList(searchApp)) { setupShowMoreButton() } else { @@ -145,6 +147,16 @@ class ApplicationListRVAdapter( } } + private fun ApplicationListItemBinding.setInstallButtonDimensions(item: View) { + item.post { + val maxAllowedWidth = (item.measuredWidth - 20) / 2 + installButton.apply { + if (width > maxAllowedWidth) + width = maxAllowedWidth + } + } + } + private fun ApplicationListItemBinding.setAppIcon( searchApp: FusedApp, shimmerDrawable: ShimmerDrawable -- GitLab From be5085435fb121899d3681da781c55a59e6d36e2 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 16 Dec 2022 08:04:06 +0530 Subject: [PATCH 3/4] ktlint fixes --- app/src/main/java/foundation/e/apps/search/SearchFragment.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/foundation/e/apps/search/SearchFragment.kt b/app/src/main/java/foundation/e/apps/search/SearchFragment.kt index aaa3faa17..7d422c0b9 100644 --- a/app/src/main/java/foundation/e/apps/search/SearchFragment.kt +++ b/app/src/main/java/foundation/e/apps/search/SearchFragment.kt @@ -61,7 +61,6 @@ import foundation.e.apps.utils.exceptions.GPlayLoginException import foundation.e.apps.utils.modules.PWAManagerModule import foundation.e.apps.utils.parentFragment.TimeoutFragment import kotlinx.coroutines.launch -import timber.log.Timber import javax.inject.Inject @AndroidEntryPoint -- GitLab From 2c0147a2a7b743ab948470d441cc6c119d4acf54 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 16 Dec 2022 18:39:17 +0530 Subject: [PATCH 4/4] remove 20 --- .../e/apps/applicationlist/ApplicationListRVAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt index 8afb2e0c6..e98783e43 100644 --- a/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/applicationlist/ApplicationListRVAdapter.kt @@ -149,7 +149,7 @@ class ApplicationListRVAdapter( private fun ApplicationListItemBinding.setInstallButtonDimensions(item: View) { item.post { - val maxAllowedWidth = (item.measuredWidth - 20) / 2 + val maxAllowedWidth = item.measuredWidth / 2 installButton.apply { if (width > maxAllowedWidth) width = maxAllowedWidth -- GitLab