From 92934023bf24e4f8ff6bc63d6ec1a724d5bc415d Mon Sep 17 00:00:00 2001 From: Lentumunai Mark <90028422+Lentumunai-Mark@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:47:11 +0300 Subject: [PATCH] Make the Apply Filter/ Sync Data button on the Multiselect Widget sticky (#3629) Signed-off-by: Lentumunai-Mark --- .../multiselect/MultiSelectBottomSheetView.kt | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/multiselect/MultiSelectBottomSheetView.kt b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/multiselect/MultiSelectBottomSheetView.kt index 4c8a451baa..0999e1a2a3 100644 --- a/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/multiselect/MultiSelectBottomSheetView.kt +++ b/android/quest/src/main/java/org/smartregister/fhircore/quest/ui/multiselect/MultiSelectBottomSheetView.kt @@ -161,9 +161,30 @@ fun MultiSelectBottomSheetView( ) } }, - ) { + bottomBar = { + if (syncLocationStateMap.isNotEmpty() && rootTreeNodes.isNotEmpty()) { + Button( + onClick = { onSelectionDone(multiSelectViewAction) }, + modifier = Modifier.fillMaxWidth().padding(vertical = 16.dp, horizontal = 8.dp), + ) { + Text( + text = + stringResource( + id = + when (multiSelectViewAction.first()) { + MultiSelectViewAction.SYNC_DATA -> R.string.sync_data + MultiSelectViewAction.FILTER_DATA -> R.string.apply_filter + }, + ) + .uppercase(), + modifier = Modifier.padding(8.dp), + ) + } + } + }, + ) { paddingValues -> Box( - modifier = Modifier.fillMaxSize().padding(it), + modifier = Modifier.fillMaxSize().padding(paddingValues), contentAlignment = Alignment.TopCenter, ) { if (isLoading.value == true) { @@ -217,27 +238,6 @@ fun MultiSelectBottomSheetView( } } } - item { - if (syncLocationStateMap.isNotEmpty() && rootTreeNodes.isNotEmpty()) { - Button( - onClick = { onSelectionDone(multiSelectViewAction) }, - modifier = Modifier.fillMaxWidth().padding(vertical = 16.dp, horizontal = 8.dp), - ) { - Text( - text = - stringResource( - id = - when (multiSelectViewAction.first()) { - MultiSelectViewAction.SYNC_DATA -> R.string.sync_data - MultiSelectViewAction.FILTER_DATA -> R.string.apply_filter - }, - ) - .uppercase(), - modifier = Modifier.padding(8.dp), - ) - } - } - } } } }