From e3d0b1143dd5c846a4aedf0dd2971c049ecc8c05 Mon Sep 17 00:00:00 2001 From: jmanrique Date: Thu, 14 Nov 2024 10:31:39 +0100 Subject: [PATCH] ANDROID-15374 divider implemented in informative sheet --- library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt | 3 +++ .../sheet/children/list/adapter/InformativeListAdapter.kt | 6 +----- library/src/main/res/layout/sheet_list_row_informative.xml | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt b/library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt index 305e1aa52..10cc24faa 100644 --- a/library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt +++ b/library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt @@ -24,6 +24,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialog import com.telefonica.mistica.R import com.telefonica.mistica.button.Button import com.telefonica.mistica.list.MisticaRecyclerView +import com.telefonica.mistica.list.decoration.divider.DividerItemAdapter +import com.telefonica.mistica.list.decoration.divider.DividerItemDecoration import com.telefonica.mistica.list.layout.configureWithFullWidthLayout import com.telefonica.mistica.sheet.Children.BottomActions import com.telefonica.mistica.sheet.Children.ListActions @@ -250,6 +252,7 @@ private fun ListInformative.toView(context: Context): View = RecyclerView(context).also { it.layoutManager = LinearLayoutManager(context) it.adapter = InformativeListAdapter(this.elements.mapToInformativeViewData()) + it.configureWithFullWidthLayout() } private fun BottomActions.toView(onSheetTapped: InternalOnSheetTapped, container: ViewGroup): View { diff --git a/library/src/main/java/com/telefonica/mistica/sheet/children/list/adapter/InformativeListAdapter.kt b/library/src/main/java/com/telefonica/mistica/sheet/children/list/adapter/InformativeListAdapter.kt index 6e9b231c4..42bc61cb6 100644 --- a/library/src/main/java/com/telefonica/mistica/sheet/children/list/adapter/InformativeListAdapter.kt +++ b/library/src/main/java/com/telefonica/mistica/sheet/children/list/adapter/InformativeListAdapter.kt @@ -54,11 +54,7 @@ internal class InformativeListAdapter(val items: List) : } } - if (position == items.size - 1) { - holder.bottomExtraSpace.visibility = View.VISIBLE - } else { - holder.bottomExtraSpace.visibility = View.GONE - } + holder.bottomExtraSpace.visibility = View.VISIBLE } override fun getItemCount(): Int = items.size diff --git a/library/src/main/res/layout/sheet_list_row_informative.xml b/library/src/main/res/layout/sheet_list_row_informative.xml index 2421205c5..ab5f4ef75 100644 --- a/library/src/main/res/layout/sheet_list_row_informative.xml +++ b/library/src/main/res/layout/sheet_list_row_informative.xml @@ -93,7 +93,7 @@