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.
feat: Implemented compose navigation in activate module (openMF#2195)
* implemented compose navigation in activateModule * MIFOSAC-260 implemented compose navigation in document module (openMF#2193) * MIFOSAC-258: compose navigation in activate module
- Loading branch information
Showing
7 changed files
with
65 additions
and
10 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
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" | ||
} | ||
} |
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