google-developer-training / advanced-android-kotlin-login-navigation

Other
46 stars 33 forks source link

Advanced Android in Kotlin: Login 6.2 [Step #][description] #5

Open shalperin opened 4 years ago

shalperin commented 4 years ago

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

holecekp commented 3 years ago

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 :-(