Skip to content

Commit

Permalink
fix: [ANDROAPP-6744] Add bottom window insets and padding to Input mu…
Browse files Browse the repository at this point in the history
…ltiselection and modify legend data object
  • Loading branch information
xavimolloy committed Jan 30, 2025
1 parent 52be2f6 commit d7476d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ private const val MAX_CHECKBOXES_ITEMS_TO_SHOW = 50
* @param doneButtonText: text to be shown for accept button in pop up.
* @param onClearItemSelection: callback for clear item selection.
*/
@OptIn(ExperimentalLayoutApi::class)
@OptIn(ExperimentalLayoutApi::class, ExperimentalMaterial3Api::class)
@Composable
fun InputMultiSelection(
items: List<CheckBoxData>,
title: String,
state: InputShellState,
windowInsets: @Composable () -> WindowInsets = { BottomSheetDefaults.windowInsets },
bottomSheetLowerPadding: Dp = Spacing0,
supportingTextData: List<SupportingTextData>?,
legendData: LegendData?,
isRequired: Boolean,
Expand Down Expand Up @@ -229,6 +231,8 @@ fun InputMultiSelection(

if (showMultiSelectBottomSheet) {
MultiSelectBottomSheet(
windowInsets = windowInsets,
bottomSheetLowerPadding = bottomSheetLowerPadding,
items = items,
title = title,
noResultsFoundString = noResultsFoundString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.hoverPointerIcon
fun Legend(
legendData: LegendData,
modifier: Modifier = Modifier,
windowInsets: @Composable () -> WindowInsets = { BottomSheetDefaults.windowInsets },
bottomSheetLowerPadding: Dp = Spacing0,
) {
var showBottomSheetShell by rememberSaveable { mutableStateOf(false) }

Expand Down Expand Up @@ -130,13 +128,13 @@ fun Legend(
BottomSheetShell(
uiState = BottomSheetShellUIState(
title = legendData.title,
bottomPadding = bottomSheetLowerPadding,
bottomPadding = legendData.bottomSheetLowerPadding,
),
modifier = Modifier.testTag("LEGEND_BOTTOM_SHEET"),
content = {
legendData.popUpLegendDescriptionData?.let { LegendRange(it) }
},
windowInsets = windowInsets,
windowInsets = legendData.windowInsets,
icon = {
Icon(
imageVector = Icons.Outlined.Info,
Expand Down Expand Up @@ -223,8 +221,12 @@ data class LegendDescriptionData(
* @param popUpLegendDescriptionData list of [LegendDescriptionData] with information for the
* legend range description pop up.
*/
data class LegendData(
data class LegendData
@OptIn(ExperimentalMaterial3Api::class)
constructor(
val color: Color,
val title: String,
val popUpLegendDescriptionData: List<LegendDescriptionData>? = null,
val windowInsets: @Composable () -> WindowInsets = { BottomSheetDefaults.windowInsets },
val bottomSheetLowerPadding: Dp = Spacing0,
)

0 comments on commit d7476d6

Please sign in to comment.