-
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
4b26424
commit 421eb30
Showing
41 changed files
with
870 additions
and
7 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
14 changes: 14 additions & 0 deletions
14
compose-app/src/iosMain/kotlin/dev.androidbroadcast.news.compose/NewsViewController.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import androidx.compose.ui.window.ComposeUIViewController | ||
import dev.androidbroadcast.news.compose.NewsApp | ||
import dev.androidbroadcast.news.core.NewsAppPlatform | ||
import platform.UIKit.UIViewController | ||
|
||
public fun MainViewController(): UIViewController { | ||
val appPlatform = NewsAppPlatform() | ||
appPlatform.start( | ||
debug = true, | ||
newsApiKey = "155ae65d7264461397c901103488c01e", | ||
newsApiBaseUrl = "https://newsapi.org/v2/" | ||
) | ||
return ComposeUIViewController { NewsApp() } | ||
} |
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
28 changes: 28 additions & 0 deletions
28
core/common/src/iosMain/kotlin/dev/androidbroadcast/common/PrintLogger.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package dev.androidbroadcast.common | ||
|
||
import platform.Foundation.NSLog | ||
|
||
public class PrintLogger( | ||
) : Logger { | ||
private fun printMessage( | ||
level: String, | ||
tag: String, | ||
message: String | ||
) { | ||
NSLog("$level[$tag]: $message") | ||
} | ||
|
||
override fun d( | ||
tag: String, | ||
message: String | ||
) { | ||
printMessage("D", tag, message) | ||
} | ||
|
||
override fun e( | ||
tag: String, | ||
message: String | ||
) { | ||
printMessage("E", tag, message) | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...ase/src/androidMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.android.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dev.androidbroadcast.news.database | ||
|
||
actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase { | ||
error("Not implemented in Android") | ||
} |
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
...e/src/iosArm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosArm64.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package dev.androidbroadcast.news.database | ||
|
||
actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() |
3 changes: 3 additions & 0 deletions
3
...Arm64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosSimulatorArm64.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package dev.androidbroadcast.news.database | ||
|
||
actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() |
3 changes: 3 additions & 0 deletions
3
...abase/src/iosX64Main/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.iosX64.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package dev.androidbroadcast.news.database | ||
|
||
actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase = NewsRoomDatabase_Impl() |
5 changes: 5 additions & 0 deletions
5
core/database/src/jvmMain/kotlin/dev/androidbroadcast/news/database/NewsRoomDatabase.jvm.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package dev.androidbroadcast.news.database | ||
|
||
actual fun instantiateNewsRoomDatabase(): NewsRoomDatabase { | ||
error("Not implemented in JVM") | ||
} |
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
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/ImageLoader.ios.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package dev.androidbroadcast.news.core | ||
|
||
import coil3.PlatformContext | ||
import coil3.disk.DiskCache | ||
|
||
internal actual fun newDiskCache(context: PlatformContext): DiskCache? { | ||
TODO("Not yet implemented") | ||
} |
28 changes: 28 additions & 0 deletions
28
core/platform/src/iosMain/kotlin/dev/androidbroadcast/news/core/KoinModules.ios.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package dev.androidbroadcast.news.core | ||
|
||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import androidx.sqlite.driver.bundled.BundledSQLiteDriver | ||
import dev.androidbroadcast.common.Logger | ||
import dev.androidbroadcast.common.PrintLogger | ||
import dev.androidbroadcast.news.database.NewsRoomDatabase | ||
import dev.androidbroadcast.news.database.instantiateNewsRoomDatabase | ||
import org.koin.core.module.Module | ||
import org.koin.dsl.module | ||
import platform.Foundation.NSHomeDirectory | ||
|
||
/** | ||
* Koin Module with target platform specifics dependencies | ||
*/ | ||
internal actual val targetKoinModule: Module = module { | ||
factory<RoomDatabase.Builder<NewsRoomDatabase>> { | ||
Room.databaseBuilder<NewsRoomDatabase>( | ||
name = "${NSHomeDirectory()}/news.db", | ||
factory = { instantiateNewsRoomDatabase() } | ||
).setDriver(BundledSQLiteDriver()) | ||
} | ||
|
||
factory<Logger> { | ||
PrintLogger() | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
core/uikit/src/iosMain/kotlin/dev/androidbroadcast/news/Theme.ios.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dev.androidbroadcast.news | ||
|
||
import androidx.compose.material3.ColorScheme | ||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
internal actual fun dynamicColorScheme(darkTheme: Boolean): ColorScheme { | ||
error("Dynamic theming isn't supported") | ||
} | ||
|
||
internal actual fun isPlatformWithDynamicSystemTheme(): Boolean = false | ||
|
||
@Composable | ||
internal actual fun platformThemeSetup( | ||
darkTheme: Boolean, | ||
colorScheme: ColorScheme, | ||
) { | ||
// Do nothing | ||
} |
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.