From 2514e0f74b8eb810baec2682938ef15322f72392 Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Fri, 20 Sep 2024 14:28:27 +0530 Subject: [PATCH] Add animation to show and hide bottom sheet header --- .../common/screens/bottomSheets/OrgTreeBottomSheetScreen.kt | 2 +- .../dhis/mobile/ui/designsystem/component/BottomSheet.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/bottomSheets/OrgTreeBottomSheetScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/bottomSheets/OrgTreeBottomSheetScreen.kt index a2a9e42d1..348eb0df0 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/bottomSheets/OrgTreeBottomSheetScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/bottomSheets/OrgTreeBottomSheetScreen.kt @@ -125,7 +125,7 @@ fun OrgTreeBottomSheetScreen() { OrgBottomSheet( title = "Transfer [tracked entity type]", - description = "From [current owner org. unit] to...", + subtitle = "From [current owner org. unit] to...", orgTreeItems = oneOrgTreeItem, doneButtonText = "Transfer", doneButtonIcon = Icons.Outlined.MoveDown, diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/BottomSheet.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/BottomSheet.kt index b5558dfd6..fc545bce7 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/BottomSheet.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/BottomSheet.kt @@ -1,5 +1,6 @@ package org.hisp.dhis.mobile.ui.designsystem.component +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.ScrollState import androidx.compose.foundation.background import androidx.compose.foundation.gestures.ScrollableState @@ -222,7 +223,9 @@ fun BottomSheetShell( ) { val hasSearch = searchQuery != null && onSearchQueryChanged != null && onSearch != null - if (showHeader) { + AnimatedVisibility( + visible = showHeader, + ) { BottomSheetHeader( title = title!!, subTitle = subtitle,