Skip to content

Commit

Permalink
examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed Dec 20, 2024
1 parent ad43516 commit 8806c99
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/androidx-samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
implementation "io.insert-koin:koin-core-coroutines"
implementation "io.insert-koin:koin-androidx-workmanager"
implementation "io.insert-koin:koin-androidx-navigation"
// implementation "io.insert-koin:koin-androidx-startup"
implementation "io.insert-koin:koin-androidx-startup"
testImplementation "io.insert-koin:koin-test-junit4"
testImplementation "io.insert-koin:koin-android-test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,28 @@ import org.koin.android.ext.koin.androidFileProperties
import org.koin.android.ext.koin.androidLogger
import org.koin.androidx.fragment.koin.fragmentFactory
import org.koin.androidx.workmanager.koin.workManagerFactory
import org.koin.androix.startup.KoinStartup
import org.koin.core.context.GlobalContext.startKoin
import org.koin.core.lazyModules
import org.koin.core.logger.Level
import org.koin.core.waitAllStartJobs
import org.koin.dsl.KoinConfiguration
import org.koin.dsl.koinConfiguration
import org.koin.mp.KoinPlatform
import org.koin.sample.sandbox.di.allModules


class MainApplication : Application() {
class MainApplication : Application(), KoinStartup {

override fun onKoinStartup() = koinConfiguration {
androidLogger(Level.DEBUG)
androidContext(this@MainApplication)
androidFileProperties()
fragmentFactory()
workManagerFactory()
// lazyModules(allModules, dispatcher = IO)
modules(allModules)
}

// override fun onKoinStartup() : KoinAppDeclaration = {
// androidLogger(Level.DEBUG)
Expand Down Expand Up @@ -55,15 +68,15 @@ class MainApplication : Application() {

startTime = System.currentTimeMillis()

startKoin {
androidLogger(Level.DEBUG)
androidContext(this@MainApplication)
androidFileProperties()
fragmentFactory()
workManagerFactory()
// lazyModules(allModules, dispatcher = IO)
modules(allModules)
}
// startKoin {
// androidLogger(Level.DEBUG)
// androidContext(this@MainApplication)
// androidFileProperties()
// fragmentFactory()
// workManagerFactory()
//// lazyModules(allModules, dispatcher = IO)
// modules(allModules)
// }

//TODO Load/Unload Koin modules scenario cases
cancelPendingWorkManager(this)
Expand Down
2 changes: 1 addition & 1 deletion examples/gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext {
// Kotlin
kotlin_version = '2.0.21'
// Koin Versions
koin_version = '4.0.1-RC1'
koin_version = '4.0.1-RC2'
koin_android_version = koin_version
koin_compose_version = koin_version

Expand Down

0 comments on commit 8806c99

Please sign in to comment.