Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate k2 #35

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" }
Loading