Add Android build target and responsive/drawer UI for phones and tablets

Restructure src-tauri into lib+bin (Tauri 2's mobile requirement — Android
embeds the app as a JNI cdylib, which needs a [lib] target with
tauri::mobile_entry_point) and scaffold gen/android/ via `cargo tauri
android init`. Builds and packages cleanly to a debug APK/AAB.

pcd_viewer.html: the 284px docked sidebar becomes a slide-in drawer under
768px viewport width (toggled from the rail, closes on backdrop tap), the
rail sheds its subtitle and secondary telemetry chips under 480px, and the
camera panel caps its width to the viewport. Also disables native pinch-zoom
(the canvas has its own via OrbitControls) and sets overscroll-behavior:none
for a full-bleed touch surface.
This commit is contained in:
Dongubak
2026-08-23 15:02:40 +09:00
parent 75d54de763
commit 8730d5cbaf
46 changed files with 5581 additions and 5 deletions
@@ -0,0 +1,71 @@
import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
}
val tauriProperties = Properties().apply {
val propFile = file("tauri.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}
android {
compileSdk = 36
namespace = "com.khj.pcdviewer"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.khj.pcdviewer"
minSdk = 24
targetSdk = 36
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging { jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList().toTypedArray()
)
}
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
}
rust {
rootDirRel = "../../../"
}
dependencies {
implementation("androidx.webkit:webkit:1.14.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.activity:activity-ktx:1.10.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.lifecycle:lifecycle-process:2.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")