Created
July 6, 2020 04:57
-
-
Save huan-nguyen/779b67d46fa7059f500d1a8aeabc7e77 to your computer and use it in GitHub Desktop.
Revisions
-
huan-nguyen created this gist
Jul 6, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ /** This is only pseudo code to illustrate the process of locating Navigator to handle the navigation to a particular destination. It is not the real code in Navigation Component. */ fun NavController.navigate(@IdRes destinationResId: Int) { val destination = navGraph.getDestination(destinationResId) val navigator = navigatorProvider.getNavigator(destination.navigatorName) navigator.navigate(destination) }