Skip to content

Commit a5c71c9

Browse files
committed
feat: Compose Hot Reload Impl & UIDSearch Refresh Search Info
1 parent 4bd2386 commit a5c71c9

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

composeApp/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import com.android.build.gradle.internal.api.ApkVariantOutputImpl
22
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.INT
33
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
44
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
5+
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
56
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
67
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
78
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
@@ -23,6 +24,7 @@ plugins {
2324
alias(libs.plugins.compose.compiler)
2425
id("com.codingfeline.buildkonfig").version("0.15.1")
2526
kotlin("plugin.serialization") version "2.0.10"
27+
id("org.jetbrains.compose.hot-reload") version "1.0.0-alpha09" // <- add this additionally
2628
}
2729
/**
2830
* tasks to gradle.properties
@@ -345,6 +347,10 @@ compose.resources {
345347
generateResClass = always
346348
}
347349

350+
// Compose Hot Reload
351+
composeCompiler {
352+
featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups)
353+
}
348354

349355

350356

composeApp/src/commonMain/kotlin/ui/screens/UIDSearchPageScreen.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ fun UIDSearchPageScreen(
148148
if(searchRecordList.none { it.uid == UIDSEARCH.uid }) {
149149
searchRecordList.add(UserAccountLite(UIDSEARCH.uid, UIDSEARCH.username, UIDSEARCH.level, UIDSEARCH.icon, UIDSEARCH.server))
150150
UserAccountLite.saveSearchRecordList(arrayListOf<UserAccountLite>().apply { addAll(searchRecordList) })
151+
}else{
152+
val index = searchRecordList.indexOfFirst { it.uid == UIDSEARCH.uid }
153+
searchRecordList.add(index, UserAccountLite(UIDSEARCH.uid, UIDSEARCH.username, UIDSEARCH.level, UIDSEARCH.icon, UIDSEARCH.server))
154+
searchRecordList.removeAt(index+1)
155+
UserAccountLite.saveSearchRecordList(arrayListOf<UserAccountLite>().apply { addAll(searchRecordList) })
151156
}
152157
withContext(Dispatchers.Main){
153158
isQuerying.value = false
@@ -221,6 +226,11 @@ fun UIDSearchPageScreen(
221226
}
222227
}
223228

229+
val index = searchRecordList.indexOfFirst { it.uid == UIDSEARCH.uid }
230+
searchRecordList.add(index, UserAccountLite(UIDSEARCH.uid, UIDSEARCH.username, UIDSEARCH.level, UIDSEARCH.icon, UIDSEARCH.server))
231+
searchRecordList.removeAt(index+1)
232+
UserAccountLite.saveSearchRecordList(arrayListOf<UserAccountLite>().apply { addAll(searchRecordList) })
233+
224234
withContext(Dispatchers.Main) {
225235
pomPomPopupInstance.value = PomPomPopup(isDisplay = false)
226236
isQuerying.value = false

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#Thu May 08 22:21:13 HKT 2025
1+
#Fri May 09 11:36:24 HKT 2025
22
APP_PLATFORM=Android
33
APP_PROFILE=BETA
4-
APP_VERSION=2025.05.08
4+
APP_VERSION=2025.05.09
55
APP_VERSION_BETA=3.0.1
6-
APP_VERSION_CODE=9148
6+
APP_VERSION_CODE=9159
77
APP_VERSION_CODENAME=Firefly
88
APP_VERSION_CODENAME_BETA=Echo
99
APP_VERSION_DESKTOP=1.0.4

0 commit comments

Comments
 (0)