Skip to content

Commit

Permalink
Fix test app
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed Jan 8, 2025
1 parent 1294aaa commit 2c88d11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 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,7 +11,6 @@ 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
Expand All @@ -22,24 +21,15 @@ import org.koin.mp.KoinPlatform
import org.koin.sample.sandbox.di.allModules


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

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

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

Expand Down Expand Up @@ -68,20 +58,20 @@ class MainApplication : Application(), KoinStartup {

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)

KoinPlatform.getKoin().waitAllStartJobs()
// KoinPlatform.getKoin().waitAllStartJobs()
}
}

Expand Down

0 comments on commit 2c88d11

Please sign in to comment.