-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d930a99
commit 3b809a2
Showing
28 changed files
with
100 additions
and
239 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ kotlin { | |
jvm() | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ kotlin { | |
jvm() | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
|
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
25 changes: 0 additions & 25 deletions
25
core/platform/src/androidMain/kotlin/dev/androidbroadcast/news/core/KoinModules.android.kt
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/KoinModules.kt
This file was deleted.
Oops, something went wrong.
51 changes: 13 additions & 38 deletions
51
core/platform/src/commonMain/kotlin/dev/androidbroadcast/news/core/NewsAppPlatform.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,54 +1,29 @@ | ||
package dev.androidbroadcast.news.core | ||
|
||
import coil3.ImageLoader | ||
import coil3.PlatformContext | ||
import coil3.SingletonImageLoader | ||
import org.koin.core.component.KoinComponent | ||
import org.koin.core.component.KoinScopeComponent | ||
import org.koin.core.context.startKoin | ||
import org.koin.core.logger.Level | ||
import org.koin.core.scope.Scope | ||
import org.koin.dsl.KoinAppDeclaration | ||
import dev.androidbroadcast.common.PlatformContext | ||
import kotlin.properties.Delegates.notNull | ||
|
||
public class NewsAppPlatform : | ||
KoinComponent, | ||
KoinScopeComponent, | ||
SingletonImageLoader.Factory { | ||
override val scope: Scope | ||
// Root scope id taken from Koin source code | ||
get() = getKoin().getScope("_root_") | ||
|
||
public var appComponent: AppComponent by notNull() | ||
private set | ||
|
||
public fun start( | ||
debug: Boolean, | ||
newsApiKey: String, | ||
newsApiBaseUrl: String, | ||
targetAppDeclaration: KoinAppDeclaration = {} | ||
platformContext: PlatformContext, | ||
) { | ||
startKoin { | ||
modules( | ||
appKoinModule, | ||
targetKoinModule | ||
) | ||
|
||
properties( | ||
mapOf( | ||
ConfigProperties.NewsPlatform.Debug to debug, | ||
ConfigProperties.NewsApi.ApiKey to newsApiKey, | ||
ConfigProperties.NewsApi.BaseUrl to newsApiBaseUrl | ||
) | ||
) | ||
|
||
if (debug) { | ||
printLogger(Level.DEBUG) | ||
} | ||
|
||
targetAppDeclaration() | ||
} | ||
appComponent = AppComponent.create( | ||
debug, newsApiBaseUrl, newsApiKey, | ||
platformContext | ||
) | ||
} | ||
|
||
override fun newImageLoader(context: PlatformContext): ImageLoader = | ||
newImageLoader( | ||
context, | ||
debug = getKoin().getProperty(ConfigProperties.NewsPlatform.Debug, false) | ||
) | ||
override fun newImageLoader(context: coil3.PlatformContext): ImageLoader { | ||
return newImageLoader(context) | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/KoinModules.ios.kt
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
core/platform/src/jvmMain/kotlin/dev/androidbroadcast/news/core/KoinModules.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ kotlin { | |
jvm() | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
|
Oops, something went wrong.