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.
Implemented navigation in home destination modules (openMF#2184)
implement navigation in module implement navigation to home screens
- Loading branch information
Showing
18 changed files
with
545 additions
and
212 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
feature/about/src/main/java/com/mifos/feature/about/navigation/AccountNavigation.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,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 | ||
) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
feature/center/src/main/java/com/mifos/feature/center/navigation/CenterListNavigation.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.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 = { } | ||
) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
.../main/java/com/mifos/feature/checker_inbox_task/navigation/CheckerInboxTasksNavigation.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,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 = {} | ||
) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
feature/client/src/main/java/com/mifos/feature/client/navigation/ClientListNavigation.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.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 = { } | ||
) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...mifos/feature/individual_collection_sheet/navigation/GenerateCollectionSheetNavigation.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,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 | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...fos/feature/individual_collection_sheet/navigation/IndividualCollectionSheetNavigation.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,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 = { _, _ -> } | ||
) | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
feature/groups/src/main/java/com/mifos/feature/groups/navigation/GroupListNavigation.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,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<Group>) -> Unit, | ||
) { | ||
composable(GROUP_LIST_SCREEN_ROUTE) { | ||
GroupsListRoute( | ||
paddingValues = paddingValues, | ||
onAddGroupClick = onAddGroupClick, | ||
onGroupClick = onGroupClick, | ||
onSyncClick = onSyncClick | ||
) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...acking/src/main/java/com/mifos/feature/path_tracking/navigation/PathTrackingNavigation.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,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 = {} | ||
) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
feature/report/src/main/java/com/mifos/feature/report/navigation/RunReportsNavigation.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,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 = {} | ||
) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
feature/search/src/main/java/com/mifos/feature/search/Navigation/SearchNavigation.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,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 = { | ||
|
||
}, | ||
) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
feature/settings/src/main/java/com/mifos/feature/settings/navigation/SettingsNavigation.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,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 = { } | ||
) | ||
} | ||
} |
Oops, something went wrong.