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.
Merge branch 'master' into nav_graph_checker_inbox
- Loading branch information
Showing
59 changed files
with
822 additions
and
163 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
8 changes: 8 additions & 0 deletions
8
feature/about/src/main/java/com/mifos/feature/about/navigation/AboutScreens.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,8 @@ | ||
package com.mifos.feature.about.navigation | ||
|
||
/** | ||
* Created by Pronay Sarker on 18/08/2024 (2:42 PM) | ||
*/ | ||
sealed class AboutScreens(val route: String) { | ||
data object AboutScreen : AboutScreens(route = "about_screen_route") | ||
} |
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
32 changes: 32 additions & 0 deletions
32
feature/activate/src/main/java/com/mifos/feature/activate/navigation/ActivateNavigation.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,32 @@ | ||
package com.mifos.feature.activate.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import com.mifos.core.common.utils.Constants | ||
import com.mifos.feature.activate.ActivateScreen | ||
|
||
/** | ||
* Created by Pronay Sarker on 18/08/2024 (1:40 PM) | ||
*/ | ||
fun NavGraphBuilder.activateScreen( | ||
onBackPressed: () -> Unit | ||
) { | ||
composable( | ||
route = ActivateScreens.ActivateScreen.route, | ||
arguments = listOf( | ||
navArgument(name = Constants.ACTIVATE_ID, builder = { NavType.IntType }), | ||
navArgument(name = Constants.ACTIVATE_TYPE, builder = { NavType.StringType }) | ||
) | ||
) { | ||
ActivateScreen( | ||
onBackPressed = onBackPressed | ||
) | ||
} | ||
} | ||
|
||
fun NavController.navigateToActivateScreen(id : Int, type : String){ | ||
navigate(ActivateScreens.ActivateScreen.argument(id, type)) | ||
} |
12 changes: 12 additions & 0 deletions
12
feature/activate/src/main/java/com/mifos/feature/activate/navigation/ActivateScreens.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,12 @@ | ||
package com.mifos.feature.activate.navigation | ||
|
||
import com.mifos.core.common.utils.Constants | ||
|
||
/** | ||
* Created by Pronay Sarker on 18/08/2024 (1:40 PM) | ||
*/ | ||
sealed class ActivateScreens(val route: String) { | ||
data object ActivateScreen : ActivateScreens("activate_screen/{${Constants.ACTIVATE_ID}}/{${Constants.ACTIVATE_TYPE}}") { | ||
fun argument(id: Int, type: String) = "activate_screen/$id/$type" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...re/auth/login/presentation/LoginScreen.kt → ...m/mifos/feature/auth/login/LoginScreen.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
2 changes: 1 addition & 1 deletion
2
...e/auth/login/presentation/LoginUiState.kt → .../mifos/feature/auth/login/LoginUiState.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
2 changes: 1 addition & 1 deletion
2
...auth/login/presentation/LoginViewModel.kt → ...ifos/feature/auth/login/LoginViewModel.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
45 changes: 45 additions & 0 deletions
45
feature/auth/src/main/java/com/mifos/feature/auth/navigation/AuthNavigation.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,45 @@ | ||
package com.mifos.feature.auth.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navigation | ||
import com.mifos.feature.auth.login.LoginScreen | ||
|
||
fun NavGraphBuilder.authNavGraph( | ||
navigateHome: () -> Unit, | ||
navigatePasscode: () -> Unit, | ||
updateServerConfig: () -> Unit | ||
) { | ||
navigation( | ||
startDestination = AuthScreens.LoginScreen.route, | ||
route = AuthScreens.LoginScreenRoute.route | ||
) { | ||
loginRoute( | ||
navigatePasscode = navigatePasscode, | ||
navigateHome = navigateHome, | ||
updateServerConfig = updateServerConfig | ||
) | ||
} | ||
|
||
} | ||
|
||
fun NavGraphBuilder.loginRoute( | ||
navigateHome: () -> Unit, | ||
navigatePasscode: () -> Unit, | ||
updateServerConfig: () -> Unit | ||
) { | ||
composable( | ||
route = AuthScreens.LoginScreen.route | ||
) { | ||
LoginScreen( | ||
homeIntent = navigateHome, | ||
passcodeIntent = navigatePasscode, | ||
onClickToUpdateServerConfig = updateServerConfig | ||
) | ||
} | ||
} | ||
|
||
fun NavController.navigateToLogin() { | ||
navigate(AuthScreens.LoginScreen.route) | ||
} |
9 changes: 9 additions & 0 deletions
9
feature/auth/src/main/java/com/mifos/feature/auth/navigation/AuthScreens.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,9 @@ | ||
package com.mifos.feature.auth.navigation | ||
|
||
sealed class AuthScreens(val route: String) { | ||
|
||
data object LoginScreenRoute : AuthScreens("login_screen_route") | ||
|
||
data object LoginScreen : AuthScreens("login_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
89 changes: 89 additions & 0 deletions
89
...ava/com/mifos/feature/individual_collection_sheet/navigation/CollectionSheetNavigation.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,89 @@ | ||
package com.mifos.feature.individual_collection_sheet.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.network.model.IndividualCollectionSheetPayload | ||
import com.mifos.core.objects.accounts.loan.PaymentTypeOptions | ||
import com.mifos.core.objects.collectionsheet.IndividualCollectionSheet | ||
import com.mifos.core.objects.collectionsheet.LoanAndClientName | ||
import com.mifos.feature.individual_collection_sheet.generate_collection_sheet.GenerateCollectionSheetScreen | ||
import com.mifos.feature.individual_collection_sheet.individual_collection_sheet.ui.IndividualCollectionSheetScreen | ||
import com.mifos.feature.individual_collection_sheet.individual_collection_sheet_details.IndividualCollectionSheetDetailsScreen | ||
|
||
/** | ||
* Created by Pronay Sarker on 20/08/2024 (4:06 PM) | ||
*/ | ||
fun NavGraphBuilder.individualCollectionSheetNavGraph( | ||
navController: NavController, | ||
onBackPressed: () -> Unit, | ||
navigateToPaymentDetails: (Int, IndividualCollectionSheetPayload, List<String>, LoanAndClientName, List<PaymentTypeOptions>, Int) -> Unit | ||
) { | ||
navigation( | ||
route = "generate_collection_sheet", | ||
startDestination = CollectionSheetScreens.IndividualCollectionSheetScreen.route | ||
) { | ||
individualCollectionSheetScreen( | ||
onBackPressed = onBackPressed, | ||
onDetail = { _, sheet -> navController.navigateToIndividualCollectionSheetDetailScreen(sheet) } | ||
) | ||
|
||
individualCollectionSheetDetailScreen( | ||
onBackPressed = onBackPressed, | ||
submit = navigateToPaymentDetails | ||
) | ||
} | ||
} | ||
|
||
private fun NavGraphBuilder.individualCollectionSheetScreen( | ||
onBackPressed: () -> Unit, | ||
onDetail: (String, IndividualCollectionSheet) -> Unit | ||
) { | ||
composable( | ||
route = CollectionSheetScreens.IndividualCollectionSheetScreen.route | ||
) { | ||
IndividualCollectionSheetScreen( | ||
onBackPressed = onBackPressed, | ||
onDetail = onDetail | ||
) | ||
} | ||
} | ||
|
||
private fun NavGraphBuilder.individualCollectionSheetDetailScreen( | ||
onBackPressed: () -> Unit, | ||
submit: (Int, IndividualCollectionSheetPayload, List<String>, LoanAndClientName, List<PaymentTypeOptions>, Int) -> Unit | ||
) { | ||
composable( | ||
route = CollectionSheetScreens.IndividualCollectionSheetDetailScreen.route, | ||
arguments = listOf( | ||
navArgument(name = Constants.INDIVIDUAL_SHEET, builder = { NavType.StringType }) | ||
) | ||
) { | ||
IndividualCollectionSheetDetailsScreen( | ||
onBackPressed = onBackPressed, | ||
submit = submit | ||
) | ||
} | ||
} | ||
|
||
fun NavGraphBuilder.generateCollectionSheetScreen( | ||
onBackPressed: () -> Unit | ||
) { | ||
composable(CollectionSheetScreens.GenerateCollectionSheetScreen.route) { | ||
GenerateCollectionSheetScreen( | ||
onBackPressed = onBackPressed | ||
) | ||
} | ||
} | ||
|
||
fun NavController.navigateToIndividualCollectionSheetDetailScreen(sheet: IndividualCollectionSheet) { | ||
navigate(CollectionSheetScreens.IndividualCollectionSheetDetailScreen.argument(sheet)) | ||
} | ||
|
||
fun NavController.navigateToIndividualCollectionSheet() { | ||
navigate(CollectionSheetScreens.IndividualCollectionSheetScreen.route) | ||
} |
Oops, something went wrong.