android-jetpack-navigation

How to use NavigationExtensions.kt in a Java project?

萝らか妹 提交于 2020-08-08 19:03:42
问题 I'm trying to implement NavController with BottomNavigation in a new project. This is my first attempt and there is a lot of ambiguous information all over the place about this. So my question relates to each Bottom tab having its own back stack and persisting the fragments between bottom navigation taps. Yes, I have looked at https://github.com/android/architecture-components-samples/tree/master/NavigationAdvancedSample and I'm unable to understand how to integrate this with my existing Java

Android Navigation Component: Start at a different destination than home, programmatically?

非 Y 不嫁゛ 提交于 2020-08-02 19:00:13
问题 I'm trying to implement a multiple navigation controller with multiple back stack BottomNavigationView , as per the github examples. However, the example uses a different nav graph for each tab, which makes things easy. In my case I need to use the same nav graph for all of my tabs, but with different start destinations, than the "home destination" set in the nav graph. So far I've managed to modify the NavigationExtensions file in order to achieve the single navgraph for all tabs, and I get

Android Navigation Component: Start at a different destination than home, programmatically?

天涯浪子 提交于 2020-08-02 18:59:35
问题 I'm trying to implement a multiple navigation controller with multiple back stack BottomNavigationView , as per the github examples. However, the example uses a different nav graph for each tab, which makes things easy. In my case I need to use the same nav graph for all of my tabs, but with different start destinations, than the "home destination" set in the nav graph. So far I've managed to modify the NavigationExtensions file in order to achieve the single navgraph for all tabs, and I get

Android Navigation Component: Start at a different destination than home, programmatically?

五迷三道 提交于 2020-08-02 18:57:09
问题 I'm trying to implement a multiple navigation controller with multiple back stack BottomNavigationView , as per the github examples. However, the example uses a different nav graph for each tab, which makes things easy. In my case I need to use the same nav graph for all of my tabs, but with different start destinations, than the "home destination" set in the nav graph. So far I've managed to modify the NavigationExtensions file in order to achieve the single navgraph for all tabs, and I get

Android Espresso does not have a NavController set Error

[亡魂溺海] 提交于 2020-07-23 06:52:16
问题 I am trying to test a fragment in my navigation architecture and my test is as follows: test.kt @RunWith(AndroidJUnit4::class) @MediumTest internal class AddingAccountTest{ @get:Rule var activityRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java) @Before fun loadCorrespondingFragment(){ } @Test fun checkThatAllFieldsInFormAreEmpty(){ // Create a TestNavHostController val navController = TestNavHostController(ApplicationProvider.getApplicationContext())