-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from MohamedRejeb/0.3.1
Update Compose to 1.6.0
- Loading branch information
Showing
96 changed files
with
1,797 additions
and
1,105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[*.{kt,kts}] | ||
ktlint_code_style = ktlint_official | ||
|
||
ktlint_standard_multiline-if-else = disabled | ||
ktlint_standard_property-naming = disabled | ||
ktlint_standard_function_naming_ignore_when_annotated_with = Composable | ||
ktlint_function_naming_ignore_when_annotated_with = Composable |
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,55 @@ | ||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.composeMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
id("module.publication") | ||
} | ||
|
||
kotlin { | ||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
applyDefaultHierarchyTemplate { | ||
common { | ||
group("nonAndroid") { | ||
withJvm() | ||
withIos() | ||
withJs() | ||
} | ||
} | ||
} | ||
androidTarget { | ||
publishLibraryVariants("release") | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
} | ||
jvm("desktop") { | ||
jvmToolchain(11) | ||
} | ||
js(IR) { | ||
browser() | ||
} | ||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
|
||
sourceSets.commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
} | ||
} | ||
|
||
android { | ||
namespace = "com.mohamedrejeb.calf.core" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
calf-core/src/androidMain/kotlin/com.mohamedrejeb.calf/core/LocalPlatformContext.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 com.mohamedrejeb.calf.core | ||
|
||
import androidx.compose.ui.platform.LocalContext | ||
|
||
actual val LocalPlatformContext get() = LocalContext |
5 changes: 5 additions & 0 deletions
5
calf-core/src/androidMain/kotlin/com.mohamedrejeb.calf/core/PlatformContext.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 com.mohamedrejeb.calf.core | ||
|
||
import android.content.Context | ||
|
||
actual typealias PlatformContext = Context |
5 changes: 5 additions & 0 deletions
5
calf-core/src/commonMain/kotlin/com.mohamedrejeb.calf/core/LocalPlatformContext.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 com.mohamedrejeb.calf.core | ||
|
||
import androidx.compose.runtime.ProvidableCompositionLocal | ||
|
||
expect val LocalPlatformContext: ProvidableCompositionLocal<PlatformContext> |
3 changes: 3 additions & 0 deletions
3
calf-core/src/commonMain/kotlin/com.mohamedrejeb.calf/core/PlatformContext.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 com.mohamedrejeb.calf.core | ||
|
||
expect abstract class PlatformContext |
8 changes: 8 additions & 0 deletions
8
...e/src/nonAndroidMain/kotlin/com.mohamedrejeb.calf/core/LocalPlatformContext.nonAndroid.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 com.mohamedrejeb.calf.core | ||
|
||
import androidx.compose.runtime.staticCompositionLocalOf | ||
|
||
actual val LocalPlatformContext = | ||
staticCompositionLocalOf { | ||
PlatformContext.INSTANCE | ||
} |
10 changes: 10 additions & 0 deletions
10
calf-core/src/nonAndroidMain/kotlin/com.mohamedrejeb.calf/core/PlatformContext.nonAndroid.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,10 @@ | ||
package com.mohamedrejeb.calf.core | ||
|
||
import kotlin.jvm.JvmField | ||
|
||
actual abstract class PlatformContext private constructor() { | ||
companion object { | ||
@JvmField | ||
val INSTANCE = object : PlatformContext() {} | ||
} | ||
} |
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.