Skip to content
Open
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
2 changes: 1 addition & 1 deletion solution/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ captures
.cxx
local.properties
secrets.properties
.idea/
.idea/
11 changes: 8 additions & 3 deletions solution/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
buildConfig = true
Expand All @@ -57,6 +54,13 @@ android {
}
}

// Accessing the kotlin extension to configure compiler options
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8)
}
}

// Allow references to generated code
kapt {
correctErrorTypes = true
Expand All @@ -72,6 +76,7 @@ dependencies {
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.extended)

testImplementation(libs.junit)
testImplementation(libs.robolectric)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ fun MountainMap(
eventFlow.collect { event ->
when (event) {
MountainsScreenEvent.OnZoomAll -> {
zoomAll(scope, cameraPositionState, viewState.boundingBox)
if (isMapLoaded) {
zoomAll(scope, cameraPositionState, viewState.boundingBox)
}
}
}
}
}

LaunchedEffect(key1 = viewState.boundingBox) {
zoomAll(scope, cameraPositionState, viewState.boundingBox)
LaunchedEffect(key1 = isMapLoaded, key2 = viewState.boundingBox) {
if (isMapLoaded) {
zoomAll(scope, cameraPositionState, viewState.boundingBox)
}
}

Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MountainsRepository(@ApplicationContext val context: Context) {
if (!loaded) {
loaded = true
_mountains.value = withContext(Dispatchers.IO) {
context.resources.openRawResource(R.raw.top_peaks).use { inputStream ->
context.resources.openRawResource(R.raw.top_peaks_gpx).use { inputStream ->
readMountains(inputStream)
}
}
Expand Down
Loading