-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from thomaskioko/kotlin-inject-anvil
Kotlin-inject-anvil Integration.
- Loading branch information
Showing
171 changed files
with
704 additions
and
889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
android/app/src/main/kotlin/com/thomaskioko/tvmaniac/initializers/AppInitializers.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
android/app/src/main/kotlin/com/thomaskioko/tvmaniac/inject/ApplicationComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package com.thomaskioko.tvmaniac.inject | ||
|
||
import android.app.Application | ||
import com.thomaskioko.tvmaniac.core.base.annotations.ApplicationScope | ||
import com.thomaskioko.tvmaniac.initializers.AppInitializers | ||
import com.thomaskioko.tvmaniac.shared.SharedComponent | ||
import com.thomaskioko.tvmaniac.traktauth.implementation.TraktAuthComponent | ||
import me.tatarka.inject.annotations.Component | ||
import me.tatarka.inject.annotations.Provides | ||
import software.amazon.lastmile.kotlin.inject.anvil.AppScope | ||
import software.amazon.lastmile.kotlin.inject.anvil.MergeComponent | ||
import software.amazon.lastmile.kotlin.inject.anvil.SingleIn | ||
|
||
@Component | ||
@ApplicationScope | ||
@MergeComponent(AppScope::class) | ||
@SingleIn(AppScope::class) | ||
abstract class ApplicationComponent( | ||
@get:Provides val application: Application, | ||
) : SharedComponent(), TraktAuthComponent { | ||
) : ActivityComponent.Factory { | ||
abstract val initializers: AppInitializers | ||
abstract val activityComponentFactory: ActivityComponent.Factory | ||
|
||
companion object | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 4 additions & 13 deletions
17
...ko/tvmaniac/core/base/di/BaseComponent.kt → ...niac/core/base/di/BaseAndroidComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 17 additions & 1 deletion
18
core/base/src/commonMain/kotlin/com/thomaskioko/tvmaniac/core/base/di/BaseComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
package com.thomaskioko.tvmaniac.core.base.di | ||
|
||
expect interface BaseComponent | ||
import com.thomaskioko.tvmaniac.core.base.model.AppCoroutineDispatchers | ||
import kotlinx.coroutines.Dispatchers | ||
import me.tatarka.inject.annotations.Provides | ||
import software.amazon.lastmile.kotlin.inject.anvil.AppScope | ||
import software.amazon.lastmile.kotlin.inject.anvil.ContributesTo | ||
|
||
@ContributesTo(AppScope::class) | ||
interface BaseComponent { | ||
|
||
@Provides | ||
fun provideCoroutineDispatchers(): AppCoroutineDispatchers = | ||
AppCoroutineDispatchers( | ||
io = Dispatchers.Default, | ||
computation = Dispatchers.Default, | ||
main = Dispatchers.Main, | ||
) | ||
} |
17 changes: 4 additions & 13 deletions
17
...ko/tvmaniac/core/base/di/BaseComponent.kt → ...tvmaniac/core/base/di/BaseIosComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
core/base/src/jvmMain/kotlin/com/thomaskioko/tvmaniac/core/base/di/BaseComponent.jvm.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.