android-kotlin-login-navigation
android-kotlin-login-navigation copied to clipboard
Advanced Android in Kotlin: Login 6.2 [Step #][description]
Step 6 Code sample for MainFragment.kt reads:
binding.settingsBtn.setOnClickListener {
val action = MainFragmentDirections.actionMainFragmentToSettingsFragment()
findNavController().navigate(action)
}
MainFragmentDirections is not a thing in this project. Perhaps you mean:
findNavController().navigate(R.id.action_mainFragment_to_settingsFragment)
codelab: advanced-android-kotlin
Safe Args plugin is missing in the starter project and that is why MainFragmentDirections is not defined. You can modify build.gradle files to include the plugin (see also https://github.com/googlecodelabs/android-kotlin-login-navigation/issues/7). But your solution is even better and simpler.
It is sad that these codelabs are full of bugs which remains unfixed for months or years :-(