-
Notifications
You must be signed in to change notification settings - Fork 656
feat(savingsAccount): preview functionality #2521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e243824
feat(savingsAccount): preview functionality
sam-arth07 3becfa1
Merge branch 'openMF:development' into MIFOSAC-539
sam-arth07 af966c9
feat(savingsAccount) : verified the working of the api service for cr…
sam-arth07 6ba966d
Merge branch 'MIFOSAC-539' of https://github.com/sam-arth07/android-c…
sam-arth07 86a30c9
updated logic to handle savings account submission and further in-app…
sam-arth07 66cdba5
Merge branch 'openMF:development' into MIFOSAC-539
sam-arth07 c0fbf9e
Merge branch 'MIFOSAC-539' of https://github.com/sam-arth07/android-c…
sam-arth07 6f94c41
fixed static checks failing
sam-arth07 49ef3c6
feature(savingsAccount): preview functionality impl, handle submit sa…
sam-arth07 1c0be53
feature(savingsAccount): preview functionality impl, handle submit sa…
sam-arth07 1de042a
refactor(savingsAccount): improve layout and navigation logic, update…
sam-arth07 414e794
refactor(savingsAccount): update createSavingsAccount to return Savin…
sam-arth07 36d5b6d
refactor(savingsAccount): enhance error handling in createSavingsAcco…
sam-arth07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
core/ui/src/commonMain/kotlin/com/mifos/core/ui/components/MifosGeneralCard.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| /* | ||
| * Copyright 2025 Mifos Initiative | ||
| * | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
| * | ||
| * See https://github.com/openMF/android-client/blob/master/LICENSE.md | ||
| */ | ||
| package com.mifos.core.ui.components | ||
|
|
||
| import androidx.compose.foundation.border | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.Dp | ||
| import androidx.compose.ui.unit.dp | ||
| import com.mifos.core.designsystem.theme.DesignToken | ||
| import com.mifos.core.designsystem.theme.MifosTypography | ||
| import org.jetbrains.compose.ui.tooling.preview.Preview | ||
|
|
||
| @Composable | ||
| fun MifosGeneralCardComponentOutline( | ||
| modifier: Modifier = Modifier, | ||
| borderCorner: Dp = DesignToken.sizes.iconMiny, | ||
| content: @Composable () -> Unit, | ||
| ) { | ||
| Box( | ||
| modifier = modifier | ||
| .border( | ||
| width = 1.dp, | ||
| shape = RoundedCornerShape( | ||
| topStart = 12.dp, | ||
| topEnd = 12.dp, | ||
| bottomStart = borderCorner, | ||
| bottomEnd = borderCorner, | ||
| ), | ||
| color = MaterialTheme.colorScheme.secondaryContainer, | ||
| ), | ||
| ) { | ||
| content() | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun MifosGeneralRowItem( | ||
| keyContent: @Composable () -> Unit, | ||
| valueContent: @Composable () -> Unit, | ||
| ) { | ||
| Row( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Box( | ||
| modifier = Modifier.weight(1f), | ||
| contentAlignment = Alignment.CenterStart, | ||
| ) { keyContent() } | ||
|
|
||
| Box( | ||
| modifier = Modifier.weight(1f), | ||
| contentAlignment = Alignment.CenterEnd, | ||
| ) { valueContent() } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| fun MifosGeneralCard( | ||
| modifier: Modifier = Modifier, | ||
| contentMap: Map<String, String>, | ||
| separator: String = " : ", | ||
| ) { | ||
| MifosGeneralCardComponentOutline { | ||
| Column( | ||
| modifier = modifier.padding(DesignToken.padding.large), | ||
| ) { | ||
| contentMap.entries.forEachIndexed { index, map -> | ||
| MifosGeneralRowItem( | ||
| keyContent = { Text(text = map.key + separator, style = MifosTypography.labelMediumEmphasized) }, | ||
| valueContent = { Text(text = map.value, style = MifosTypography.labelMediumEmphasized) }, | ||
| ) | ||
| if (index < contentMap.size - 1) { | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.small)) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview | ||
| @Composable | ||
| fun MifosPreviewGeneralCard() { | ||
| MaterialTheme { | ||
| MifosGeneralCard( | ||
| contentMap = mapOf( | ||
| "title" to "answer", | ||
| "title1" to "ans1", | ||
| "title2" to "ans2", | ||
| "title3" to "ans3", | ||
| "title4" to "ans4", | ||
| ), | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does
onFinishachieve here? if it is the same as onBackPressed then use onBackPressedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onFinishis not same as onBackPressed.onFinish = navController::navigateToClientProfileGeneralRouteOnStatus,where
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically we need to navigate to client profile general route after applying for the savings account. That is what onFinish Achieves