Skip to content

Commit

Permalink
Merge pull request #35 from pseudoankit/migrate-k2
Browse files Browse the repository at this point in the history
Migrate k2
  • Loading branch information
pseudoankit authored Nov 4, 2024
2 parents 898ada2 + c030a34 commit 530c890
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 59 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.externalNativeBuild
.cxx
local.properties
.kotlin
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.compose.compiler) apply false
}
5 changes: 5 additions & 0 deletions coachmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.compose.multiplatform)
alias(libs.plugins.compose.compiler)
id("publication.module")
}

composeCompiler {
enableStrongSkippingMode = true
}

kotlin {
applyDefaultHierarchyTemplate()
androidTarget {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.GenericShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.geometry.RoundRect
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -42,9 +43,8 @@ public fun Balloon(

Box(
modifier = Modifier
.clip(balloonShape(arrow, density, cornerRadius))
.graphicsLayer {
shape = balloonShape(arrow, density, cornerRadius)
clip = true
this.shadowElevation = shadowElevation.toPx(density)
}
.background(bgColor)
Expand All @@ -58,7 +58,6 @@ public fun Balloon(
.then(modifier),
content = content
)
PaddingValues().calculateBottomPadding()
}

private fun balloonShape(
Expand Down
53 changes: 0 additions & 53 deletions demo/android/build.gradle

This file was deleted.

46 changes: 46 additions & 0 deletions demo/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
alias(libs.plugins.android.app)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
}

android {
namespace = "com.pseudoankit.coachmark_demo"
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
applicationId = "com.pseudoankit.coachmark"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0.0"

vectorDrawables {
useSupportLibrary = true
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
}

dependencies {
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0")
}

implementation(project(":demo:shared"))
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2022.10.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
}
1 change: 1 addition & 0 deletions demo/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.compose.multiplatform)
alias(libs.plugins.compose.compiler)
}

kotlin {
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.2.2"
kotlin = "1.9.22"
kotlin = "2.0.0"
compose-compiler = "1.5.9"

minSdk = "21"
Expand All @@ -18,4 +18,5 @@ android-app = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
compose-multiplatform = { id = "org.jetbrains.compose", version = "1.6.0" }
compose-multiplatform = { id = "org.jetbrains.compose", version = "1.7.0" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

0 comments on commit 530c890

Please sign in to comment.