Skip to content

Instantly share code, notes, and snippets.

@remcomokveld
Last active April 14, 2019 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remcomokveld/5a7e6961d9d8d1b2e7037c5f95475018 to your computer and use it in GitHub Desktop.
Save remcomokveld/5a7e6961d9d8d1b2e7037c5f95475018 to your computer and use it in GitHub Desktop.
import dagger.android.support.DaggerFragment
class MyFragment: DaggerFragment() {
@Inject lateinit var viewModel: MyViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
viewModel.liveData.observe(this) { button.isEnabled = it }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment