MoviesApp icon indicating copy to clipboard operation
MoviesApp copied to clipboard

Implement Hilt

Open naufalprakoso opened this issue 4 years ago • 3 comments

Overview

In the last few months, Google release Hilt. Hilt is a dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project. I think Hilt better than dagger, even though it's built with dagger2.

Links

  • https://developer.android.com/training/dependency-injection/hilt-android
  • https://developer.android.com/training/dependency-injection/hilt-jetpack
  • https://www.youtube.com/watch?v=B56oV3IHMxg

naufalprakoso avatar Aug 14 '20 09:08 naufalprakoso

Hi thanks a lot for your contribution, but I would NOT do this in the master branch if you do it in a different branch it would be great.

Mustafashahoud avatar Aug 23 '20 09:08 Mustafashahoud

Thank you for your feedback. It's okay to merge this contribution to other branch, as long as it can benefit many people. Maybe you can create a new branch for this contribution. Thanks 😁

naufalprakoso avatar Aug 23 '20 12:08 naufalprakoso

Hi, I've reviewed the changes, Most of the UI tests are failing due to: java.lang.RuntimeException: java.lang.IllegalStateException: Hilt Fragments must be attached to an @AndroidEntryPoint Activity. Found: class androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity you can see in Hitl Doc that Hilt does not currently support FragmentScenario, however there is still a workaround.

Mustafashahoud avatar Aug 25 '20 20:08 Mustafashahoud