@@ -16,7 +16,6 @@ import androidclient.core.ui.generated.resources.core_ui_balance
1616import androidclient.core.ui.generated.resources.core_ui_description
1717import androidclient.core.ui.generated.resources.core_ui_document_id
1818import androidclient.core.ui.generated.resources.core_ui_document_key
19- import androidclient.core.ui.generated.resources.core_ui_document_type
2019import androidclient.core.ui.generated.resources.core_ui_due
2120import androidclient.core.ui.generated.resources.core_ui_due_as_of
2221import androidclient.core.ui.generated.resources.core_ui_identify_documents
@@ -34,6 +33,13 @@ import androidclient.core.ui.generated.resources.core_ui_total_collateral_value
3433import androidclient.core.ui.generated.resources.core_ui_total_value
3534import androidclient.core.ui.generated.resources.core_ui_type
3635import androidclient.core.ui.generated.resources.core_ui_waived
36+ import androidx.compose.animation.AnimatedVisibility
37+ import androidx.compose.animation.expandVertically
38+ import androidx.compose.animation.fadeIn
39+ import androidx.compose.animation.fadeOut
40+ import androidx.compose.animation.shrinkVertically
41+ import androidx.compose.animation.slideInVertically
42+ import androidx.compose.animation.slideOutVertically
3743import androidx.compose.foundation.border
3844import androidx.compose.foundation.clickable
3945import androidx.compose.foundation.layout.Arrangement
@@ -56,12 +62,15 @@ import androidx.compose.runtime.saveable.rememberSaveable
5662import androidx.compose.runtime.setValue
5763import androidx.compose.ui.Alignment
5864import androidx.compose.ui.Modifier
65+ import androidx.compose.ui.graphics.Color
5966import androidx.compose.ui.graphics.vector.ImageVector
67+ import androidx.compose.ui.platform.LocalDensity
6068import androidx.compose.ui.unit.dp
6169import com.mifos.core.designsystem.icon.MifosIcons
6270import com.mifos.core.designsystem.theme.AppColors
6371import com.mifos.core.designsystem.theme.DesignToken
6472import com.mifos.core.designsystem.theme.MifosTypography
73+ import com.mifos.core.designsystem.utils.onClick
6574import org.jetbrains.compose.resources.stringResource
6675import org.jetbrains.compose.ui.tooling.preview.Preview
6776
@@ -88,18 +97,21 @@ fun MifosActionsIdentifierListingComponent(
8897 type : String ,
8998 id : String ,
9099 key : String ,
91- status : Status ,
100+ status : Status ? ,
92101 description : String ,
93102 identifyDocuments : String ,
103+ isExpanded : Boolean ,
94104 menuList : List <Actions >,
95105 onActionClicked : (Actions ) -> Unit ,
106+ onClick : () -> Unit ,
96107) {
108+ val density = LocalDensity .current
109+
97110 MifosActionsListingComponentOutline {
98111 Column {
99- Column (modifier = Modifier .padding(DesignToken .padding.large)) {
100- MifosListingRowItem (
101- key = stringResource(Res .string.core_ui_document_type),
102- value = type,
112+ Column (modifier = Modifier .padding(DesignToken .padding.large).onClick { onClick() }) {
113+ MifosListingRowItemHeader (
114+ text = type,
103115 keyStyle = MifosTypography .titleSmallEmphasized,
104116 valueStyle = MifosTypography .titleSmall,
105117 )
@@ -117,8 +129,8 @@ fun MifosActionsIdentifierListingComponent(
117129 )
118130 MifosListingRowItem (
119131 key = stringResource(Res .string.core_ui_status),
120- value = status.name,
121- valueColor = status. color,
132+ value = status? .name ? : " Not Found " ,
133+ valueColor = if ( status?.name != null ) status. color else Color . Red ,
122134 )
123135 MifosListingRowItem (
124136 key = stringResource(Res .string.core_ui_description),
@@ -130,40 +142,52 @@ fun MifosActionsIdentifierListingComponent(
130142 )
131143 }
132144 }
133- Surface (
134- modifier = Modifier .fillMaxWidth(),
135- shape = RoundedCornerShape (
136- bottomStart = DesignToken .padding.medium,
137- bottomEnd = DesignToken .padding.medium,
145+ AnimatedVisibility (
146+ visible = isExpanded,
147+ enter = slideInVertically {
148+ with (density) { - 40 .dp.roundToPx() }
149+ } + expandVertically(
150+ expandFrom = Alignment .Top ,
151+ ) + fadeIn(
152+ initialAlpha = 0.3f ,
138153 ),
154+ exit = slideOutVertically() + shrinkVertically() + fadeOut(),
139155 ) {
140- Column (
141- modifier = Modifier .padding(
142- vertical = DesignToken .padding.small,
156+ Surface (
157+ modifier = Modifier .fillMaxWidth(),
158+ shape = RoundedCornerShape (
159+ bottomStart = DesignToken .padding.medium,
160+ bottomEnd = DesignToken .padding.medium,
143161 ),
144162 ) {
145- menuList.map { menuItem ->
146- Row (
147- modifier = Modifier .fillMaxWidth()
148- .height(DesignToken .sizes.avatarMedium)
149- .clickable {
150- onActionClicked(menuItem)
151- },
152- verticalAlignment = Alignment .CenterVertically ,
153- horizontalArrangement = Arrangement .Start ,
154- ) {
155- Icon (
156- modifier = Modifier .padding(horizontal = DesignToken .padding.large),
157- imageVector = menuItem.icon,
158- contentDescription = " " ,
159- )
163+ Column (
164+ modifier = Modifier .padding(
165+ vertical = DesignToken .padding.small,
166+ ),
167+ ) {
168+ menuList.map { menuItem ->
169+ Row (
170+ modifier = Modifier .fillMaxWidth()
171+ .height(DesignToken .sizes.avatarMedium)
172+ .clickable {
173+ onActionClicked(menuItem)
174+ },
175+ verticalAlignment = Alignment .CenterVertically ,
176+ horizontalArrangement = Arrangement .Start ,
177+ ) {
178+ Icon (
179+ modifier = Modifier .padding(horizontal = DesignToken .padding.large),
180+ imageVector = menuItem.icon,
181+ contentDescription = " " ,
182+ )
160183
161- Text (
162- modifier = Modifier .fillMaxWidth(),
163- text = menuItem.name,
164- color = MaterialTheme .colorScheme.onSurface,
165- fontSize = MaterialTheme .typography.bodyLarge.fontSize,
166- )
184+ Text (
185+ modifier = Modifier .fillMaxWidth(),
186+ text = menuItem.name,
187+ color = MaterialTheme .colorScheme.onSurface,
188+ fontSize = MaterialTheme .typography.bodyLarge.fontSize,
189+ )
190+ }
167191 }
168192 }
169193 }
@@ -543,7 +567,7 @@ enum class Actions(val icon: ImageVector) {
543567
544568@Preview
545569@Composable
546- fun PreviewMifosActionsIdentifierListingComponent () {
570+ private fun PreviewMifosActionsIdentifierListingComponent () {
547571 MaterialTheme {
548572 MifosActionsIdentifierListingComponent (
549573 type = " Passport" ,
@@ -565,13 +589,15 @@ fun PreviewMifosActionsIdentifierListingComponent() {
565589 else -> println (" Action not Handled" )
566590 }
567591 },
592+ onClick = {},
593+ isExpanded = true ,
568594 )
569595 }
570596}
571597
572598@Preview
573599@Composable
574- fun PreviewMifosActionsClientFeeListingComponent () {
600+ private fun PreviewMifosActionsClientFeeListingComponent () {
575601 MaterialTheme {
576602 MifosActionsClientFeeListingComponent (
577603 name = " John Doe" ,
@@ -621,7 +647,7 @@ fun PreviewMifosActionsSavingsListingComponent() {
621647
622648@Preview
623649@Composable
624- fun PreviewMifosActionsCollateralDataListingComponent () {
650+ private fun PreviewMifosActionsCollateralDataListingComponent () {
625651 MaterialTheme {
626652 MifosActionsCollateralDataListingComponent (
627653 name = " Gold Jewelry" ,
@@ -645,7 +671,7 @@ fun PreviewMifosActionsCollateralDataListingComponent() {
645671
646672@Preview
647673@Composable
648- fun PreviewMifosActionsLoanListingComponent () {
674+ private fun PreviewMifosActionsLoanListingComponent () {
649675 MaterialTheme {
650676 MifosActionsLoanListingComponent (
651677 accountNo = " LN12345" ,
0 commit comments