-
Notifications
You must be signed in to change notification settings - Fork 1
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
dd98943
commit 653b610
Showing
6 changed files
with
21 additions
and
10 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
4 changes: 2 additions & 2 deletions
4
core/app-info/src/commonMain/kotlin/xyz/ksharma/krail/core/appinfo/CompositionLocals.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,5 +1,5 @@ | ||
package xyz.ksharma.krail.core.appinfo | ||
|
||
import androidx.compose.runtime.compositionLocalOf | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
|
||
val LocalPlatformTypeProvider = compositionLocalOf { PlatformType.UNKNOWN } | ||
val LocalPlatformTypeProvider = staticCompositionLocalOf { getAppPlatform() } |
8 changes: 6 additions & 2 deletions
8
core/app-info/src/iosMain/kotlin/xyz/ksharma/krail/core/appinfo/Platform.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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
package xyz.ksharma.krail.core.appinfo | ||
|
||
import platform.UIKit.UIDevice | ||
import kotlin.experimental.ExperimentalNativeApi | ||
|
||
class IOSPlatform : Platform { | ||
class IOSAppPlatform : AppPlatform { | ||
override val name: String = | ||
UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion | ||
|
||
override val type: PlatformType = PlatformType.IOS | ||
|
||
@OptIn(ExperimentalNativeApi::class) | ||
override fun isDebug(): Boolean = Platform.isDebugBinary | ||
} | ||
|
||
actual fun getPlatform(): Platform = IOSPlatform() | ||
actual fun getAppPlatform(): AppPlatform = IOSAppPlatform() |