Skip to content

Commit

Permalink
Use "root" NavController for navigation from MainFragment to Auth flow
Browse files Browse the repository at this point in the history
  • Loading branch information
PStrelchenko committed Aug 15, 2020
1 parent a56d211 commit 8954006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -3,7 +3,7 @@ package com.aaglobal.jnc_playground.ui.tabs.profile
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import androidx.navigation.Navigation
import com.aaglobal.jnc_playground.R
import kotlinx.android.synthetic.main.fragment_profile_container.*

Expand All @@ -14,7 +14,8 @@ class ProfileContainerFragment : Fragment(R.layout.fragment_profile_container) {
super.onViewCreated(view, savedInstanceState)

fragment_profile_container__button__open_auth_flow.setOnClickListener {
findNavController().navigate(R.id.action__MainFragment__to__AuthFlow)
Navigation.findNavController(requireActivity(), R.id.activity_root__fragment__nav_host)
.navigate(R.id.action__MainFragment__to__AuthFlow)
}
}

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/navigation/profile__nav_graph.xml
Expand Up @@ -10,6 +10,4 @@
android:name="com.aaglobal.jnc_playground.ui.tabs.profile.ProfileContainerFragment"
tools:layout="@layout/fragment_profile_container" />

<include app:graph="@navigation/app_nav_graph"/>

</navigation>

0 comments on commit 8954006

Please sign in to comment.