Skip to content

Commit

Permalink
Add terrain double tap support in Android version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComBatVision committed Oct 12, 2024
1 parent c19b77d commit 35a6293
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {
}
dependencies {
implementation 'earth.worldwind:worldwind:1.5.23'
implementation 'earth.worldwind:worldwind:1.5.25'
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ plugins {

buildscript {
dependencies {
classpath("dev.icerock.moko:resources-generator:0.24.1")
classpath("dev.icerock.moko:resources-generator:0.24.2")
}
}

allprojects {
group = "earth.worldwind"
version = "1.5.23"
version = "1.5.25"

extra.apply {
set("minSdk", 21)
Expand Down
10 changes: 5 additions & 5 deletions worldwind-examples-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ android {

dependencies {
implementation(project(":worldwind"))
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
implementation("com.google.android.material:material:1.12.0")
implementation("io.github.missioncommand:mil-sym-android-renderer:0.1.60")

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
}
10 changes: 5 additions & 5 deletions worldwind-tutorials/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ kotlin {
val androidMain by getting {
dependsOn(commonMain)
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
implementation("com.google.android.material:material:1.12.0")
}
}
all {
Expand Down Expand Up @@ -83,5 +83,5 @@ android {
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
}
14 changes: 7 additions & 7 deletions worldwind/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ kotlin {
}
sourceSets {
val mockkVersion = "1.13.10"
val mokoVersion = "0.24.1"
val mokoVersion = "0.24.2"
val ktorVersion = "2.3.10"
val ormliteVersion = "6.1"
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.github.pdvrieze.xmlutil:serialization:0.86.3")
Expand Down Expand Up @@ -113,7 +113,7 @@ kotlin {
val androidMain by getting {
dependsOn(jvmCommonMain)
dependencies {
implementation("androidx.annotation:annotation:1.8.0")
implementation("androidx.annotation:annotation:1.8.2")
implementation("androidx.appcompat:appcompat-resources:1.7.0")
implementation("io.github.missioncommand:mil-sym-android-renderer:0.1.60")
implementation("com.j256.ormlite:ormlite-android:$ormliteVersion")
Expand All @@ -126,8 +126,8 @@ kotlin {
dependencies {
implementation(kotlin("test-junit"))
implementation("io.mockk:mockk-android:$mockkVersion")
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test:rules:1.5.0")
implementation("androidx.test.ext:junit:1.2.1")
implementation("androidx.test:rules:1.6.1")
}
}
all {
Expand Down Expand Up @@ -167,7 +167,7 @@ android {
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
}

// Do not generate Intrinsics runtime assertion for performance reasons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ open class SelectDragDetector(protected val wwd: WorldWindow) : SimpleOnGestureL
return false
}

override fun onSingleTapUp(event: MotionEvent): Boolean {
override fun onSingleTapConfirmed(event: MotionEvent): Boolean {
val callback = callback ?: return false
wwd.mainScope.launch {
val (renderable, position) = awaitPickResult(false)
Expand Down Expand Up @@ -107,8 +107,9 @@ open class SelectDragDetector(protected val wwd: WorldWindow) : SimpleOnGestureL
val callback = callback ?: return false
return runBlocking {
val (renderable, position) = awaitPickResult(false)
if (renderable is Renderable && position != null) {
callback.onRenderableDoubleTap(renderable, position)
if (position != null) {
if (renderable is Renderable) callback.onRenderableDoubleTap(renderable, position)
else callback.onTerrainDoubleTap(position)
wwd.requestRedraw()
true
} else false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,11 @@ interface SelectDragCallback {
* @param position picked terrain or renderable center position
*/
fun onRenderableDoubleTap(renderable: Renderable, position: Position) {}

/**
* Terrain position was double-tapped or double-clicked
*
* @param position picked terrain position
*/
fun onTerrainDoubleTap(position: Position) {}
}

0 comments on commit 35a6293

Please sign in to comment.