diff --git a/feature/about/src/main/java/com/mifos/feature/about/navigation/AccountNavigation.kt b/feature/about/src/main/java/com/mifos/feature/about/navigation/AccountNavigation.kt new file mode 100644 index 00000000000..8ac6aee61ce --- /dev/null +++ b/feature/about/src/main/java/com/mifos/feature/about/navigation/AccountNavigation.kt @@ -0,0 +1,25 @@ +package com.mifos.feature.about.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.about.AboutScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:56 AM) + */ +const val ABOUT_SCREEN_ROUTE = "about_screen_route" + +fun NavController.navigateToAboutScreen() { + this.navigate(ABOUT_SCREEN_ROUTE) +} + +fun NavGraphBuilder.aboutScreen( + onBackPressed: () -> Unit +) { + composable(ABOUT_SCREEN_ROUTE) { + AboutScreen( + onBackPressed = onBackPressed + ) + } +} \ No newline at end of file diff --git a/feature/center/src/main/java/com/mifos/feature/center/navigation/CenterListNavigation.kt b/feature/center/src/main/java/com/mifos/feature/center/navigation/CenterListNavigation.kt new file mode 100644 index 00000000000..bdf8f5c9b06 --- /dev/null +++ b/feature/center/src/main/java/com/mifos/feature/center/navigation/CenterListNavigation.kt @@ -0,0 +1,32 @@ +package com.mifos.feature.center.navigation + +import androidx.compose.foundation.layout.PaddingValues +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.center.center_list.ui.CenterListScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (6:55 AM) + */ +const val CENTER_LIST_SCREEN_ROUTE = "center_list_route" + +fun NavController.navigateToCenterList() { + this.navigate(CENTER_LIST_SCREEN_ROUTE) +} + +fun NavGraphBuilder.centerListScreen( + paddingValues: PaddingValues, + createNewCenter: () -> Unit, + syncClicked: () -> Unit, + onCenterSelect: () -> Unit +) { + composable(CENTER_LIST_SCREEN_ROUTE) { + CenterListScreen( + paddingValues = paddingValues, + createNewCenter = { /*TODO*/ }, + syncClicked = { }, + onCenterSelect = { } + ) + } +} \ No newline at end of file diff --git a/feature/checker-inbox-task/src/main/java/com/mifos/feature/checker_inbox_task/navigation/CheckerInboxTasksNavigation.kt b/feature/checker-inbox-task/src/main/java/com/mifos/feature/checker_inbox_task/navigation/CheckerInboxTasksNavigation.kt new file mode 100644 index 00000000000..a9a311d3440 --- /dev/null +++ b/feature/checker-inbox-task/src/main/java/com/mifos/feature/checker_inbox_task/navigation/CheckerInboxTasksNavigation.kt @@ -0,0 +1,26 @@ +package com.mifos.feature.checker_inbox_task.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui.CheckerInboxTasksScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:59 AM) + */ +const val CHECKER_INBOX_TASK_SCREEN_ROUTE = "checker_inbox_task_screen_route" + +fun NavController.navigateToCheckerInboxTaskScreen() { + this.navigate(CHECKER_INBOX_TASK_SCREEN_ROUTE) +} + +fun NavGraphBuilder.checkerInboxTasksScreen( + onBackPressed: () -> Unit, +){ + composable(CHECKER_INBOX_TASK_SCREEN_ROUTE) { + CheckerInboxTasksScreen( + onBackPressed = onBackPressed, + checkerInbox = {} + ) + } +} \ No newline at end of file diff --git a/feature/client/src/main/java/com/mifos/feature/client/navigation/ClientListNavigation.kt b/feature/client/src/main/java/com/mifos/feature/client/navigation/ClientListNavigation.kt new file mode 100644 index 00000000000..5e933c964f8 --- /dev/null +++ b/feature/client/src/main/java/com/mifos/feature/client/navigation/ClientListNavigation.kt @@ -0,0 +1,32 @@ +package com.mifos.feature.client.navigation + +import androidx.compose.foundation.layout.PaddingValues +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.client.clientList.presentation.ClientListScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (6:47 AM) + */ +const val CLIENT_LIST_SCREEN_ROUTE = "client_list_screen" + +fun NavController.navigateToClientListScreen() { + this.navigate(CLIENT_LIST_SCREEN_ROUTE) +} + +fun NavGraphBuilder.clientListScreen( + paddingValues: PaddingValues, + createNewClient : () -> Unit, + syncClicked : () -> Unit, + onClientSelect : () -> Unit +) { + composable(CLIENT_LIST_SCREEN_ROUTE) { + ClientListScreen( + paddingValues = paddingValues, + createNewClient = { }, + syncClicked = { }, + onClientSelect = { } + ) + } +} \ No newline at end of file diff --git a/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/GenerateCollectionSheetNavigation.kt b/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/GenerateCollectionSheetNavigation.kt new file mode 100644 index 00000000000..4d43e9c23f4 --- /dev/null +++ b/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/GenerateCollectionSheetNavigation.kt @@ -0,0 +1,25 @@ +package com.mifos.feature.individual_collection_sheet.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.individual_collection_sheet.generate_collection_sheet.GenerateCollectionSheetScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:30 AM) + */ +const val GENERATE_COLLECTION_SHEET_SCREEN_ROUTE = "generate_collection_sheet_route" + +fun NavController.navigateToGenerateCollectionSheet() { + this.navigate(GENERATE_COLLECTION_SHEET_SCREEN_ROUTE) +} + +fun NavGraphBuilder.generateCollectionSheetScreen( + onBackPressed: () -> Unit +){ + composable(GENERATE_COLLECTION_SHEET_SCREEN_ROUTE) { + GenerateCollectionSheetScreen ( + onBackPressed = onBackPressed + ) + } +} \ No newline at end of file diff --git a/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/IndividualCollectionSheetNavigation.kt b/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/IndividualCollectionSheetNavigation.kt new file mode 100644 index 00000000000..e3fe4293924 --- /dev/null +++ b/feature/collection-sheet/src/main/java/com/mifos/feature/individual_collection_sheet/navigation/IndividualCollectionSheetNavigation.kt @@ -0,0 +1,28 @@ +package com.mifos.feature.individual_collection_sheet.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.core.objects.collectionsheet.IndividualCollectionSheet +import com.mifos.feature.individual_collection_sheet.individual_collection_sheet.ui.IndividualCollectionSheetScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:24 AM) + */ +const val INDIVIDUAL_COLLECTION_SHEET_SCREEN_ROUTE = "individual_collection_sheet_route" + +fun NavController.navigateToIndividualCollectionSheet() { + this.navigate(INDIVIDUAL_COLLECTION_SHEET_SCREEN_ROUTE) +} + +fun NavGraphBuilder.individualCollectionSheetScreen( + onBackClicked: () -> Unit, + onDetail: (String, IndividualCollectionSheet) -> Unit, +){ + composable(INDIVIDUAL_COLLECTION_SHEET_SCREEN_ROUTE) { + IndividualCollectionSheetScreen( + onBackPressed = {}, + onDetail = { _, _ -> } + ) + } +} \ No newline at end of file diff --git a/feature/groups/src/main/java/com/mifos/feature/groups/group_details/GroupDetailsScreen.kt b/feature/groups/src/main/java/com/mifos/feature/groups/group_details/GroupDetailsScreen.kt index 6b0c8afa761..9e52fb226ac 100644 --- a/feature/groups/src/main/java/com/mifos/feature/groups/group_details/GroupDetailsScreen.kt +++ b/feature/groups/src/main/java/com/mifos/feature/groups/group_details/GroupDetailsScreen.kt @@ -92,7 +92,6 @@ fun GroupDetailsScreen( savingsAccountSelected: (Int, DepositType) -> Unit, activateGroup: (Int) -> Unit ) { - val viewModel: GroupDetailsViewModel = hiltViewModel() val state by viewModel.groupDetailsUiState.collectAsStateWithLifecycle() val loanAccounts by viewModel.loanAccount.collectAsStateWithLifecycle() diff --git a/feature/groups/src/main/java/com/mifos/feature/groups/navigation/GroupListNavigation.kt b/feature/groups/src/main/java/com/mifos/feature/groups/navigation/GroupListNavigation.kt new file mode 100644 index 00000000000..ae2a5cfb105 --- /dev/null +++ b/feature/groups/src/main/java/com/mifos/feature/groups/navigation/GroupListNavigation.kt @@ -0,0 +1,33 @@ +package com.mifos.feature.groups.navigation + +import androidx.compose.foundation.layout.PaddingValues +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.core.objects.group.Group +import com.mifos.feature.groups.group_list.GroupsListRoute + +/** + * Created by Pronay Sarker on 10/08/2024 (6:07 AM) + */ +const val GROUP_LIST_SCREEN_ROUTE = "group_list_route" + +fun NavController.navigateToGroupList() { + this.navigate(GROUP_LIST_SCREEN_ROUTE) +} + +fun NavGraphBuilder.groupListScreen( + paddingValues: PaddingValues, + onAddGroupClick: () -> Unit, + onGroupClick: (Group) -> Unit, + onSyncClick: (List) -> Unit, +) { + composable(GROUP_LIST_SCREEN_ROUTE) { + GroupsListRoute( + paddingValues = paddingValues, + onAddGroupClick = onAddGroupClick, + onGroupClick = onGroupClick, + onSyncClick = onSyncClick + ) + } +} diff --git a/feature/path-tracking/src/main/java/com/mifos/feature/path_tracking/navigation/PathTrackingNavigation.kt b/feature/path-tracking/src/main/java/com/mifos/feature/path_tracking/navigation/PathTrackingNavigation.kt new file mode 100644 index 00000000000..8074b4e8394 --- /dev/null +++ b/feature/path-tracking/src/main/java/com/mifos/feature/path_tracking/navigation/PathTrackingNavigation.kt @@ -0,0 +1,26 @@ +package com.mifos.feature.path_tracking.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.path_tracking.PathTrackingScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:35 AM) + */ +const val PATH_TRACKING_SCREEN_ROUTE = "path_tracking_route" + +fun NavController.navigateToPathTrackingScreen() { + this.navigate(PATH_TRACKING_SCREEN_ROUTE) +} + +fun NavGraphBuilder.pathTrackingScreen( + onBackPressed: () -> Unit +) { + composable(PATH_TRACKING_SCREEN_ROUTE) { + PathTrackingScreen( + onBackPressed = onBackPressed, + onPathTrackingClick = {} + ) + } +} \ No newline at end of file diff --git a/feature/report/src/main/java/com/mifos/feature/report/navigation/RunReportsNavigation.kt b/feature/report/src/main/java/com/mifos/feature/report/navigation/RunReportsNavigation.kt new file mode 100644 index 00000000000..59434bd2aa0 --- /dev/null +++ b/feature/report/src/main/java/com/mifos/feature/report/navigation/RunReportsNavigation.kt @@ -0,0 +1,27 @@ +package com.mifos.feature.report.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.report.run_report.RunReportScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:32 AM) + */ +const val RUN_REPORTS_SCREEN_ROUTE = "run_reports_route" + +fun NavController.navigateToRunReports() { + this.navigate(RUN_REPORTS_SCREEN_ROUTE) +} + +fun NavGraphBuilder.runReportsScreen( + onReportClick: () -> Unit, + onBackPressed: () -> Unit +) { + composable(RUN_REPORTS_SCREEN_ROUTE) { + RunReportScreen( + onBackPressed = {}, + onReportClick = {} + ) + } +} \ No newline at end of file diff --git a/feature/search/src/main/java/com/mifos/feature/search/Navigation/SearchNavigation.kt b/feature/search/src/main/java/com/mifos/feature/search/Navigation/SearchNavigation.kt new file mode 100644 index 00000000000..f80f70344a8 --- /dev/null +++ b/feature/search/src/main/java/com/mifos/feature/search/Navigation/SearchNavigation.kt @@ -0,0 +1,40 @@ +package com.mifos.feature.search.Navigation + +import androidx.compose.ui.Modifier +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.core.ui.components.FabType +import com.mifos.feature.search.SearchScreenRoute + +/** + * Created by Pronay Sarker on 10/08/2024 (6:35 AM) + */ +const val SEARCH_SCREEN_ROUTE = "search_screen" + +fun NavController.navigateToSearchScreen() { + this.navigate(SEARCH_SCREEN_ROUTE) +} + +fun NavGraphBuilder.searchScreen( + modifier: Modifier = Modifier, + centerListScreen: () -> Unit, + groupListScreen: () -> Unit, + clientListScreen: () -> Unit, +) { + composable(SEARCH_SCREEN_ROUTE) { + SearchScreenRoute( + modifier = Modifier, + onFabClick = { fabOptions -> + when(fabOptions){ + FabType.CLIENT -> TODO() + FabType.CENTER -> TODO() + FabType.GROUP -> TODO() + } + }, + onSearchOptionClick = { + + }, + ) + } +} \ No newline at end of file diff --git a/feature/settings/src/main/java/com/mifos/feature/settings/navigation/SettingsNavigation.kt b/feature/settings/src/main/java/com/mifos/feature/settings/navigation/SettingsNavigation.kt new file mode 100644 index 00000000000..26bfb012ce4 --- /dev/null +++ b/feature/settings/src/main/java/com/mifos/feature/settings/navigation/SettingsNavigation.kt @@ -0,0 +1,33 @@ +package com.mifos.feature.settings.navigation + +import androidx.navigation.NavController +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.mifos.feature.settings.settings.SettingsScreen + +/** + * Created by Pronay Sarker on 10/08/2024 (7:52 AM) + */ +const val SETTINGS_SCREEN_ROUTE = "settings_screen_route" + +fun NavController.navigateToSettingsScreen() { + this.navigate(SETTINGS_SCREEN_ROUTE) +} + +fun NavGraphBuilder.settingsScreen( + navigateBack: () -> Unit, + navigateToLoginScreen: () -> Unit, + changePasscode: (String) -> Unit, + languageChanged: () -> Unit, + serverConfig: () -> Unit +) { + composable(SETTINGS_SCREEN_ROUTE) { + SettingsScreen( + onBackPressed = navigateBack, + navigateToLoginScreen = navigateToLoginScreen, + languageChanged = languageChanged, + serverConfig = serverConfig, + changePasscode = { } + ) + } +} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientApp.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientApp.kt index 5b4d0316e46..0c856fc0f6c 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientApp.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/AndroidClientApp.kt @@ -70,14 +70,14 @@ fun AndroidClientApp() { val navigationDrawerTabs = remember { listOf( - Screens.CheckerInboxAndTasksScreen, - Screens.IndividualCollectionSheetScreen, - Screens.CollectionSheetScreen, - Screens.RunReportsScreen, - Screens.PathTrackerScreen, - Screens.SettingsScreen, - Screens.AboutScreen, - Screens.OfflineSyncScreen + HomeDestinationsScreen.CheckerInboxAndTasksScreen, + HomeDestinationsScreen.IndividualCollectionSheetScreen, + HomeDestinationsScreen.CollectionSheetScreen, + HomeDestinationsScreen.RunReportsScreen, + HomeDestinationsScreen.PathTrackerScreen, + HomeDestinationsScreen.SettingsScreen, + HomeDestinationsScreen.AboutScreen, + HomeDestinationsScreen.OfflineSyncScreen ) } @@ -157,7 +157,7 @@ fun AndroidClientApp() { restoreState = true launchSingleTop = true graph.startDestinationRoute?.let { - popUpTo(route = Screens.SearchScreen.route) { + popUpTo(route = HomeDestinationsScreen.SearchScreen.route) { saveState = true } } @@ -230,7 +230,7 @@ fun AndroidClientApp() { restoreState = true launchSingleTop = true graph.startDestinationRoute?.let { - popUpTo(route = Screens.SearchScreen.route) { + popUpTo(route = HomeDestinationsScreen.SearchScreen.route) { saveState = true } } @@ -245,5 +245,4 @@ fun AndroidClientApp() { Navigation(navController = navController, padding = paddingValues) } } - } \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt new file mode 100644 index 00000000000..1faecdabd11 --- /dev/null +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/HomeDestinationsScreen.kt @@ -0,0 +1,104 @@ +package com.mifos.mifosxdroid + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.Assignment +import androidx.compose.material.icons.rounded.Business +import androidx.compose.material.icons.rounded.CheckBox +import androidx.compose.material.icons.rounded.Dashboard +import androidx.compose.material.icons.rounded.Group +import androidx.compose.material.icons.rounded.Info +import androidx.compose.material.icons.rounded.Person +import androidx.compose.material.icons.rounded.PersonPinCircle +import androidx.compose.material.icons.rounded.PowerSettingsNew +import androidx.compose.material.icons.rounded.Settings +import androidx.compose.material.icons.rounded.Task +import androidx.compose.ui.graphics.vector.ImageVector +import com.mifos.feature.about.navigation.ABOUT_SCREEN_ROUTE +import com.mifos.feature.center.navigation.CENTER_LIST_SCREEN_ROUTE +import com.mifos.feature.checker_inbox_task.navigation.CHECKER_INBOX_TASK_SCREEN_ROUTE +import com.mifos.feature.client.navigation.CLIENT_LIST_SCREEN_ROUTE +import com.mifos.feature.groups.navigation.GROUP_LIST_SCREEN_ROUTE +import com.mifos.feature.individual_collection_sheet.navigation.GENERATE_COLLECTION_SHEET_SCREEN_ROUTE +import com.mifos.feature.individual_collection_sheet.navigation.INDIVIDUAL_COLLECTION_SHEET_SCREEN_ROUTE +import com.mifos.feature.path_tracking.navigation.PATH_TRACKING_SCREEN_ROUTE +import com.mifos.feature.report.navigation.RUN_REPORTS_SCREEN_ROUTE +import com.mifos.feature.search.Navigation.SEARCH_SCREEN_ROUTE +import com.mifos.feature.settings.navigation.SETTINGS_SCREEN_ROUTE + +sealed class HomeDestinationsScreen( + val title: String = "", + val route: String, + val icon: ImageVector? = null, +) { + data object SearchScreen : HomeDestinationsScreen( + title = "Search", + route = SEARCH_SCREEN_ROUTE, + icon = Icons.Rounded.Dashboard + ) + + data object ClientListScreen : HomeDestinationsScreen( + title = "Clients", + route = CLIENT_LIST_SCREEN_ROUTE, + icon = Icons.Rounded.Person + ) + + data object CenterListScreen : HomeDestinationsScreen( + title = "Centers", + route = CENTER_LIST_SCREEN_ROUTE, + icon = Icons.Rounded.Business + ) + + data object GroupListScreen : HomeDestinationsScreen( + title = "Groups", + route = GROUP_LIST_SCREEN_ROUTE, + icon = Icons.Rounded.Group + ) + + data object CheckerInboxAndTasksScreen : HomeDestinationsScreen( + title = "Checker Inbox & Tasks", + route = CHECKER_INBOX_TASK_SCREEN_ROUTE, + icon = Icons.Rounded.CheckBox + ) + + data object IndividualCollectionSheetScreen : HomeDestinationsScreen( + title = "Individual Collection Sheet", + route = INDIVIDUAL_COLLECTION_SHEET_SCREEN_ROUTE, + icon = Icons.AutoMirrored.Rounded.Assignment + ) + + data object CollectionSheetScreen : HomeDestinationsScreen( + title = "Collection Sheet", + route = GENERATE_COLLECTION_SHEET_SCREEN_ROUTE, + icon = Icons.AutoMirrored.Rounded.Assignment + ) + + data object RunReportsScreen : HomeDestinationsScreen( + title = "Run Reports", + route = RUN_REPORTS_SCREEN_ROUTE, + icon = Icons.Rounded.Task + ) + + data object PathTrackerScreen : HomeDestinationsScreen( + title = "Path Tracker", + route = PATH_TRACKING_SCREEN_ROUTE, + icon = Icons.Rounded.PersonPinCircle + ) + + data object SettingsScreen : HomeDestinationsScreen( + title = "Settings", + route = SETTINGS_SCREEN_ROUTE, + icon = Icons.Rounded.Settings + ) + + data object AboutScreen : HomeDestinationsScreen( + title = "About", + route = ABOUT_SCREEN_ROUTE, + icon = Icons.Rounded.Info + ) + + data object OfflineSyncScreen : HomeDestinationsScreen( + title = "Offline Sync", + route = "offline_sync_screen", + icon = Icons.Rounded.PowerSettingsNew + ) +} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/Screens.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/Screens.kt deleted file mode 100644 index dc9c9726064..00000000000 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/Screens.kt +++ /dev/null @@ -1,94 +0,0 @@ -package com.mifos.mifosxdroid - -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.rounded.Assignment -import androidx.compose.material.icons.rounded.Business -import androidx.compose.material.icons.rounded.CheckBox -import androidx.compose.material.icons.rounded.Dashboard -import androidx.compose.material.icons.rounded.Group -import androidx.compose.material.icons.rounded.Info -import androidx.compose.material.icons.rounded.Person -import androidx.compose.material.icons.rounded.PersonPinCircle -import androidx.compose.material.icons.rounded.PowerSettingsNew -import androidx.compose.material.icons.rounded.Settings -import androidx.compose.material.icons.rounded.Task -import androidx.compose.ui.graphics.vector.ImageVector - -sealed class Screens( - val title: String = "", - val route: String, - val icon: ImageVector? = null, -) { - - data object SearchScreen : Screens( - title = "Search", - route = "search_screen", - icon = Icons.Rounded.Dashboard - ) - - data object ClientListScreen : Screens( - title = "Clients", - route = "client_list_screen", - icon = Icons.Rounded.Person - ) - - data object CenterListScreen : Screens( - title = "Centers", - route = "center_list_screen", - icon = Icons.Rounded.Business - ) - - data object GroupListScreen : Screens( - title = "Groups", - route = "group_list_screen", - icon = Icons.Rounded.Group - ) - - data object CheckerInboxAndTasksScreen : Screens( - title = "Checker Inbox & Tasks", - route = "checker_inbox_and_tasks_screen", - icon = Icons.Rounded.CheckBox - ) - - data object IndividualCollectionSheetScreen : Screens( - title = "Individual Collection Sheet", - route = "individual_collection_sheet_screen", - icon = Icons.AutoMirrored.Rounded.Assignment - ) - - data object CollectionSheetScreen : Screens( - title = "Collection Sheet", - route = "collection_sheet_screen", - icon = Icons.AutoMirrored.Rounded.Assignment - ) - - data object RunReportsScreen : Screens( - title = "Run Reports", - route = "run_reports_screen", - icon = Icons.Rounded.Task - ) - - data object PathTrackerScreen : Screens( - title = "Path Tracker", - route = "path_tracker_screen", - icon = Icons.Rounded.PersonPinCircle - ) - - data object SettingsScreen : Screens( - title = "Settings", - route = "settings_screen", - icon = Icons.Rounded.Settings - ) - - data object AboutScreen : Screens( - title = "About", - route = "about_screen", - icon = Icons.Rounded.Info - ) - - data object OfflineSyncScreen : Screens( - title = "Offline Sync", - route = "offline_sync_screen", - icon = Icons.Rounded.PowerSettingsNew - ) -} \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt index 893df659ebc..7a1b2178a17 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/MifosNavigationBar.kt @@ -9,7 +9,7 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp -import com.mifos.mifosxdroid.Screens +import com.mifos.mifosxdroid.HomeDestinationsScreen @Composable fun MifosNavigationBar( @@ -18,10 +18,10 @@ fun MifosNavigationBar( ) { val tabs = rememberSaveable { listOf( - Screens.SearchScreen, - Screens.ClientListScreen, - Screens.CenterListScreen, - Screens.GroupListScreen + HomeDestinationsScreen.SearchScreen, + HomeDestinationsScreen.ClientListScreen, + HomeDestinationsScreen.CenterListScreen, + HomeDestinationsScreen.GroupListScreen ) } diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt index 671434a7ab6..2de773deb3a 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/Navigation.kt @@ -6,103 +6,101 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost -import androidx.navigation.compose.composable -import com.mifos.feature.about.AboutScreen -import com.mifos.feature.center.center_list.ui.CenterListScreen -import com.mifos.feature.checker_inbox_task.checker_inbox_tasks.ui.CheckerInboxTasksScreen -import com.mifos.feature.client.clientList.presentation.ClientListScreen -import com.mifos.feature.groups.group_list.GroupsListRoute -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.path_tracking.PathTrackingScreen -import com.mifos.feature.report.run_report.RunReportScreen -import com.mifos.feature.search.SearchScreenRoute -import com.mifos.feature.settings.settings.SettingsScreen -import com.mifos.mifosxdroid.Screens +import com.mifos.feature.about.navigation.aboutScreen +import com.mifos.feature.center.navigation.centerListScreen +import com.mifos.feature.center.navigation.navigateToCenterList +import com.mifos.feature.checker_inbox_task.navigation.checkerInboxTasksScreen +import com.mifos.feature.client.navigation.clientListScreen +import com.mifos.feature.client.navigation.navigateToClientListScreen +import com.mifos.feature.groups.navigation.groupListScreen +import com.mifos.feature.groups.navigation.navigateToGroupList +import com.mifos.feature.individual_collection_sheet.navigation.generateCollectionSheetScreen +import com.mifos.feature.individual_collection_sheet.navigation.individualCollectionSheetScreen +import com.mifos.feature.path_tracking.navigation.pathTrackingScreen +import com.mifos.feature.report.navigation.runReportsScreen +import com.mifos.feature.search.Navigation.SEARCH_SCREEN_ROUTE +import com.mifos.feature.search.Navigation.searchScreen +import com.mifos.feature.settings.navigation.settingsScreen @Composable -fun Navigation(navController: NavHostController, padding: PaddingValues) { - - NavHost(navController = navController, startDestination = Screens.SearchScreen.route) { - composable(Screens.SearchScreen.route) { - SearchScreenRoute( - modifier = Modifier.padding(padding), - onFabClick = {}, - onSearchOptionClick = {} - ) - } - composable(Screens.ClientListScreen.route) { - ClientListScreen( - paddingValues = padding, - createNewClient = {}, - syncClicked = {}, - onClientSelect = {} - ) - } - composable(Screens.CenterListScreen.route) { - CenterListScreen( - paddingValues = padding, - createNewCenter = {}, - syncClicked = {}, - onCenterSelect = {} - ) - } - composable(Screens.GroupListScreen.route) { - GroupsListRoute( - paddingValues = padding, - onAddGroupClick = {}, - onGroupClick = {}, - onSyncClick = {} - ) - } - composable(Screens.CheckerInboxAndTasksScreen.route) { - CheckerInboxTasksScreen( - onBackPressed = {}, - checkerInbox = {} - ) - } - composable(Screens.IndividualCollectionSheetScreen.route) { - IndividualCollectionSheetScreen( - onBackPressed = {}, - onDetail = { String, IndividualCollectionSheet -> - - } - ) - } - composable(Screens.CollectionSheetScreen.route) { - GenerateCollectionSheetScreen( - onBackPressed = {} - ) - } - composable(Screens.RunReportsScreen.route) { - RunReportScreen( - onBackPressed = {}, - onReportClick = {} - ) - } - composable(Screens.PathTrackerScreen.route) { - PathTrackingScreen( - onBackPressed = {}, - onPathTrackingClick = {} - ) - } - composable(Screens.SettingsScreen.route) { - SettingsScreen( - onBackPressed = { }, - navigateToLoginScreen = { }, - changePasscode = {}, - languageChanged = { }, - serverConfig = {} - ) - } - composable(Screens.AboutScreen.route) { - AboutScreen( - onBackPressed = {} - ) - } - composable(Screens.OfflineSyncScreen.route) { - - } - } +fun Navigation( + navController: NavHostController, + padding: PaddingValues, + modifier: Modifier = Modifier, + startDestination: String = SEARCH_SCREEN_ROUTE +) { + NavHost( + navController = navController, + startDestination = startDestination, + modifier = modifier, + ) { + searchScreen( + modifier = Modifier.padding(padding), + centerListScreen = { navController.navigateToCenterList() }, + groupListScreen = { navController.navigateToGroupList() }, + clientListScreen = { navController.navigateToClientListScreen() } + ) + + clientListScreen( + paddingValues = padding, + createNewClient = {}, + syncClicked = {}, + onClientSelect = {} + ) + + centerListScreen( + paddingValues = padding, + createNewCenter = {}, + syncClicked = {}, + onCenterSelect = {} + ) + + groupListScreen( + paddingValues = padding, + onAddGroupClick = {}, + onGroupClick = { group -> + + }, + onSyncClick = { groupLists -> + + } + ) + + checkerInboxTasksScreen( + onBackPressed = { navController.popBackStack() }, + ) + + individualCollectionSheetScreen( + onBackClicked = { navController.popBackStack() }, + onDetail = { String, IndividualCollectionSheet -> + } + ) + + generateCollectionSheetScreen ( + onBackPressed = { navController.popBackStack() } + ) + + runReportsScreen( + onBackPressed = { navController.popBackStack() }, + onReportClick = { } + ) + + pathTrackingScreen( + onBackPressed = { navController.popBackStack() } + ) + + settingsScreen( + navigateBack = { navController.popBackStack() }, + navigateToLoginScreen = {}, + changePasscode = {}, + languageChanged = { }, + serverConfig = {} + ) + + aboutScreen ( + onBackPressed = { navController.popBackStack() } + ) + + } } \ No newline at end of file diff --git a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt index e6c024ae362..ee0f380b732 100644 --- a/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt +++ b/mifosng-android/src/main/java/com/mifos/mifosxdroid/components/NavigationConstants.kt @@ -1,14 +1,14 @@ package com.mifos.mifosxdroid.components -import com.mifos.mifosxdroid.Screens +import com.mifos.mifosxdroid.HomeDestinationsScreen object NavigationConstants { private val NavScreenRoutes = listOf( - Screens.SearchScreen.route, - Screens.ClientListScreen.route, - Screens.CenterListScreen.route, - Screens.GroupListScreen.route, + HomeDestinationsScreen.SearchScreen.route, + HomeDestinationsScreen.ClientListScreen.route, + HomeDestinationsScreen.CenterListScreen.route, + HomeDestinationsScreen.GroupListScreen.route, )