-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.修复sqldelight Could not find "co.touchlab:stately-common的问题。见:sqldelight/sqldelight#4356 (comment)
- Loading branch information
1 parent
85b79aa
commit e51f2f2
Showing
56 changed files
with
2,482 additions
and
42 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 |
---|---|---|
@@ -1,40 +1,30 @@ | ||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.* | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import com.yunext.virtuals.ui.screen.DemoScreen | ||
import org.jetbrains.compose.resources.ExperimentalResourceApi | ||
import org.jetbrains.compose.resources.painterResource | ||
import com.yunext.virtuals.ui.screen.VoyagerApp | ||
import org.jetbrains.compose.ui.tooling.preview.Preview | ||
|
||
import org.jetbrains.compose.resources.DrawableResource | ||
|
||
@OptIn(ExperimentalResourceApi::class) | ||
@Composable | ||
@Preview | ||
fun App() { | ||
MaterialTheme { | ||
var showContent by remember { mutableStateOf(false) } | ||
Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { | ||
|
||
DemoScreen() | ||
Button(onClick = { showContent = !showContent }) { | ||
Text("Click me!") | ||
} | ||
AnimatedVisibility(showContent) { | ||
val greeting = remember { Greeting().greet() } | ||
Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { | ||
//Image(painterResource(Res.drawable.compose_multiplatform), null) | ||
Image(painterResource(DrawableResource("compose-multiplatform.xml")), null) | ||
Text("Compose: $greeting") | ||
} | ||
} | ||
} | ||
// var showContent by remember { mutableStateOf(false) } | ||
// Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { | ||
// | ||
// DemoScreen() | ||
// Button(onClick = { showContent = !showContent }) { | ||
// Text("Click me!") | ||
// } | ||
// AnimatedVisibility(showContent) { | ||
// val greeting = remember { Greeting().greet() } | ||
// Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { | ||
// //Image(painterResource(Res.drawable.compose_multiplatform), null) | ||
// Image(painterResource(DrawableResource("compose-multiplatform.xml")), null) | ||
// Text("Compose: $greeting") | ||
// } | ||
// } | ||
// } | ||
// VoyagerDemoApp() | ||
// SplashScreen() | ||
VoyagerApp() | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
hdcommon/src/commonMain/kotlin/com/yunext/kmp/common/util/Strings.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,4 +1,5 @@ | ||
package com.yunext.kmp.common.util | ||
|
||
expect fun hdMD5(text: String, upperCase: Boolean = false): String? | ||
expect fun hdRandomString(length:Int): String | ||
expect fun hdUUID(length:Int): String | ||
|
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
5 changes: 5 additions & 0 deletions
5
hdcommon/src/jvmTest/kotlin/com/yunext/kmp/common/TestNullPlusNull.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.yunext.kmp.common | ||
|
||
internal data class Rect2(val a: Int, val b: Int) | ||
|
||
internal operator fun Rect2?.plus(rect: Rect2?) = Rect2((this?.a ?: 0) + (rect?.a ?: 0), (this?.b ?: 0) + (rect?.b ?: 0)) |
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
13 changes: 13 additions & 0 deletions
13
hdhttp/src/commonMain/kotlin/com/yunext/kmp/http/DebugKtorClient.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,13 @@ | ||
package com.yunext.kmp.http | ||
|
||
import io.ktor.client.request.get | ||
import io.ktor.client.statement.bodyAsText | ||
|
||
suspend fun testKtor(): String { | ||
// val response = client.get("https://ktor.io/docs/") | ||
// val response = client.get("https://iot2.qinyuan.cn/web/api/common/getAdvertisement") | ||
// val response = hdHttpClient.get("https://www.baidu.com") | ||
val response = | ||
hdHttpClient.get("https://iot2.qinyuan.cn/web/api/common/getFiles/64c763bd93b173b23a289558 ") | ||
return "findAll" + "\n" + response.bodyAsText() | ||
} |
8 changes: 8 additions & 0 deletions
8
hdhttp/src/commonMain/kotlin/com/yunext/kmp/http/HDHttpClient.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.yunext.kmp.http | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.engine.cio.CIO | ||
|
||
val hdHttpClient by lazy { | ||
HttpClient(CIO) | ||
} |
18 changes: 18 additions & 0 deletions
18
hdhttp/src/jvmTest/kotlin/com/yunext/kmp/http/HDHttpClientJVMTest.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,18 @@ | ||
package com.yunext.kmp.http | ||
|
||
import kotlinx.coroutines.runBlocking | ||
import org.junit.Test | ||
|
||
|
||
class HDHttpClientJVMTest { | ||
|
||
@Test | ||
fun t1(){ | ||
runBlocking { | ||
val result = testKtor() | ||
println("result :$result") | ||
assert(result.isNotEmpty()) | ||
} | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
hdresource/src/commonMain/kotlin/com/yunext/kmp/resource/color/DebugColors.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,30 @@ | ||
package com.yunext.kmp.resource.color | ||
|
||
import androidx.compose.ui.graphics.Brush | ||
import androidx.compose.ui.graphics.Color | ||
|
||
val xf98 = Color(0xFFFF9988) | ||
val x98f = Color(0xFF8899ff) | ||
val x9f8 = Color(0xFF99ff88) | ||
|
||
val app_blue_1 = Color(0xff00DBE5) | ||
val app_blue_2 = Color(0xff339DFF) | ||
val app_appColor = Color(0xff339DFF) | ||
val app_textColor_333333 = Color(0xff333333) | ||
val app_textColor_666666 = Color(0xff666666) | ||
val app_textColor_999999 = Color(0xff999999) | ||
val app_red = Color(0xffEC6161) | ||
val app_red_light = app_red.copy(alpha = .1f) | ||
val app_orange = Color(0xffFFA70B) | ||
val app_orange_light = Color(0xffFFA70B).copy(alpha = .15f) | ||
val app_blue_light = app_appColor.copy(alpha = .1f) | ||
val app_gray = Color(0xffDEDFE0) | ||
val app_gray_f4f5f7 = Color(0xffF4F5F7) | ||
val app_gray_light = app_gray.copy(alpha = .6f) | ||
val app_background_70 = Color(1f, 1f, 1f, 0.7f) | ||
|
||
|
||
val app_brush_item_content_spec = Brush.verticalGradient(colors = listOf(Color(0xffF7F8FA), Color(0xFFEFF0F2))) | ||
val app_background_brush = Brush.verticalGradient(colors = listOf(Color(0xFFF4F7FB), Color(0xFFF0F4FC))) | ||
val app_button_brush = Brush.linearGradient(colors = listOf(app_blue_1, app_blue_2)) | ||
val app_button_brush_debug = Brush.linearGradient(colors = listOf(China.r_yan_zhi_hong, China.g_bo_he_lv)) |
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,49 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
} | ||
|
||
kotlin { | ||
targetHierarchy.default() | ||
jvm() | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
|
||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
//put your multiplatform dependencies here | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material3) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
// implementation(compose.components.uiToolingPreview) | ||
|
||
implementation(projects.hdresource) | ||
} | ||
} | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "org.jetbrains.kotlinx.multiplatform.library.template" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
defaultConfig { | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
} | ||
} |
Oops, something went wrong.