Fix edit profile nav pratyush nav compose (#1708)

This commit is contained in:
Aditya Kumdale 2024-07-11 22:47:38 +05:30 committed by GitHub
parent e440a5e462
commit 414794e353
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 31 additions and 40 deletions

View File

@ -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() }
)
}
}
}
}

View File

@ -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)
)
}
}

View File

@ -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
)
}
}

View File

@ -34,12 +34,6 @@
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="barcode_ui" />
<activity android:name=".feature.standing.instruction.SIDetailsActivity" />
<activity
android:name=".standinginstruction.ui.NewSIActivity"
android:label="@string/title_activity_new_si"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".merchants.ui.MerchantTransferActivity" />
<activity
android:name=".SplashScreenActivity"
android:exported="true"
@ -103,13 +97,7 @@
<activity
android:name=".feature.auth.mobile_verify.MobileVerificationActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".feature.profile.edit.EditProfileActivity"
android:theme="@style/AppTheme"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".feature.settings.SettingsActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".feature.bank.accounts.link.LinkBankAccountActivity"
android:theme="@style/AppTheme" />

View File

@ -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)
),
)
}