Skip to content

Commit

Permalink
Allow AppScope -> ActivityScope -> FragmentScope dagger scope nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorvs committed Dec 4, 2021
1 parent d1288ae commit bfe4c5f
Show file tree
Hide file tree
Showing 24 changed files with 132 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.browser.rating.ui.AppEnjoymentDialogFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface AppEnjoymentDialogFragmentComponent : AndroidInjector<AppEnjoymentDial
interface Factory : AndroidInjector.Factory<AppEnjoymentDialogFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface AppEnjoymentDialogFragmentComponentProvider {
fun provideAppEnjoymentDialogFragmentComponentFactory(): AppEnjoymentDialogFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class AppEnjoymentDialogFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.feedback.ui.negative.brokensite.BrokenSiteNegativeFeedbackFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface BrokenSiteNegativeFeedbackFragmentComponent : AndroidInjector<BrokenSi
interface Factory : AndroidInjector.Factory<BrokenSiteNegativeFeedbackFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface BrokenSiteNegativeFeedbackFragmentComponentProvider {
fun provideBrokenSiteNegativeFeedbackFragmentComponentFactory(): BrokenSiteNegativeFeedbackFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class BrokenSiteNegativeFeedbackFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.browser.BrowserTabFragment
import com.duckduckgo.di.scopes.AppScope

import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -39,13 +38,13 @@ interface BrowserTabFragmentComponent : AndroidInjector<BrowserTabFragment> {
interface Factory : AndroidInjector.Factory<BrowserTabFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface BrowserTabFragmentComponentProvider {
fun provideBrowserTabFragmentComponentFactory(): BrowserTabFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class BrowserTabFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.onboarding.ui.page.DefaultBrowserPage
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface DefaultBrowserPageComponent : AndroidInjector<DefaultBrowserPage> {
interface Factory : AndroidInjector.Factory<DefaultBrowserPage>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface DefaultBrowserPageComponentProvider {
fun provideDefaultBrowserPageComponentFactory(): DefaultBrowserPageComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class DefaultBrowserPageBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.browser.DownloadConfirmationFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface DownloadConfirmationFragmentComponent : AndroidInjector<DownloadConfir
interface Factory : AndroidInjector.Factory<DownloadConfirmationFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface DownloadConfirmationFragmentComponentProvider {
fun provideDownloadConfirmationFragmentComponentFactory(): DownloadConfirmationFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class DownloadConfirmationFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.email.ui.EmailProtectionNotSupportedFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface EmailProtectionNotSupportedFragmentComponent : AndroidInjector<EmailPr
interface Factory : AndroidInjector.Factory<EmailProtectionNotSupportedFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface EmailProtectionNotSupportedFragmentComponentProvider {
fun provideEmailProtectionNotSupportedFragmentComponentFactory(): EmailProtectionNotSupportedFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class EmailProtectionNotSupportedFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.email.ui.EmailProtectionSignInFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface EmailProtectionSignInFragmentComponent : AndroidInjector<EmailProtecti
interface Factory : AndroidInjector.Factory<EmailProtectionSignInFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface EmailProtectionSignInFragmentComponentProvider {
fun provideEmailProtectionSignInFragmentComponentFactory(): EmailProtectionSignInFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class EmailProtectionSignInFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.email.ui.EmailProtectionSignOutFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface EmailProtectionSignOutFragmentComponent : AndroidInjector<EmailProtect
interface Factory : AndroidInjector.Factory<EmailProtectionSignOutFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface EmailProtectionSignOutFragmentComponentProvider {
fun provideEmailProtectionSignOutFragmentComponentFactory(): EmailProtectionSignOutFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class EmailProtectionSignOutFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.browser.rating.ui.GiveFeedbackDialogFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface GiveFeedbackDialogFragmentComponent : AndroidInjector<GiveFeedbackDial
interface Factory : AndroidInjector.Factory<GiveFeedbackDialogFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface GiveFeedbackDialogFragmentComponentProvider {
fun provideGiveFeedbackDialogFragmentComponentFactory(): GiveFeedbackDialogFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class GiveFeedbackDialogFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.feedback.ui.initial.InitialFeedbackFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface InitialFeedbackFragmentComponent : AndroidInjector<InitialFeedbackFrag
interface Factory : AndroidInjector.Factory<InitialFeedbackFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface InitialFeedbackFragmentComponentProvider {
fun provideInitialFeedbackFragmentComponentFactory(): InitialFeedbackFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class InitialFeedbackFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.feedback.ui.negative.mainreason.MainReasonNegativeFeedbackFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface MainReasonNegativeFeedbackFragmentComponent : AndroidInjector<MainReas
interface Factory : AndroidInjector.Factory<MainReasonNegativeFeedbackFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface MainReasonNegativeFeedbackFragmentComponentProvider {
fun provideMainReasonNegativeFeedbackFragmentComponentFactory(): MainReasonNegativeFeedbackFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class MainReasonNegativeFeedbackFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.feedback.ui.positive.initial.PositiveFeedbackLandingFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface PositiveFeedbackLandingFragmentComponent : AndroidInjector<PositiveFee
interface Factory : AndroidInjector.Factory<PositiveFeedbackLandingFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface PositiveFeedbackLandingFragmentComponentProvider {
fun providePositiveFeedbackLandingFragmentComponentFactory(): PositiveFeedbackLandingFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class PositiveFeedbackLandingFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.browser.rating.ui.RateAppDialogFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface RateAppDialogFragmentComponent : AndroidInjector<RateAppDialogFragment
interface Factory : AndroidInjector.Factory<RateAppDialogFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface RateAppDialogFragmentComponentProvider {
fun provideRateAppDialogFragmentComponentFactory(): RateAppDialogFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class RateAppDialogFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.feedback.ui.negative.openended.ShareOpenEndedFeedbackFragment
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface ShareOpenEndedFeedbackFragmentComponent : AndroidInjector<ShareOpenEnd
interface Factory : AndroidInjector.Factory<ShareOpenEndedFeedbackFragment>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface ShareOpenEndedFeedbackFragmentComponentProvider {
fun provideShareOpenEndedFeedbackFragmentComponentFactory(): ShareOpenEndedFeedbackFragmentComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class ShareOpenEndedFeedbackFragmentBindingModule {
@Binds
@IntoMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.app.di.component

import com.duckduckgo.app.location.ui.SiteLocationPermissionDialog
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.di.scopes.FragmentScope
import com.squareup.anvil.annotations.ContributesTo
import com.squareup.anvil.annotations.MergeSubcomponent
Expand All @@ -38,13 +38,13 @@ interface SiteLocationPermissionDialogComponent : AndroidInjector<SiteLocationPe
interface Factory : AndroidInjector.Factory<SiteLocationPermissionDialog>
}

@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
interface SiteLocationPermissionDialogComponentProvider {
fun provideSiteLocationPermissionDialogComponentFactory(): SiteLocationPermissionDialogComponent.Factory
}

@Module
@ContributesTo(AppScope::class)
@ContributesTo(ActivityScope::class)
abstract class SiteLocationPermissionDialogBindingModule {
@Binds
@IntoMap
Expand Down
Loading

0 comments on commit bfe4c5f

Please sign in to comment.