Skip to content

Commit 9390cac

Browse files
authored
Merge pull request #28 from ShreyashKore/dev
upgrade libs and fix code
2 parents 6abd757 + b361b34 commit 9390cac

9 files changed

Lines changed: 140 additions & 152 deletions

File tree

.run/desktopApp.run.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
4+
<option name="env">
5+
<map>
6+
<entry key="DEVELOPER_DIR" value="/Applications/Xcode.app/Contents/Developer" />
7+
</map>
8+
</option>
49
<option name="executionName" />
510
<option name="externalProjectPath" value="$PROJECT_DIR$/composeApp" />
611
<option name="externalSystemIdString" value="GRADLE" />
@@ -17,7 +22,12 @@
1722
</ExternalSystemSettings>
1823
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
1924
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
25+
<EXTENSION ID="com.android.tools.idea.testartifacts.testsuite.GradleRunConfigurationExtension">
26+
<com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>false</com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>
27+
<android.execution.deploysToLocalDevice>false</android.execution.deploysToLocalDevice>
28+
</EXTENSION>
2029
<DebugAllEnabled>false</DebugAllEnabled>
30+
<RunAsTest>false</RunAsTest>
2131
<method v="2" />
2232
</configuration>
2333
</component>

.run/jsApp.run.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="jsApp" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
4+
<option name="env">
5+
<map>
6+
<entry key="DEVELOPER_DIR" value="/Applications/Xcode.app/Contents/Developer" />
7+
</map>
8+
</option>
49
<option name="executionName" />
510
<option name="externalProjectPath" value="$PROJECT_DIR$/composeApp" />
611
<option name="externalSystemIdString" value="GRADLE" />
@@ -17,6 +22,10 @@
1722
</ExternalSystemSettings>
1823
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
1924
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
25+
<EXTENSION ID="com.android.tools.idea.testartifacts.testsuite.GradleRunConfigurationExtension">
26+
<com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>false</com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>
27+
<android.execution.deploysToLocalDevice>false</android.execution.deploysToLocalDevice>
28+
</EXTENSION>
2029
<DebugAllEnabled>false</DebugAllEnabled>
2130
<RunAsTest>false</RunAsTest>
2231
<method v="2" />

.run/wasmJsApp.run.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="wasmJsApp" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
4+
<option name="env">
5+
<map>
6+
<entry key="DEVELOPER_DIR" value="/Applications/Xcode.app/Contents/Developer" />
7+
</map>
8+
</option>
49
<option name="executionName" />
510
<option name="externalProjectPath" value="$PROJECT_DIR$/composeApp" />
611
<option name="externalSystemIdString" value="GRADLE" />
@@ -10,15 +15,19 @@
1015
</option>
1116
<option name="taskNames">
1217
<list>
13-
<option value="wasmJsBrowserRun" />
18+
<option value="wasmJsBrowserDevelopmentRun" />
1419
</list>
1520
</option>
1621
<option name="vmOptions" />
1722
</ExternalSystemSettings>
1823
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
1924
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
25+
<EXTENSION ID="com.android.tools.idea.testartifacts.testsuite.GradleRunConfigurationExtension">
26+
<com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>false</com.android.tools.idea.testartifacts.testsuite.SHOW_TEST_RESULT_IN_ANDROID_TEST_SUITE_VIEW>
27+
<android.execution.deploysToLocalDevice>false</android.execution.deploysToLocalDevice>
28+
</EXTENSION>
2029
<DebugAllEnabled>false</DebugAllEnabled>
21-
<ForceTestExec>false</ForceTestExec>
30+
<RunAsTest>false</RunAsTest>
2231
<method v="2" />
2332
</configuration>
2433
</component>

composeApp/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
22
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import java.util.Properties
45

