From 1e1aadb6b1f790fa8e62a95176cec7f61147312f Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Sanchez Date: Tue, 25 Jul 2023 11:58:55 +0200 Subject: [PATCH 1/2] increase clickable area --- .../aacboard/ui/fragments/adapter/ListDashboardAdapter.kt | 8 ++++---- app/src/main/res/layout/item_dashboard.xml | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt b/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt index 880297f..2315540 100644 --- a/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt +++ b/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt @@ -41,16 +41,16 @@ class ListDashboardAdapter( fun bind(dashboard: ListDashboardsViewModel.DashboardUiItem) { binding.apply { + if (dashboard.image.isNotEmpty()) dashboardIcon.loadUrl(dashboard.image) + name.text = dashboard.name preferredIcon.setImageDrawable( AppCompatResources.getDrawable( itemView.context, if (dashboard.isPreferred) R.drawable.ic_filled_star else R.drawable.ic_outline_star, ), ) - name.text = dashboard.name - if (dashboard.image.isNotEmpty()) dashboardIcon.loadUrl(dashboard.image) - preferredIcon.setOnClickListener { - onPreferredSelected(dashboard.id) + listOf(preferredIcon, name).forEach { view -> + view.setOnClickListener { onPreferredSelected(dashboard.id) } } navigateToDetailIcon.setOnClickListener { onDashboardNavigateClicked(dashboard.id) diff --git a/app/src/main/res/layout/item_dashboard.xml b/app/src/main/res/layout/item_dashboard.xml index 301399e..3131784 100644 --- a/app/src/main/res/layout/item_dashboard.xml +++ b/app/src/main/res/layout/item_dashboard.xml @@ -1,6 +1,4 @@ - - Date: Tue, 25 Jul 2023 11:58:55 +0200 Subject: [PATCH 2/2] increase clickable area --- .../aacboard/ui/fragments/adapter/ListDashboardAdapter.kt | 8 ++++---- app/src/main/res/layout/item_dashboard.xml | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt b/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt index 880297f..2315540 100644 --- a/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt +++ b/app/src/main/java/com/architectcoders/aacboard/ui/fragments/adapter/ListDashboardAdapter.kt @@ -41,16 +41,16 @@ class ListDashboardAdapter( fun bind(dashboard: ListDashboardsViewModel.DashboardUiItem) { binding.apply { + if (dashboard.image.isNotEmpty()) dashboardIcon.loadUrl(dashboard.image) + name.text = dashboard.name preferredIcon.setImageDrawable( AppCompatResources.getDrawable( itemView.context, if (dashboard.isPreferred) R.drawable.ic_filled_star else R.drawable.ic_outline_star, ), ) - name.text = dashboard.name - if (dashboard.image.isNotEmpty()) dashboardIcon.loadUrl(dashboard.image) - preferredIcon.setOnClickListener { - onPreferredSelected(dashboard.id) + listOf(preferredIcon, name).forEach { view -> + view.setOnClickListener { onPreferredSelected(dashboard.id) } } navigateToDetailIcon.setOnClickListener { onDashboardNavigateClicked(dashboard.id) diff --git a/app/src/main/res/layout/item_dashboard.xml b/app/src/main/res/layout/item_dashboard.xml index 301399e..3131784 100644 --- a/app/src/main/res/layout/item_dashboard.xml +++ b/app/src/main/res/layout/item_dashboard.xml @@ -1,6 +1,4 @@ - -