MoviesApp
MoviesApp copied to clipboard
Implement Hilt
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
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.
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 😁
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.