56
plugins {
@@ -33,7 +34,7 @@ kotlin {
3334

3435
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
3536
wasmJs {
36-
moduleName = "composeApp"
37+
outputModuleName = "composeApp"
3738
browser {
3839
commonWebpackConfig {
3940
outputFileName = "composeApp.js"
@@ -55,10 +56,8 @@ kotlin {
5556
}
5657

5758
androidTarget {
58-
compilations.all {
59-
kotlinOptions {
60-
jvmTarget = "11"
61-
}
59+
compilerOptions {
60+
jvmTarget.set(JvmTarget.JVM_1_8)
6261
}
6362
}
6463

@@ -99,6 +98,7 @@ kotlin {
9998
implementation(libs.coil.compose)
10099
implementation(libs.coil.network.ktor)
101100
implementation(libs.image.loader)
101+
implementation("org.jetbrains.compose.material:material-icons-core:1.6.11")
102102
}
103103

104104
val nonWebMain by getting {

composeApp/src/commonMain/kotlin/App.kt

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.navigation.NavBackStackEntry
1313
import androidx.navigation.compose.NavHost
1414
import androidx.navigation.compose.composable
1515
import androidx.navigation.compose.rememberNavController
16+
import androidx.navigation.toRoute
1617
import models.Wonder
1718
import models.parse
1819
import ui.screens.ArtifactDetailsScreen
@@ -39,26 +40,24 @@ fun App() {
3940

4041
NavHost(
4142
navController = navigator,
42-
startDestination = "/home",
43+
startDestination = AppRoute.Home,
4344
enterTransition = { DefaultEnterTransition },
4445
exitTransition = { DefaultExitTransition },
4546
popEnterTransition = { DefaultPopEnterTransition },
4647
popExitTransition = { DefaultPopExitTransition },
4748
) {
48-
composable(
49-
"/home",
50-
) { backStackEntry ->
49+
composable<AppRoute.Home> { backStackEntry ->
5150
// Temporary fix as current Wonder is not being remembered when in backstack
5251
val savedStateHandle = backStackEntry.savedStateHandle
5352
val currentWonderName = savedStateHandle.get<String>("currentWonder")
5453
val currentWonder = Wonder.parse(currentWonderName)
5554
HomeScreen(
5655
initialWonder = currentWonder,
5756
openDetailScreen = {
58-
navigator.navigate("/home/wonder/${it.name}")
57+
navigator.navigate(AppRoute.Wonder(it.name))
5958
},
6059
openTimelineScreen = {
61-
navigator.navigate("/timeline?type=${it.name}")
60+
navigator.navigate(AppRoute.Timeline(it.name))
6261
},
6362
animatedVisibilityScope = this,
6463
sharedTransitionScope = this@SharedTransitionLayout,
@@ -69,49 +68,42 @@ fun App() {
6968

7069
}
7170

72-
composable(
73-
"/home/wonder/{type}",
74-
) { backStackEntry ->
75-
val id = backStackEntry.arguments?.getString("type")
76-
val wonder = Wonder.parse(id)
71+
composable<AppRoute.Wonder> { backStackEntry ->
72+
val route = backStackEntry.toRoute<AppRoute.Wonder>()
73+
val wonder = Wonder.parse(route.wonderId)
7774
WonderDetailsScreen(
7875
wonder = wonder,
7976
onPressHome = { navigator.popBackStack() },
80-
openTimelineScreen = { navigator.navigate("/timeline?type=${it?.name}") },
81-
openArtifactDetailsScreen = { navigator.navigate("/artifact/${it}") },
82-
openArtifactListScreen = { navigator.navigate("/search/${it.name}") },
83-
openMapScreen = { navigator.navigate("/maps/${it.name}") },
84-
openVideoScreen = { navigator.navigate("/video/$it") },
77+
openTimelineScreen = { navigator.navigate(AppRoute.Timeline(it?.name)) },
78+
openArtifactDetailsScreen = { navigator.navigate(AppRoute.ArtifactDetails(it)) },
79+
openArtifactListScreen = { navigator.navigate(AppRoute.Search(it.name)) },
80+
openMapScreen = { navigator.navigate(AppRoute.Maps(it.name)) },
81+
openVideoScreen = { navigator.navigate(AppRoute.Video(it)) },
8582
animatedVisibilityScope = this,
8683
sharedTransitionScope = this@SharedTransitionLayout,
8784
)
8885
}
89-
composable(
90-
"/timeline",
91-
) { backStackEntry ->
92-
val id = backStackEntry.arguments?.getString("type")
93-
val wonder = Wonder.parse(id)
86+
87+
composable<AppRoute.Timeline> { backStackEntry ->
88+
val route = backStackEntry.toRoute<AppRoute.Timeline>()
89+
val wonder = Wonder.parse(route.wonderId)
9490
TimelineScreen(
9591
selectedWonder = wonder,
9692
onClickBack = { navigator.popBackStack() },
9793
)
9894
}
9995

100-
composable(
101-
"/artifact/{id}",
102-
) { backStackEntry ->
103-
val id = backStackEntry.arguments?.getString("id")!!
96+
composable<AppRoute.ArtifactDetails> { backStackEntry ->
97+
val route = backStackEntry.toRoute<AppRoute.ArtifactDetails>()
10498
ArtifactDetailsScreen(
105-
artifactId = id,
99+
artifactId = route.artifactId,
106100
onClickBack = { navigator.popBackStack() },
107101
)
108102
}
109103

110-
composable(
111-
"/search/{type}",
112-
) { backStackEntry ->
113-
val id = backStackEntry.arguments?.getString("type")
114-
val wonder = Wonder.parse(id)
104+
composable<AppRoute.Search> { backStackEntry ->
105+
val route = backStackEntry.toRoute<AppRoute.Search>()
106+
val wonder = Wonder.parse(route.wonderId)
115107
val viewModel = viewModel { ArtifactListViewModel(wonder) }
116108
ArtifactListScreen(
117109
wonder = wonder,
@@ -120,28 +112,24 @@ fun App() {
120112
onQueryChange = viewModel::onQueryChange,
121113
suggestions = viewModel.suggestions.collectAsStateWithLifecycle().value,
122114
filteredArtifacts = viewModel.filteredArtifacts.collectAsStateWithLifecycle().value,
123-
onClickArtifact = { navigator.navigate("/artifact/${it}") },
115+
onClickArtifact = { navigator.navigate(AppRoute.ArtifactDetails("$it")) },
124116
onBackClick = { navigator.navigateUp() },
125117
)
126118
}
127119

128-
composable(
129-
"/maps/{type}",
130-
) { backStackEntry ->
131-
val id = backStackEntry.arguments?.getString("type")
132-
val wonder = Wonder.parse(id)
120+
composable<AppRoute.Maps> { backStackEntry ->
121+
val route = backStackEntry.toRoute<AppRoute.Maps>()
122+
val wonder = Wonder.parse(route.wonderId)
133123
MapScreen(
134124
latLng = wonder.latLng,
135125
onBackClick = { navigator.popBackStack() }
136126
)
137127
}
138128

139-
composable(
140-
"/video/{id}",
141-
) { backStackEntry ->
142-
val id = backStackEntry.arguments?.getString("id")!!
129+
composable<AppRoute.Video> { backStackEntry ->
130+
val route = backStackEntry.toRoute<AppRoute.Video>()
143131
YoutubeVideoScreen(
144-
id = id,
132+
id = route.videoId,
145133
onBackClick = { navigator.popBackStack() }
146134
)
147135
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import kotlinx.serialization.Serializable
2+
3+
sealed interface AppRoute {
4+
@Serializable
5+
data object Home : AppRoute
6+
7+
@Serializable
8+
data class Wonder(val wonderId: String) : AppRoute
9+
10+
@Serializable
11+
data class Timeline(val wonderId: String? = null) : AppRoute
12+
13+
@Serializable
14+
data class ArtifactDetails(val artifactId: String) : AppRoute
15+
16+
@Serializable
17+
data class Search(val wonderId: String) : AppRoute
18+
19+
@Serializable
20+
data class Maps(val wonderId: String) : AppRoute
21+
22+
@Serializable
23+
data class Video(val videoId: String) : AppRoute
24+
}

gradle/libs.versions.toml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ versionCode = "105"
44
versionName = "1.0.5"
55

66
## Frameworks and Libraries
7-
agp = "8.2.2"
8-
android-compileSdk = "34"
7+
agp = "8.11.0"
8+
android-compileSdk = "36"
99
android-minSdk = "24"
10-
android-targetSdk = "34"
11-
androidx-activityCompose = "1.9.2"
12-
appcompat = "1.7.0"
13-
compose-plugin = "1.7.0-beta02"
14-
kotlin = "2.0.20"
15-
composeWebviewMultiplatform = "1.8.8"
16-
coilCompose = "3.0.0-alpha10"
17-
kamelImage = "1.0.0-beta.6"
18-
imageLoader = "1.8.2"
19-
lifecycle = "2.8.2"
20-
androidx-navigation = "2.8.0-alpha10"
21-
mapsCompose = "2.11.2"
10+
android-targetSdk = "36"
11+
androidx-activityCompose = "1.10.1"
12+
appcompat = "1.7.1"
13+
compose-plugin = "1.8.2"
14+
compose-material = "1.7.3"
15+
kotlin = "2.2.0"
16+
composeWebviewMultiplatform = "2.0.1"
17+
coilCompose = "3.2.0"
18+
kamelImage = "1.0.6"
19+
imageLoader = "1.10.0"
20+
lifecycle = "2.9.1"
21+
androidx-navigation = "2.9.0-beta03"
22+
mapsCompose = "6.6.0"
2223
playServicesLocation = "21.3.0"
23-
playServicesMaps = "19.0.0"
24-
ktor = "3.0.0-rc-1"
25-
kotlinx-serialization = "1.7.3"
26-
kotlinx-datetime = "0.6.1"
24+
playServicesMaps = "19.2.0"
25+
ktor = "3.2.2"
26+
kotlinx-serialization = "1.9.0"
27+
kotlinx-datetime = "0.7.0"
28+
uiTooling = "1.8.2"
29+
uiToolingVersion = "1.8.3"
2730

2831

2932
[libraries]
@@ -65,6 +68,7 @@ image-loader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imag
6568

6669
# UI
6770
compose-webview-multiplatform = { module = "io.github.kevinnzou:compose-webview-multiplatform", version.ref = "composeWebviewMultiplatform" }
71+
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "uiToolingVersion" }
6872

6973

7074
[plugins]

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#Tue May 27 22:07:05 IST 2025
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
45
networkTimeout=10000
56
validateDistributionUrl=true
67
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)