forked from openMF/android-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b42ed1
commit a0a26a5
Showing
10 changed files
with
136 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
81 changes: 81 additions & 0 deletions
81
feature/client/src/main/java/com/mifos/feature/client/navigation/ClientNavigation.kt
This file contains 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,81 @@ | ||
package com.mifos.feature.client.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import androidx.navigation.navigation | ||
import com.mifos.core.common.utils.Constants | ||
import com.mifos.core.objects.accounts.savings.DepositType | ||
import com.mifos.feature.client.clientDetails.ui.ClientDetailsScreen | ||
|
||
fun NavController.navigateClientDetailsScreen(clientId: Int) { | ||
navigate(ClientScreens.ClientDetailScreen.argument(clientId)) | ||
} | ||
|
||
|
||
fun NavGraphBuilder.clientNavGraph( | ||
navController: NavController | ||
) { | ||
navigation( | ||
startDestination = ClientScreens.ClientListScreen.route, | ||
route = "" | ||
) { | ||
clientDetailRoute( | ||
onBackPressed = navController::popBackStack, | ||
addLoanAccount = {}, | ||
addSavingsAccount = {}, | ||
charges = {}, | ||
documents = {}, | ||
identifiers = {}, | ||
moreClientInfo = {}, | ||
notes = {}, | ||
pinpointLocation = {}, | ||
survey = {}, | ||
uploadSignature = {}, | ||
loanAccountSelected = {}, | ||
savingsAccountSelected = { _, _ -> }, | ||
activateClient = {} | ||
) | ||
} | ||
} | ||
|
||
fun NavGraphBuilder.clientDetailRoute( | ||
onBackPressed: () -> Unit, | ||
addLoanAccount: (Int) -> Unit, | ||
addSavingsAccount: (Int) -> Unit, | ||
charges: (Int) -> Unit, | ||
documents: (Int) -> Unit, | ||
identifiers: (Int) -> Unit, | ||
moreClientInfo: (Int) -> Unit, | ||
notes: (Int) -> Unit, | ||
pinpointLocation: (Int) -> Unit, | ||
survey: (Int) -> Unit, | ||
uploadSignature: (Int) -> Unit, | ||
loanAccountSelected: (Int) -> Unit, | ||
savingsAccountSelected: (Int, DepositType) -> Unit, | ||
activateClient: (Int) -> Unit | ||
) { | ||
composable( | ||
route = ClientScreens.ClientDetailScreen.route, | ||
arguments = listOf(navArgument(Constants.CLIENT_ID, builder = { type = NavType.IntType })) | ||
) { | ||
ClientDetailsScreen( | ||
onBackPressed = onBackPressed, | ||
addLoanAccount = addLoanAccount, | ||
addSavingsAccount = addSavingsAccount, | ||
charges = charges, | ||
documents = documents, | ||
identifiers = identifiers, | ||
moreClientInfo = moreClientInfo, | ||
notes = notes, | ||
pinpointLocation = pinpointLocation, | ||
survey = survey, | ||
uploadSignature = uploadSignature, | ||
loanAccountSelected = loanAccountSelected, | ||
savingsAccountSelected = savingsAccountSelected, | ||
activateClient = activateClient | ||
) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
feature/client/src/main/java/com/mifos/feature/client/navigation/ClientScreens.kt
This file contains 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,24 @@ | ||
package com.mifos.feature.client.navigation | ||
|
||
import com.mifos.core.common.utils.Constants | ||
|
||
sealed class ClientScreens(val route : String) { | ||
|
||
data object ClientListScreen : ClientScreens("client_list_screen") | ||
|
||
data object ClientDetailScreen : ClientScreens("client_detail_screen/{${Constants.CLIENT_ID}}") { | ||
fun argument(clientId : Int) = "client_detail_screen/${clientId}" | ||
} | ||
|
||
data object ClientChargesScreen : ClientScreens("client_charges_screen") | ||
|
||
data object ClientIdentifierScreen : ClientScreens("client_identifier_screen") | ||
|
||
data object ClientPinPointScreen : ClientScreens("client_pin_point_screen") | ||
|
||
data object ClientSignatureScreen : ClientScreens("client_signature_screen") | ||
|
||
data object ClientSurveyListScreen : ClientScreens("client_survey_list_screen") | ||
|
||
data object ClientSurveyQuestionScreen : ClientScreens("client_survey_question_screen") | ||
} |
This file contains 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 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 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 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