diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileActivity.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileActivity.kt deleted file mode 100644 index 00894319..00000000 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileActivity.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.mifospay.feature.profile.edit - -import android.os.Bundle -import androidx.activity.compose.setContent -import androidx.appcompat.app.AppCompatActivity -import dagger.hilt.android.AndroidEntryPoint -import org.mifospay.core.designsystem.theme.MifosTheme - - -@AndroidEntryPoint -class EditProfileActivity : AppCompatActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContent { - MifosTheme { - EditProfileScreenRoute( - onBackClick = { finish() } - ) - } - } - } -} \ No newline at end of file diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt index 123b2946..0924da7f 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt @@ -245,7 +245,7 @@ fun EditProfileScreenContent( Column( modifier = Modifier .fillMaxSize() - .background(color = MaterialTheme.colorScheme.surface,) + .background(color = MaterialTheme.colorScheme.surface) .verticalScroll(rememberScrollState()) ) { EditProfileScreenImage( @@ -396,7 +396,10 @@ fun EditProfileSaveButton(onClick: () -> Unit, buttonText: Int) { shape = RoundedCornerShape(10.dp), contentPadding = PaddingValues(12.dp) ) { - Text(text = stringResource(id = buttonText), style = styleMedium16sp.copy(MaterialTheme.colorScheme.onPrimary)) + Text( + text = stringResource(id = buttonText), + style = styleMedium16sp.copy(MaterialTheme.colorScheme.onPrimary) + ) } } diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/navigation/EditProfileNavigation.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/navigation/EditProfileNavigation.kt new file mode 100644 index 00000000..b048c88c --- /dev/null +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/navigation/EditProfileNavigation.kt @@ -0,0 +1,20 @@ +package org.mifospay.feature.profile.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.NavOptions +import androidx.navigation.compose.composable +import org.mifospay.feature.profile.edit.EditProfileScreenRoute + +const val EDIT_PROFILE_ROUTE = "edit_profile_route" +fun NavController.navigateToEditProfile(navOptions: NavOptions? = null) = navigate(EDIT_PROFILE_ROUTE, navOptions) + +fun NavGraphBuilder.editProfileScreen( + onBackPress: () -> Unit, +) { + composable(route = EDIT_PROFILE_ROUTE) { + EditProfileScreenRoute( + onBackClick = onBackPress + ) + } +} diff --git a/mifospay/src/main/AndroidManifest.xml b/mifospay/src/main/AndroidManifest.xml index e97db72c..aaa9dc24 100644 --- a/mifospay/src/main/AndroidManifest.xml +++ b/mifospay/src/main/AndroidManifest.xml @@ -34,12 +34,6 @@ android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="barcode_ui" /> - - - - - + diff --git a/mifospay/src/main/java/org/mifospay/navigation/MifosNavHost.kt b/mifospay/src/main/java/org/mifospay/navigation/MifosNavHost.kt index 0edfa2c9..7da0a749 100644 --- a/mifospay/src/main/java/org/mifospay/navigation/MifosNavHost.kt +++ b/mifospay/src/main/java/org/mifospay/navigation/MifosNavHost.kt @@ -29,7 +29,8 @@ import org.mifospay.feature.make.transfer.navigation.navigateToMakeTransferScree import org.mifospay.feature.merchants.navigation.merchantTransferScreen import org.mifospay.feature.passcode.PassCodeActivity import org.mifospay.feature.payments.paymentsScreen -import org.mifospay.feature.profile.edit.EditProfileActivity +import org.mifospay.feature.profile.navigation.editProfileScreen +import org.mifospay.feature.profile.navigation.navigateToEditProfile import org.mifospay.feature.profile.navigation.profileScreen import org.mifospay.feature.read.qr.navigation.readQrScreen import org.mifospay.feature.receipt.navigation.navigateToReceipt @@ -100,7 +101,7 @@ fun MifosNavHost( } ) profileScreen( - onEditProfile = { context.startActivityEditProfile() }, + onEditProfile = { navController.navigateToEditProfile() }, onSettings = { navController.navigateToSettings() } ) sendMoneyScreen( @@ -152,6 +153,7 @@ fun MifosNavHost( kycLevel3Screen() newSiScreen(onBackClick = navController::popBackStack) + editProfileScreen(onBackPress = navController::popBackStack) faqScreen( navigateBack = { navController.popBackStack() } @@ -197,4 +199,5 @@ fun Context.openPassCodeActivity(deepLinkURI: Uri) { Pair(PassCodeConstants.PASSCODE_INITIAL_LOGIN, true) ), ) + } \ No newline at end of file