Introduction

This repo is try to find the different usage injection dependency between dagger and hilt. The been spilited by serveral test cases to let us know better about the detail of DI. Each Test case have a specific branch. All screenshots is from this slide

Test cases

Case 1 Use ActivityComponent to inject two activity(no scope)

Case 2 Test case 2. Use ActivityComponent to inject two activity (scope @PerActivity)

Case 3 Test case 3. Use AppComponent to inject two activity (no scope)

Case 4 Test case 4. Use AppComponent to inject two activity (scope @Singleton)

Case 4.1 Test case 4.1. Use AppComponent to inject two activity (scope @Singleton)

Case 5 (compare hilt usage Test case 5. Use @InstallIn(ActivityComponent::class) to inject two activity(no scope))

Case 5.1 Test case 5.1. Use @InstallIn(ActivityComponent::class) to inject two activity(@ActivityScope)