andrew
07/17/2022, 5:49 AM@Module
@InstallIn(SingletonComponent::class)
interface AccountsModule {
@Binds
@Singleton
fun bindsAccountService(accountsService: AccountsServiceImpl): AccountsService
}
Qualifiers obviously wouldn’t work here, since Binds looks for a specific implementation to return. Provides wouldn’t work, since it has no context of the actual implementation either. Is there any way around it?
For context:
:app:mobile -- implements --> :app:core
:app:wear -- implements --> :app:core
Where :app:core
would contain the interface and :app:target
would contain the impl. Authentication would be similar but mobile supports a full oauth flow into AccountManager
but wear supports a device based flow, or syncing tokens from the phone into AccountManager
, AccountService
would be the mediator. I’m thinking of ways to re-architecture this, but wondering if this is possible