Skip to content

Commit 9d4b088

Browse files
committed
feat: add compose ui
1 parent 4d2085a commit 9d4b088

File tree

31 files changed

+1618
-90
lines changed

31 files changed

+1618
-90
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Fruits | Detail |
4949

5050
Device | Connect |
5151
--- | --- |
52-
<img src="docs/device.gif"> | <img src="docs/edge_get.gif"> |
52+
<img src="docs/demo.gif"> | <img src="docs/edge_get.gif"> |
5353

5454
## ✨ Contributing
5555
Please feel free to contact me or make a pull request.

app/build.gradle

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ android {
2727
}
2828
}
2929
compileOptions {
30-
sourceCompatibility JavaVersion.VERSION_1_8
31-
targetCompatibility JavaVersion.VERSION_1_8
30+
sourceCompatibility JavaVersion.VERSION_17
31+
targetCompatibility JavaVersion.VERSION_17
3232
}
3333
kotlinOptions {
34-
jvmTarget = JavaVersion.VERSION_1_8
34+
jvmTarget = JavaVersion.VERSION_17
3535
}
3636
packagingOptions {
3737
jniLibs {
@@ -51,16 +51,17 @@ android {
5151

5252
dependencies {
5353

54+
// Core
5455
implementation 'androidx.core:core-ktx:1.12.0'
5556
implementation 'androidx.appcompat:appcompat:1.6.1'
5657
implementation 'com.google.android.material:material:1.11.0'
5758
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
5859

59-
// serialization
60-
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0'
60+
// Serialization
61+
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
6162

6263
// Coroutines
63-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
64+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
6465

6566
// Embedded Server
6667
implementation 'io.ktor:ktor-server-core:2.3.10'
@@ -70,17 +71,13 @@ dependencies {
7071
implementation 'io.ktor:ktor-server-content-negotiation:2.3.10'
7172
implementation 'io.ktor:ktor-server-cors:2.3.10'
7273

73-
// Compose
74-
def composeBom = platform('androidx.compose:compose-bom:2024.04.00')
75-
implementation composeBom
76-
androidTestImplementation composeBom
77-
// Android Studio Preview support
78-
implementation 'androidx.compose.ui:ui-tooling-preview'
79-
debugImplementation 'androidx.compose.ui:ui-tooling'
80-
// Optional - Integration with activities
81-
implementation 'androidx.activity:activity-compose:1.8.2'
82-
8374
// Test
8475
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
8576
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
77+
78+
// UI
79+
implementation "androidx.core:core-splashscreen:1.0.1"
80+
implementation project(':core-ui')
81+
82+
// Modules
8683
}

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
66
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
77

8-
98
<application
109
android:allowBackup="true"
1110
android:icon="@mipmap/ic_launcher"

app/src/main/java/com/nphausg/app/embeddedserver/EmbeddedServer.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,20 @@ object EmbeddedServer {
7373

7474
fun start() {
7575
ioScope.launch {
76-
server.start(wait = true)
76+
try {
77+
server.start(wait = true)
78+
} catch (e: Exception) {
79+
e.printStackTrace()
80+
}
7781
}
7882
}
7983

8084
fun stop() {
81-
server.stop(1_000, 2_000)
85+
try {
86+
server.stop(1_000, 2_000)
87+
} catch (e: Exception) {
88+
e.printStackTrace()
89+
}
8290
}
8391

8492
val host: String

0 commit comments

Comments
 (0)