Skip to content

feat : Activate migrated to CMP#2388

Merged
niyajali merged 9 commits intoopenMF:kmp-implfrom
revanthkumarJ:activate
May 27, 2025
Merged

feat : Activate migrated to CMP#2388
niyajali merged 9 commits intoopenMF:kmp-implfrom
revanthkumarJ:activate

Conversation

@revanthkumarJ
Copy link
Contributor

@revanthkumarJ revanthkumarJ commented May 26, 2025

Fixes - Jira-413

Screenshot 2025-05-27 101234
Screenshot 2025-05-27 101244
image
image

@revanthkumarJ revanthkumarJ changed the title Activate migrated to CMP feat : Activate migrated to CMP May 27, 2025
@revanthkumarJ revanthkumarJ marked this pull request as ready for review May 27, 2025 04:49
)
}
//
//private class ActivateUiStateProvider : PreviewParameterProvider<ActivateUiState> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable Compose Multiplatform Preview, Uncomment these lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -40,15 +50,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the dispatcher

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

activateClientUseCase(clientId, clientPayload).collect { result ->
when (result) {
is Resource.Error<*> ->
is DataState.Error<*> ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these DataState type contains <*> fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -74,15 +84,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the dispatcher

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 120 to 123
LaunchedEffect(true){
snackbarHostState.showSnackbar(getString( state.message))
}
onBackPressed()
Copy link
Collaborator

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snackbar might not show by the time onBackPressed() is called, use alertdialog whenever possible.

Also if I am not wrong it only runs during the initial composition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to MifosAlertDialog

Comment on lines 209 to 212
fun formatDate(millis: Long): String {
val dateTime = Instant.fromEpochMilliseconds(millis).toLocalDateTime(TimeZone.currentSystemDefault())
return "${dateTime.dayOfMonth} ${dateTime.month.name.lowercase().replaceFirstChar { it.uppercase() }} ${dateTime.year}"
}
Copy link
Collaborator

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put this in common? since it will be used in like 5/7 screen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i will move it to common

@@ -57,15 +67,15 @@ class ActivateViewModel(
viewModelScope.launch(Dispatchers.IO) {
Copy link
Collaborator

@itsPronay itsPronay May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-05-27 at 11 12 44 AM

remove dispatchers.IO , check line 84 as well

@niyajali niyajali merged commit c840321 into openMF:kmp-impl May 27, 2025
itsPronay pushed a commit to itsPronay/android-client that referenced this pull request Aug 5, 2025
itsPronay pushed a commit to itsPronay/android-client that referenced this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants