various fixes
- Commit
71b594fc6e3ba1978436c269ad11247722deeaec- Author
- vayun-mathur <[email protected]>
- When
- 2026-09-22 00:54 UTC (2 months ago)
- Parents
33a4409
Diff
communicate/src/main/java/com/vayunmathur/communicate/service/car/CommunicateCarThreadListScreen.kt
diff --git a/communicate/src/main/java/com/vayunmathur/communicate/service/car/CommunicateCarThreadListScreen.kt b/communicate/src/main/java/com/vayunmathur/communicate/service/car/CommunicateCarThreadListScreen.ktindex 1f3b57b43b..3327714649 100644--- a/communicate/src/main/java/com/vayunmathur/communicate/service/car/CommunicateCarThreadListScreen.kt+++ b/communicate/src/main/java/com/vayunmathur/communicate/service/car/CommunicateCarThreadListScreen.kt@@ -3,6 +3,7 @@ package com.vayunmathur.communicate.service.car import androidx.car.app.CarContext import androidx.car.app.Screen import androidx.car.app.model.Action+import androidx.car.app.model.CarIcon import androidx.car.app.model.Header import androidx.car.app.model.ItemList import androidx.car.app.model.ListTemplate@@ -10,6 +11,8 @@ import androidx.car.app.model.Row import androidx.car.app.model.RowSection import androidx.car.app.model.SectionedItemTemplate import androidx.car.app.model.Template+import androidx.core.graphics.drawable.IconCompat+import androidx.core.net.toUri import com.vayunmathur.communicate.data.CommunicateLine import com.vayunmathur.communicate.data.SmsThread @@ -105,6 +108,7 @@ class CommunicateCarThreadListScreen( if (thread.unreadCount > 0) { row.addText("${thread.unreadCount} unread") }+ runCatching { row.setImage(avatarIcon(thread, title), Row.IMAGE_TYPE_LARGE) } row.setBrowsable(true) row.setOnClickListener { screenManager.push(CommunicateCarConversationScreen(carContext, session, thread))@@ -112,6 +116,40 @@ class CommunicateCarThreadListScreen( return row.build() } + /** Contact photo when the thread has one, else a generated initials monogram. */+ private fun avatarIcon(thread: SmsThread, name: String): CarIcon {+ val photo = thread.avatarUrl?.takeIf { it.isNotBlank() }?.let { url ->+ runCatching { IconCompat.createWithContentUri(url.toUri()) }.getOrNull()+ }+ return CarIcon.Builder(photo ?: IconCompat.createWithBitmap(monogram(name))).build()+ }++ private fun monogram(name: String): android.graphics.Bitmap {+ val initials = name.trim().split(Regex("\\s+"))+ .filter { it.isNotBlank() }+ .take(2)+ .map { it.first().uppercaseChar() }+ .joinToString("")+ .ifBlank { "#" }+ val size = 128+ val bitmap = android.graphics.Bitmap.createBitmap(size, size, android.graphics.Bitmap.Config.ARGB_8888)+ val canvas = android.graphics.Canvas(bitmap)+ val palette = intArrayOf(0xFF5C6BC0.toInt(), 0xFF26A69A.toInt(), 0xFFEF5350.toInt(), 0xFFAB47BC.toInt(), 0xFF66BB6A.toInt(), 0xFFFFA726.toInt())+ val bg = android.graphics.Paint(android.graphics.Paint.ANTI_ALIAS_FLAG).apply {+ color = palette[(name.hashCode() and 0x7fffffff) % palette.size]+ }+ canvas.drawCircle(size / 2f, size / 2f, size / 2f, bg)+ val textPaint = android.graphics.Paint(android.graphics.Paint.ANTI_ALIAS_FLAG).apply {+ color = android.graphics.Color.WHITE+ textSize = size * 0.42f+ textAlign = android.graphics.Paint.Align.CENTER+ typeface = android.graphics.Typeface.DEFAULT_BOLD+ }+ val baseline = size / 2f - (textPaint.descent() + textPaint.ascent()) / 2f+ canvas.drawText(initials, size / 2f, baseline, textPaint)+ return bitmap+ }+ private companion object { val LINE_ORDER: List<Pair<CommunicateLine, String>> = listOf( CommunicateLine.Sim to "SIM",
communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/CarMetadataPreviews.kt
diff --git a/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/CarMetadataPreviews.kt b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/CarMetadataPreviews.ktindex c0ae520b2f..f9de3d1d89 100644--- a/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/CarMetadataPreviews.kt+++ b/communicate/src/screenshotTest/kotlin/com/vayunmathur/communicate/ui/CarMetadataPreviews.kt@@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview+import androidx.core.graphics.drawable.IconCompat import com.android.tools.screenshot.PreviewTest import com.vayunmathur.library.carhost.CarTemplateView import com.vayunmathur.library.carhost.HostTemplate@@ -38,21 +39,21 @@ class CarMetadataPreviews { HostUiSection( header = "SIM", rows = listOf(- HostUiRow("Alex Rivera", listOf("On my way, 5 minutes out"), browse = true) {},- HostUiRow("Mom", listOf("Call me when you can", "2 unread"), browse = true) {},+ HostUiRow("Alex Rivera", listOf("On my way, 5 minutes out"), browse = true, image = monogram("Alex Rivera")) {},+ HostUiRow("Mom", listOf("Call me when you can", "2 unread"), browse = true, image = monogram("Mom")) {}, ), ), HostUiSection( header = "WhatsApp", rows = listOf(- HostUiRow("Weekend Trip", listOf("Sam: booked the cabin!"), browse = true) {},- HostUiRow("Priya", listOf("Sounds good 👍"), browse = true) {},+ HostUiRow("Weekend Trip", listOf("Sam: booked the cabin!"), browse = true, image = monogram("Weekend Trip")) {},+ HostUiRow("Priya", listOf("Sounds good 👍"), browse = true, image = monogram("Priya")) {}, ), ), HostUiSection( header = "Signal", rows = listOf(- HostUiRow("Jordan", listOf("See you at the gate"), browse = true) {},+ HostUiRow("Jordan", listOf("See you at the gate"), browse = true, image = monogram("Jordan")) {}, ), ), ),@@ -100,4 +101,31 @@ class CarMetadataPreviews { } } }++ /** A colored initials monogram bitmap, matching the on-device thread avatars. */+ private fun monogram(name: String): IconCompat {+ val initials = name.trim().split(Regex("\\s+"))+ .filter { it.isNotBlank() }+ .take(2)+ .map { it.first().uppercaseChar() }+ .joinToString("")+ .ifBlank { "#" }+ val size = 128+ val bitmap = android.graphics.Bitmap.createBitmap(size, size, android.graphics.Bitmap.Config.ARGB_8888)+ val canvas = android.graphics.Canvas(bitmap)+ val palette = intArrayOf(0xFF5C6BC0.toInt(), 0xFF26A69A.toInt(), 0xFFEF5350.toInt(), 0xFFAB47BC.toInt(), 0xFF66BB6A.toInt(), 0xFFFFA726.toInt())+ val bg = android.graphics.Paint(android.graphics.Paint.ANTI_ALIAS_FLAG).apply {+ color = palette[(name.hashCode() and 0x7fffffff) % palette.size]+ }+ canvas.drawCircle(size / 2f, size / 2f, size / 2f, bg)+ val textPaint = android.graphics.Paint(android.graphics.Paint.ANTI_ALIAS_FLAG).apply {+ color = android.graphics.Color.WHITE+ textSize = size * 0.42f+ textAlign = android.graphics.Paint.Align.CENTER+ typeface = android.graphics.Typeface.DEFAULT_BOLD+ }+ val baseline = size / 2f - (textPaint.descent() + textPaint.ascent()) / 2f+ canvas.drawText(initials, size / 2f, baseline, textPaint)+ return IconCompat.createWithBitmap(bitmap)+ } }
install
diff --git a/install b/installindex b81560bb06..cc1e643acb 100755--- a/install+++ b/install@@ -525,19 +525,27 @@ is_system_app() { } install_apk_via_session() {- local apk="$1" package_id="$2"- local apk_name apk_size session device_apk idsig device_idsig commit_out+ local apk="$1" package_id="$2" cur="${3:-}" total="${4:-}"+ local apk_name apk_size apk_mb session device_apk idsig device_idsig commit_out prefix apk_name="$(basename "$apk")" apk_size="$(wc -c < "$apk" | tr -d ' ')"+ apk_mb="$(awk "BEGIN {printf \"%.1f\", $apk_size/1048576}")" device_apk="/data/local/tmp/install_${package_id}.apk"- echo "Installing $package_id ($apk_name)..."+ if [[ -n "$cur" && -n "$total" ]]; then+ prefix="[$cur/$total] "+ else+ prefix=""+ fi+ echo "${prefix}Installing $package_id ($apk_name, ${apk_mb} MB)..."+ echo " ${prefix}[1/4] Pushing APK to device..." "$ADB_BIN" -s "$TARGET_SERIAL" push "$apk" "$device_apk" >/dev/null 2>&1 || {- echo " Error: adb push failed for $apk_name."; return 1+ echo " ${prefix}Error: adb push failed for $apk_name."; return 1 }+ echo " ${prefix}[2/4] Creating install session..." session="$("$ADB_BIN" -s "$TARGET_SERIAL" shell pm install-create -r 2>&1 \ | sed -nE 's/.*created install session \[([0-9]+)\].*/\1/p')" if [[ -z "$session" ]]; then- echo " Error: could not create install session."+ echo " ${prefix}Error: could not create install session." "$ADB_BIN" -s "$TARGET_SERIAL" shell rm -f "$device_apk" >/dev/null 2>&1 return 1 fi@@ -545,8 +553,9 @@ install_apk_via_session() { # matching name. PackageManager enables fs-verity from a staged idsig, which # MAOS/GrapheneOS requires for updates to preinstalled system apps. Plain # `adb install` never stages the sidecar, so those updates always fail.+ echo " ${prefix}[3/4] Staging APK into session $session..." "$ADB_BIN" -s "$TARGET_SERIAL" shell pm install-write -S "$apk_size" "$session" base.apk "$device_apk" >/dev/null 2>&1 || {- echo " Error: failed to stage $apk_name into session $session."+ echo " ${prefix}Error: failed to stage $apk_name into session $session." "$ADB_BIN" -s "$TARGET_SERIAL" shell pm install-abandon "$session" >/dev/null 2>&1 "$ADB_BIN" -s "$TARGET_SERIAL" shell rm -f "$device_apk" >/dev/null 2>&1 return 1@@ -554,25 +563,31 @@ install_apk_via_session() { idsig="$apk.idsig" if [[ -f "$idsig" ]]; then device_idsig="$device_apk.idsig"+ echo " ${prefix}Staging .idsig sidecar..." if "$ADB_BIN" -s "$TARGET_SERIAL" push "$idsig" "$device_idsig" >/dev/null 2>&1; then "$ADB_BIN" -s "$TARGET_SERIAL" shell pm install-write -S "$(wc -c < "$idsig" | tr -d ' ')" \ "$session" base.apk.idsig "$device_idsig" >/dev/null 2>&1 || \- echo " Warning: could not stage .idsig; system-app updates may fail fs-verity."+ echo " ${prefix}Warning: could not stage .idsig; system-app updates may fail fs-verity." else- echo " Warning: could not push .idsig; system-app updates may fail fs-verity."+ echo " ${prefix}Warning: could not push .idsig; system-app updates may fail fs-verity." fi "$ADB_BIN" -s "$TARGET_SERIAL" shell rm -f "$device_idsig" >/dev/null 2>&1 else- echo " Warning: no .idsig sidecar next to the APK; system-app updates may fail fs-verity."+ echo " ${prefix}Warning: no .idsig sidecar next to the APK; system-app updates may fail fs-verity." fi+ echo " ${prefix}[4/4] Committing install session $session..." commit_out="$("$ADB_BIN" -s "$TARGET_SERIAL" shell pm install-commit "$session" 2>&1)" "$ADB_BIN" -s "$TARGET_SERIAL" shell rm -f "$device_apk" >/dev/null 2>&1 # `pm install-commit` prints "Success" but exits 0 either way; fail on absence. if ! echo "$commit_out" | grep -qi "^Success"; then- echo " Error: install failed for $package_id: $commit_out"+ echo " ${prefix}Error: install failed for $package_id: $commit_out" return 1 fi- echo " Installed $package_id."+ if [[ -n "$cur" && -n "$total" ]]; then+ echo " Installed $package_id. [$cur/$total done]"+ else+ echo " Installed $package_id."+ fi } # --- Extra Gradle args: --continue so one broken module doesn't block the rest ---@@ -656,18 +671,26 @@ FAILURES=0 if [[ $BUILD_EXIT -ne 0 ]]; then echo "Warning: assemble reported failures; installing whatever APKs exist." fi+TOTAL=${#NORMALIZED_MODULES[@]}+echo ""+echo "Installing $TOTAL app(s) to $TARGET_SERIAL..." idx=0 while [[ $idx -lt ${#NORMALIZED_MODULES[@]} ]]; do mod="${NORMALIZED_MODULES[$idx]}"+ cur=$((idx + 1)) if apk="$(built_apk "$mod")"; then- install_apk_via_session "$apk" "$(module_application_id "$mod")" || FAILURES=$((FAILURES + 1))+ install_apk_via_session "$apk" "$(module_application_id "$mod")" "$cur" "$TOTAL" || FAILURES=$((FAILURES + 1)) else- echo "Error: no APK found for :${mod} (assemble failed?)."+ echo "[$cur/$TOTAL] Error: no APK found for :${mod} (assemble failed?)." FAILURES=$((FAILURES + 1)) fi idx=$((idx + 1)) done if [[ $FAILURES -gt 0 ]]; then+ echo ""+ echo "Install complete: $((TOTAL - FAILURES))/$TOTAL succeeded, $FAILURES failed." exit 1 fi+echo ""+echo "Install complete: $TOTAL/$TOTAL installed successfully." exit $BUILD_EXIT
install.bat
diff --git a/install.bat b/install.batindex 0f57a7bc7b..1ad2e94a20 100644--- a/install.bat+++ b/install.bat@@ -513,25 +513,30 @@ if ($InstallNeedBump -gt $InstallRepoVersion) { $InstallGradleArgsStr += " -PversionCodeOverride=$InstallNeedBump" } -function Install-ApkViaSession([string]$Apk, [string]$PackageId, [string]$AdbBin, [string]$Serial) {+function Install-ApkViaSession([string]$Apk, [string]$PackageId, [string]$AdbBin, [string]$Serial, [string]$Cur = '', [string]$Total = '') { $InstallApkName = Split-Path -Leaf $Apk $InstallApkSize = (Get-Item -LiteralPath $Apk).Length+ $InstallApkMb = '{0:N1}' -f ($InstallApkSize / 1MB) $InstallDeviceApk = "/data/local/tmp/install_${PackageId}.apk"- Write-Output "Installing $PackageId ($InstallApkName)..."+ $InstallPrefix = ''+ if ($Cur -and $Total) { $InstallPrefix = "[$Cur/$Total] " }+ Write-Output "$InstallPrefix Installing $PackageId ($InstallApkName, ${InstallApkMb} MB)..."+ Write-Output " $InstallPrefix[1/4] Pushing APK to device..." $InstallPrevPref = $ErrorActionPreference $ErrorActionPreference = 'Continue' & $AdbBin -s $Serial push $Apk $InstallDeviceApk >$null 2>&1 if ($LASTEXITCODE -ne 0) { $ErrorActionPreference = $InstallPrevPref- Write-Output " Error: adb push failed for $InstallApkName."+ Write-Output " $InstallPrefix Error: adb push failed for $InstallApkName." return $false }+ Write-Output " $InstallPrefix[2/4] Creating install session..." $InstallCreateOut = & $AdbBin -s $Serial shell pm install-create -r 2>&1 $InstallSession = '' $InstallSm = [regex]::Match(($InstallCreateOut -join "`n"), 'created install session \[([0-9]+)\]') if ($InstallSm.Success) { $InstallSession = $InstallSm.Groups[1].Value } if (-not $InstallSession) {- Write-Output ' Error: could not create install session.'+ Write-Output " $InstallPrefix Error: could not create install session." & $AdbBin -s $Serial shell rm -f $InstallDeviceApk >$null 2>&1 $ErrorActionPreference = $InstallPrevPref return $false@@ -540,9 +545,10 @@ function Install-ApkViaSession([string]$Apk, [string]$PackageId, [string]$AdbBin # matching name. PackageManager enables fs-verity from a staged idsig, which # MAOS/GrapheneOS requires for updates to preinstalled system apps. Plain # `adb install` never stages the sidecar, so those updates always fail.+ Write-Output " $InstallPrefix[3/4] Staging APK into session $InstallSession..." & $AdbBin -s $Serial shell pm install-write -S $InstallApkSize $InstallSession base.apk $InstallDeviceApk >$null 2>&1 if ($LASTEXITCODE -ne 0) {- Write-Output " Error: failed to stage $InstallApkName into session $InstallSession."+ Write-Output " $InstallPrefix Error: failed to stage $InstallApkName into session $InstallSession." & $AdbBin -s $Serial shell pm install-abandon $InstallSession >$null 2>&1 & $AdbBin -s $Serial shell rm -f $InstallDeviceApk >$null 2>&1 $ErrorActionPreference = $InstallPrevPref@@ -551,31 +557,38 @@ function Install-ApkViaSession([string]$Apk, [string]$PackageId, [string]$AdbBin $InstallIdsig = "$Apk.idsig" if (Test-Path -LiteralPath $InstallIdsig -PathType Leaf) { $InstallDeviceIdsig = "$InstallDeviceApk.idsig"+ Write-Output " $InstallPrefix Staging .idsig sidecar..." & $AdbBin -s $Serial push $InstallIdsig $InstallDeviceIdsig >$null 2>&1 if ($LASTEXITCODE -eq 0) { $InstallIdsigSize = (Get-Item -LiteralPath $InstallIdsig).Length & $AdbBin -s $Serial shell pm install-write -S $InstallIdsigSize $InstallSession base.apk.idsig $InstallDeviceIdsig >$null 2>&1 if ($LASTEXITCODE -ne 0) {- Write-Output ' Warning: could not stage .idsig; system-app updates may fail fs-verity.'+ Write-Output " $InstallPrefix Warning: could not stage .idsig; system-app updates may fail fs-verity." } } else {- Write-Output ' Warning: could not push .idsig; system-app updates may fail fs-verity.'+ Write-Output " $InstallPrefix Warning: could not push .idsig; system-app updates may fail fs-verity." } & $AdbBin -s $Serial shell rm -f $InstallDeviceIdsig >$null 2>&1 } else {- Write-Output ' Warning: no .idsig sidecar next to the APK; system-app updates may fail fs-verity.'+ Write-Output " $InstallPrefix Warning: no .idsig sidecar next to the APK; system-app updates may fail fs-verity." }+ Write-Output " $InstallPrefix[4/4] Committing install session $InstallSession..." $InstallCommitOut = & $AdbBin -s $Serial shell pm install-commit $InstallSession 2>&1 & $AdbBin -s $Serial shell rm -f $InstallDeviceApk >$null 2>&1 # `pm install-commit` prints "Success" but exits 0 either way; fail on absence. if (-not (($InstallCommitOut -join "`n") -match '(?im)^Success')) {- Write-Output " Error: install failed for ${PackageId}: $($InstallCommitOut -join ' ')"+ Write-Output " $InstallPrefix Error: install failed for ${PackageId}: $($InstallCommitOut -join ' ')" $ErrorActionPreference = $InstallPrevPref return $false }- Write-Output " Installed $PackageId."+ if ($Cur -and $Total) {+ Write-Output " Installed $PackageId. [$Cur/$Total done]"+ }+ else {+ Write-Output " Installed $PackageId."+ } $ErrorActionPreference = $InstallPrevPref return $true }@@ -625,17 +638,27 @@ $InstallFailures = 0 if ($InstallBuildExit -ne 0) { Write-Output 'Warning: assemble reported failures; installing whatever APKs exist.' }+$InstallTotal = $InstallNormalized.Count+Write-Output ''+Write-Output "Installing $InstallTotal app(s) to $InstallTargetSerial..."+$InstallCur = 0 foreach ($InstallMod in $InstallNormalized) {+ $InstallCur++ $InstallApk = Get-InstallBuiltApk $InstallMod $InstallVariantLc if ($InstallApk) {- if (-not (Install-ApkViaSession $InstallApk (Get-InstallApplicationId $InstallMod) $InstallAdbBin $InstallTargetSerial)) {+ if (-not (Install-ApkViaSession $InstallApk (Get-InstallApplicationId $InstallMod) $InstallAdbBin $InstallTargetSerial "$InstallCur" "$InstallTotal")) { $InstallFailures++ } } else {- Write-Output "Error: no APK found for :${InstallMod} (assemble failed?)."+ Write-Output "[$InstallCur/$InstallTotal] Error: no APK found for :${InstallMod} (assemble failed?)." $InstallFailures++ } }-if ($InstallFailures -gt 0) { exit 1 }+Write-Output ''+if ($InstallFailures -gt 0) {+ Write-Output "Install complete: $($InstallTotal - $InstallFailures)/$InstallTotal succeeded, $InstallFailures failed."+ exit 1+}+Write-Output "Install complete: $InstallTotal/$InstallTotal installed successfully." exit $InstallBuildExit
library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt
diff --git a/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt b/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.ktindex 8eccdd3d08..412a533919 100644--- a/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt+++ b/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt@@ -456,7 +456,7 @@ private fun TemplateRow(row: HostUiRow) { Text(row.texts.joinToString(" · "), maxLines = 2, overflow = TextOverflow.Ellipsis) } },- leadingContent = row.image?.let { { ArtworkTile(it, Modifier.size(56.dp), CAR_SHAPE) } },+ leadingContent = row.image?.let { { ArtworkTile(it, Modifier.size(56.dp), CAR_SHAPE, crop = false) } }, trailingContent = { if (click != null) TextButton(onClick = click) { Text(if (row.browse) "›" else "Open") } },@@ -465,7 +465,12 @@ private fun TemplateRow(row: HostUiRow) { /** Resolves an [IconCompat] to a painter, or a themed placeholder box when absent. */ @Composable-private fun ArtworkTile(icon: IconCompat?, modifier: Modifier, shape: androidx.compose.ui.graphics.Shape) {+private fun ArtworkTile(+ icon: IconCompat?,+ modifier: Modifier,+ shape: androidx.compose.ui.graphics.Shape,+ crop: Boolean = true,+) { val painter: Painter? = when { icon == null -> null // Resource icons render natively (vectors included) even under Layoutlib.@@ -476,7 +481,9 @@ private fun ArtworkTile(icon: IconCompat?, modifier: Modifier, shape: androidx.c else -> rememberIconPainter(icon) } if (painter != null) {- Image(painter, contentDescription = null, contentScale = ContentScale.Crop, modifier = modifier.clip(shape))+ // Album art fills its tile (Crop); row glyphs/avatars show whole (Fit).+ val scale = if (crop) ContentScale.Crop else ContentScale.Fit+ Image(painter, contentDescription = null, contentScale = scale, modifier = modifier.clip(shape)) } else { Box(modifier.clip(shape).background(MaterialTheme.colorScheme.surfaceVariant), contentAlignment = Alignment.Center) { Text("♪", style = MaterialTheme.typography.headlineMedium)
library/map/src/main/rust/src/bridge/pick.rs
diff --git a/library/map/src/main/rust/src/bridge/pick.rs b/library/map/src/main/rust/src/bridge/pick.rsindex 15911dbde5..c209503cce 100644--- a/library/map/src/main/rust/src/bridge/pick.rs+++ b/library/map/src/main/rust/src/bridge/pick.rs@@ -48,8 +48,8 @@ pub extern "system" fn Java_com_vayunmathur_library_map_MapNative_pickLabels<'l> .map(|l| l.id.as_str()) .unwrap_or(""); let s = format!(- "{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}",- layer_id, h.name, h.kind, h.lon, h.lat, h.feature_id,+ "{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}\u{1}{}",+ layer_id, h.name, h.kind, h.lon, h.lat, h.feature_id, h.region_id, ); let Ok(js) = env.new_string(s) else { continue }; let _ = env.set_object_array_element(&out, i as i32, js);
library/map/src/main/rust/src/bridge/region.rs
diff --git a/library/map/src/main/rust/src/bridge/region.rs b/library/map/src/main/rust/src/bridge/region.rsindex 7a1c253a14..06643e073d 100644--- a/library/map/src/main/rust/src/bridge/region.rs+++ b/library/map/src/main/rust/src/bridge/region.rs@@ -6,42 +6,36 @@ use crate::style::Palette; use jni::objects::JClass; use jni::sys::{jboolean, jfloat, jint, jlong}; use jni::JNIEnv;-/// Dim everything outside the region containing this point, and report which one that is.+/// Mask everything outside the region with this id, or clear the mask when it is zero. ///-/// Takes a place's coordinates rather than a region id because nothing in the archive links the-/// two: a city is a `places` **node** with its own OSM id, while its outline is a `boundaries`-/// **relation**, and OSM does not oblige the node to be a member of the relation. Containment is-/// the link - a city label sits inside its own boundary.-///-/// `level_min`/`level_max` are the inclusive OSM `admin_level` band the selection means, and are-/// not optional: every label is contained by a whole stack of regions, so containment alone-/// cannot say whether a tap on "California" meant the state or the county its label sits in.-///-/// Returns the region's OSM relation id, or 0 when no resident tile covers the point. Returning-/// it rather than nothing lets the host tell "no region here" from "not loaded yet" and retry.+/// The id is the tagged OSM relation id of an admin boundary, baked onto the tapped place label at+/// build time (see the `places` region-link table) — so the label names its own outline directly+/// and there is no point/level guess. Returns 1 when the mask is set (or intentionally cleared for+/// a zero id) **and** a resident tile actually carries that region, 0 when the region's tiles are+/// not loaded yet so the host retries next frame. `RegionBuffers::id` is what `record_region_mask`+/// filters on, so once a piece is resident the mask draws. #[no_mangle] pub extern "system" fn Java_com_vayunmathur_library_map_MapNative_setRegionMask<'l>( _env: JNIEnv<'l>, _class: JClass<'l>, handle: jlong,- lon: jfloat,- lat: jfloat,- level_min: jint,- level_max: jint,+ region_id: jlong, ) -> jlong { let Some(map) = handle_mut(handle) else { return 0; };- let levels = (level_min.max(0) as u16)..=(level_max.max(0) as u16);- match map.renderer.region_at(lon as f64, lat as f64, levels) {- Some(id) => {- map.renderer.set_region_mask(Some(id));- id as jlong- }- None => {- map.renderer.set_region_mask(None);- 0- }+ let id = region_id as u64;+ if id == 0 {+ // No linked region: clear the mask and report resolved so the host stops retrying.+ map.renderer.set_region_mask(None);+ return 1;+ }+ map.renderer.set_region_mask(Some(id));+ // Resolved only once a tile carrying this region is resident; until then the host retries.+ if map.renderer.region_resident(id) {+ 1+ } else {+ 0 } }
library/map/src/main/rust/src/tile/geometry/mesh.rs
diff --git a/library/map/src/main/rust/src/tile/geometry/mesh.rs b/library/map/src/main/rust/src/tile/geometry/mesh.rsindex 8a3dde0fe8..2a9e4a9b5a 100644--- a/library/map/src/main/rust/src/tile/geometry/mesh.rs+++ b/library/map/src/main/rust/src/tile/geometry/mesh.rs@@ -126,6 +126,11 @@ pub struct ShapedLabel { /// [`ID_NONE`](tilecodec::mamaps::body::ID_NONE) when its layer carries no id table (every /// layer but `places` and `poi`) or the generator could not attribute it to an OSM element. pub feature_id: u64,+ /// The tagged relation id of the admin boundary this label names, or+ /// [`REGION_NONE`](tilecodec::mamaps::body::REGION_NONE) when the label links to none. Only a+ /// `places` label ever carries a non-zero value; it lets a tap outline that exact region+ /// (`RegionBuffers::id`) instead of guessing one by point + level.+ pub region_id: u64, /// A line feature's centreline in tile-local 0..1, for a **curved** label laid along a road /// or river; `None` for an ordinary point label. ///
library/map/src/main/rust/src/tile/symbol/shape.rs
diff --git a/library/map/src/main/rust/src/tile/symbol/shape.rs b/library/map/src/main/rust/src/tile/symbol/shape.rsindex f429bd5fa6..81b4f88816 100644--- a/library/map/src/main/rust/src/tile/symbol/shape.rs+++ b/library/map/src/main/rust/src/tile/symbol/shape.rs@@ -73,6 +73,12 @@ pub fn shape_label( feature_id: tile .feature_id(layer.source_layer_id, feature_index) .unwrap_or(tilecodec::mamaps::body::ID_NONE),+ // The boundary this label names, baked at build time (relation `label`/`admin_centre`+ // member). Only `places` carries a region-link table; everything else reads back `None`+ // here and so `REGION_NONE`.+ region_id: tile+ .region_link(layer.source_layer_id, feature_index)+ .unwrap_or(tilecodec::mamaps::body::REGION_NONE), // A point label anchors one block; it does not follow a line. centreline: None, })@@ -134,6 +140,8 @@ pub fn shape_line_label( feature_id: tile .feature_id(layer.source_layer_id, feature_index) .unwrap_or(tilecodec::mamaps::body::ID_NONE),+ // A road or river line names no admin region.+ region_id: tilecodec::mamaps::body::REGION_NONE, centreline: Some(centreline), }) }
library/map/src/main/rust/src/tile/symbol/tests_extra.rs
diff --git a/library/map/src/main/rust/src/tile/symbol/tests_extra.rs b/library/map/src/main/rust/src/tile/symbol/tests_extra.rsindex e2b0699004..b20cd2bf20 100644--- a/library/map/src/main/rust/src/tile/symbol/tests_extra.rs+++ b/library/map/src/main/rust/src/tile/symbol/tests_extra.rs@@ -283,6 +283,7 @@ fn icon_label(anchor: (f32, f32)) -> ShapedLabel { sprite: None, kind: 0, feature_id: tilecodec::mamaps::body::ID_NONE,+ region_id: tilecodec::mamaps::body::REGION_NONE, centreline: None, } }
library/map/src/main/rust/src/vulkan/renderer/mod.rs
diff --git a/library/map/src/main/rust/src/vulkan/renderer/mod.rs b/library/map/src/main/rust/src/vulkan/renderer/mod.rsindex 9569cedffe..3c69f022be 100644--- a/library/map/src/main/rust/src/vulkan/renderer/mod.rs+++ b/library/map/src/main/rust/src/vulkan/renderer/mod.rs@@ -383,6 +383,10 @@ pub struct PlacedHit { /// [`ID_NONE`](tilecodec::mamaps::body::ID_NONE) when it has none. Lets the host rejoin the /// hit against its own data without matching on name and position. pub feature_id: u64,+ /// The tagged relation id of the admin boundary this label names, or+ /// [`REGION_NONE`](tilecodec::mamaps::body::REGION_NONE). Lets a tapped label mask that exact+ /// region without the host re-deriving it from point + level.+ pub region_id: u64, /// Anchor lon/lat in degrees. pub lon: f64, pub lat: f64,
library/map/src/main/rust/src/vulkan/renderer/placement.rs
diff --git a/library/map/src/main/rust/src/vulkan/renderer/placement.rs b/library/map/src/main/rust/src/vulkan/renderer/placement.rsindex 4f8a1b3845..8a76ab4bbb 100644--- a/library/map/src/main/rust/src/vulkan/renderer/placement.rs+++ b/library/map/src/main/rust/src/vulkan/renderer/placement.rs@@ -24,74 +24,17 @@ use std::time::Instant; pub(super) const PLACE_REUSE_MS: u128 = 300; impl Renderer {- /// The region whose shape covers this point at the requested administrative level.+ /// Whether any resident tile carries a region-mask piece with this id. ///- /// The caller has a place — a tapped city label or a search result — and needs the relation- /// id of the region it names, which the `places` feature does not carry. Containment is the- /// link: a city label sits inside its own boundary.- ///- /// # Why the level is not optional- ///- /// Containment alone answers the wrong question. Every label sits inside a whole stack of- /// regions — a city inside a county inside a state inside a country — so a point lookup has- /// to be told which rung of that stack the caller means. Preferring the smallest was the- /// first attempt and it picks the deepest rung every time: tapping a state's label selects- /// whichever county the label's anchor happens to land in.- ///- /// `levels` is the inclusive band the selection maps to (see `kind_for` in the tiler's- /// boundary schema, which is what put these numbers in the archive). Within the band the- /// smallest containing shape still wins, so a city inside a larger city resolves inward.- ///- /// Ties are broken by the deeper level and then by the lower id, never by iteration order.- /// A city and the county it is coterminous with have near-identical areas, and leaving that- /// to a hash map's ordering makes the same tap pick differently from one frame to the next.- ///- /// **Only the label's own band is consulted.** There is deliberately no any-level fallback: a- /// city label maps to the city band, and if no boundary in that band contains the point (the- /// city's relation is off-screen, or its anchor sits just outside its own outline) the honest- /// answer is no mask — masking whatever county or state happens to contain the point instead- /// outlines a region the label never named, which is the whole complaint this guards against.- ///- /// `None` when no region in the band covers the point.- pub fn region_at(&self, lon: f64, lat: f64, levels: RangeInclusive<u16>) -> Option<u64> {- self.smallest_containing(lon, lat, &levels)- }-- fn smallest_containing(&self, lon: f64, lat: f64, levels: &RangeInclusive<u16>) -> Option<u64> {- // A region is clipped into one fragment per tile it crosses, and `region.area` is only- // that fragment's area. Comparing fragments across tiles picked whichever tile happened- // to hold the smaller slice, so the masked region flipped as tiles loaded and clipped- // differently. Sum every fragment of an id first, so the comparison is against each- // region's whole on-screen size; then choose the smallest region that actually contains- // the point (containment is only ever true in the one tile the point falls in).- let mut level_of: HashMap<u64, u16> = HashMap::new();- let mut area_of: HashMap<u64, f32> = HashMap::new();- let mut hit: HashMap<u64, bool> = HashMap::new();- for tile in self.tiles.values() {- let local = tile_local(lon, lat, tile.z, tile.x, tile.y);- for region in &tile.regions {- if !levels.contains(®ion.level) {- continue;- }- level_of.insert(region.id, region.level);- *area_of.entry(region.id).or_insert(0.0) += region.area;- if let Some((u, v)) = local {- if region.rings.iter().any(|ring| contains(ring, u, v)) {- hit.insert(region.id, true);- }- }- }- }- // Smallest summed area wins; ties break to the deeper level, then the lower id — a total- // order, so the pick never depends on hash-map iteration.- hit.into_keys().min_by(|&a, &b| {- let area = |id: u64| area_of.get(&id).copied().unwrap_or(0.0);- let level = |id: u64| level_of.get(&id).copied().unwrap_or(0);- area(a)- .total_cmp(&area(b))- .then_with(|| level(b).cmp(&level(a)))- .then(a.cmp(&b))- })+ /// The place->boundary link is baked at build time, so the id is known the instant a label is+ /// tapped — but the boundary's own tiles may still be loading, in which case there is nothing to+ /// draw the mask from yet. The host retries [`setRegionMask`](crate::bridge::region) each frame+ /// until this turns true. Kept a pure lookup over `RegionBuffers::id`, the same key+ /// [`record_region_mask`](super::Renderer::record_region_mask) filters on.+ pub fn region_resident(&self, id: u64) -> bool {+ self.tiles+ .values()+ .any(|tile| tile.regions.iter().any(|region| region.id == id)) } /// The per-frame symbol pre-pass: one collision candidate per shaped label@@ -406,6 +349,7 @@ impl Renderer { // civic one, and so on for all four multi-kind layers. kind: kind_name(label.kind), feature_id: label.feature_id,+ region_id: label.region_id, lon, lat, },@@ -421,34 +365,6 @@ impl Renderer { } } -/// Where `lon`/`lat` falls inside tile `z/x/y`, in tile-local 0..1, or `None` if it is outside.-///-/// Web Mercator, matching the projection the tiler cut the archive with.-fn tile_local(lon: f64, lat: f64, z: u8, x: u32, y: u32) -> Option<(f32, f32)> {- let n = f64::from(1u32 << z);- let sin = lat.to_radians().sin().clamp(-0.9999, 0.9999);- let world_x = (lon + 180.0) / 360.0 * n;- let world_y = (0.5 - ((1.0 + sin) / (1.0 - sin)).ln() / (4.0 * std::f64::consts::PI)) * n;- let u = world_x - f64::from(x);- let v = world_y - f64::from(y);- (0.0..=1.0).contains(&u).then_some(())?;- (0.0..=1.0).contains(&v).then_some(())?;- Some((u as f32, v as f32))-}--/// Even-odd point-in-polygon over a closed ring.-fn contains(ring: &[(f32, f32)], u: f32, v: f32) -> bool {- let mut inside = false;- for window in ring.windows(2) {- let (x0, y0) = window[0];- let (x1, y1) = window[1];- if (y0 > v) != (y1 > v) && u < (x1 - x0) * (v - y0) / (y1 - y0) + x0 {- inside = !inside;- }- }- inside-}- /// Screen-space quad matrix for a globe overlay anchor: the lon/lat's screen /// point (Dp, via [`Camera::globe_anchor_to_screen`]) centred in a `radius_dp` /// quad, in the same shape as [`Camera::screen_quad_to_clip`] so the puck and
maps/VELA_PORT_PLAN.md
diff --git a/maps/VELA_PORT_PLAN.md b/maps/VELA_PORT_PLAN.mddeleted file mode 100644index 08d7cdc822..0000000000--- a/maps/VELA_PORT_PLAN.md+++ /dev/null@@ -1,219 +0,0 @@-# Vela → Modern-Apps Maps: Port Plan (Research + Plan only)--Scope: port Vela's UI/layout, driving/turn-by-turn nav UI, and missing features into the **existing** Modern-Apps (MA) maps app; rework amenities to be **Google-only** on a **custom overlay layer**.--**KEEP (do not replace):** MA's MapLibre/PMTiles **renderer**, MA's on-device Rust **routing** engine + live-nav stack, and the already-added Google POI enrichment (`data/google/` + `PoiEnrichment.kt`).-**Voice:** system TTS only (MA already has `NavigationTts.kt`); do **not** port Vela's Piper/neural synth.-**Lint:** `RawScaffoldInApp` → use shared `library/ui` scaffolds; trademark strings ("Google", etc.) stay non-translatable.--Vela paths below are relative to the clone root (removed after research; never committed). MA paths are under `maps/src/main/java/com/vayunmathur/maps/`.-------## (a) Vela inventory — UI / driving nav / POI layer (file refs)--**Renderer (matches MA family):** MapLibre Native `org.maplibre.gl:android-sdk:11.8.0`, imperative API (not Compose bindings). Base style = OpenFreeMap Liberty (OMT schema) remote URL. `core/.../data/tiles/MapStyle.kt`. PMTiles used for overlays (buildings, maxspeed, offline regions).--**Map view / renderer wrapper:** `app/.../ui/map/VelaMapView.kt` (6013 lines) — the imperative MapLibre wrapper. Key mechanics:-- **Suppress native basemap POIs:** set `visibility = NONE` on Liberty POI layers `poi_r1, poi_r7, poi_r20, poi_transit` (`VelaMapView.kt:781-788`, re-asserted in `applyData` ~`:1150-1195`).-- **Custom Google-POI overlay ("ambient"):** `GeoJsonSource AMBIENT_SRC` + `SymbolLayer AMBIENT_LAYER` (icons) + `AMBIENT_DOT_LAYER` (dots) built at `:3234-3345`; category icons from `PoiIcons` (`vela-poi-<group>` runtime bitmaps). Consts `:139-143`, `:183`.-- **Search-result pins:** `GeoJsonSource MARKERS_SRC` + `SymbolLayer MARKERS_LAYER`/`MARKERS_DOTS_LAYER` (`:3140-3160`). Model `data class MapMarker(name, location, category, prominence, rating, fuelPrice)` (`:221`).-- **Tap handling:** `handleTap` (`:1857-2004`) → `map.queryRenderedFeatures(RectF, layers…)`; priority parking → own pins (`MARKER_INDEX_PROP`) → saved → GTFS stop → **ambient Google vs basemap POI by screen distance** (`:1905-1946`) → house-number → building; fires `onAmbientTap(index)` / `markerTap(index)` / `onPoiTap(name, latlng, kind)`. Registered `map.addOnMapClickListener { handleTap(it) }` (`:2004`).-- **Nav camera:** heading-up + tilt + close follow, eased; two-finger tilt/shove, re-center tick to drop overrides (`:283-292, :481-540, :585-640, :1215-1290`). Uses `CameraPosition.bearing/tilt`.-- **Posted speed limit:** poll `queryRenderedFeatures` on hosted **maxspeed PMTiles** overlay under the puck (`:967-1003`), parsed by `core/.../data/OsmMaxspeed.kt`.-- POI icon factory: `app/.../ui/map/PoiIcons.kt` — `applyToLiberty` (`:435`), `resultIconKey/resultBubbleLabel`, `ensureResultIcon`, `addResultDot`, `colorFor(group)`, `GROUPS` category→color/glyph map.--**Map screen layout:** `app/.../ui/map/MapScreen.kt` (259 KB) — `MapScreen(...)`, `SearchResults`, `CategoryChips`, `ChooseOnMapOverlay`, `SearchEntryContent`, shortcut/saved rows, `SpeedWidget` (speedometer), `ScaleBarReader`, cards (voice/region download, faster-route, notices), `ListsSheet`. Scale bar: `app/.../ui/map/ScaleBar.kt`. Layers button: `app/.../ui/LayersButton.kt`. Compass toggle wired via `onCompassTap` (north-up/heading-up during drive).--**Search UX:** `app/.../ui/search/SearchBar.kt` (`SearchBar(...)`), results/chips in `MapScreen.SearchResults`/`CategoryChips`. Geocode/search data via Google source (below) + `core/.../data/PhotonGeocoder.kt`, `RecentSearchStore`, `CategoryFilter.kt`.--**Place-details sheet:** `app/.../ui/place/PlaceSheet.kt` (235 KB) — `PlaceSheet`, `DirectionsPanel`, `RouteOption`, photos gallery, reviews, hours, popular times, transit boards. Support: `RouteTopCard.kt`, `StopsEditor.kt`, `PlaceContent.kt`, `RatingStars.kt`, `LiveReviews.kt`.--**Driving / turn-by-turn nav UI:** `app/.../ui/nav/`-- `NavOverlays.kt` (42 KB): `ManeuverBanner` (with `FitText`), `LaneGuide`/`LaneDiagram` (lane arrows), `SignChip`/`roadSigns` (road shields), `NavControls`, `ArrivalSummary`, `NavSearchChips`.-- `RouteShield.kt`: US route/state shields (`RouteShield`, `ShieldBadge`, `StateMarker`).-- `StepsSheet.kt`: full turn list (`StepsSheet`, `maneuverIcon`).-- Speedometer + posted limit: `MapScreen.SpeedWidget` + `app/.../ui/Format.kt formatSpeedLimit`.-- Nav logic (reference only — MA keeps its own): `core/.../nav/NavEngine.kt`, `NavSession.kt`, `NavModels.kt`, `Heading.kt`.-- Voice: `core/.../voice/VoiceGuide.kt` uses **Android `TextToSpeech`** as primary (`import android.speech.tts.TextToSpeech`); Piper/`NeuralSynth`/`PiperCatalog`/`VelaPiper` are the optional neural path we **skip**. Guidance text: `SpokenScript.kt`, `SpeechText.kt`.--**Google data source (reference for search + POIs):** `core/.../data/google/GoogleMapsDataSource.kt` (58 KB) implements `MapDataSource`: `search(query, near, span, rankFrom)`, `nearbyPlaces(center, span, onPartial)` (drives ambient layer), `placeDetails(id)`, `reverseGeocode`, `reviews`, `placePhotos`, `directions`, `streetView`. Ranking `ambientProminence(place)` / `rankAmbientPlaces`. Parsers in `core/.../data/google/parse/*` and `SearchParser.kt`, `DirectionsParser.kt`, `PolylineCodec.kt`, `PbBuilder.kt`. Ambient state fed as `ambientPois: List<Place>` from `MapViewModel` → `VelaMapView(ambientPois=…, onAmbientTap=…)`.--**Saved / layers / settings:** saved: `core/.../data/SavedPlaceStore.kt`, `PlaceListStore.kt`, `RecentPlaceStore.kt` + `SavedPlacesSettings.kt`; saved pins layer `SavedPin` in `VelaMapView.kt:240`. Layers toggle: `LayersButton.kt`, `SatelliteLayer.kt`, `TransitLayer.kt`, `Traffic.kt`, `Topography.kt`, `Buildings3d.kt`. Settings: `app/.../ui/settings/*` (`SettingsHub`, `MapSettings`, `NavigationSettings`, `VoiceSettings`, `SearchSettings`, `OfflineSettings`, `AboutSettings`, …).-------## (b) Existing MA app inventory--**Renderer — CONFIRMED:** MapLibre Native via **`maplibre-compose`** (`org.maplibre.compose.*`, **declarative** Compose layers) over **PMTiles vector tiles** (Protomaps schema). NOT the raster-only `library/map` module.-- Map entry: `ui/MapPage.kt:326` `MaplibreMap(...)`; overlay layer tree `ui/MyMapLayers.kt:47` (`SymbolLayer`/`CircleLayer`/`LineLayer`/`FillLayer`, `GeoJsonSource`/`rememberVectorSource`).-- Base style: asset `maps/src/main/assets/style.json` (v8, 3544 lines) loaded `MapPage.kt:159-169` → `BaseStyle.Json`; source = `pmtiles://https://data.vayunmathur.com/v4.pmtiles`. Runtime online/offline duplication in `patchStyleForHybrid()` `MapPage.kt:545-597` (creates `*_base`/`*_hybrid` layer variants). Disk tile cache `util/MapTileCache.kt`.-- **(a) Hide native POIs:** NO runtime visibility API. Native POI symbol layer is `id:"pois"` (`style.json:2684-2748`, `source-layer:"pois"`); place labels `places_locality`/`places_country`/`places_region`. Suppress by dropping/filtering `pois` in `style.json` and/or in `patchStyleForHybrid`.-- **(b) Custom overlay + tap:** SUPPORTED. Add `GeoJsonSource`+`SymbolLayer` in `MyMapLayers.kt` (existing pattern). Tap hit-test: `onMapClick` `MapPage.kt:335-366` → `camera.projection.queryRenderedFeatures(offset, setOf(...))` → `parse(...)`.-- **Camera:** bearing/tilt/follow already used in nav: `MapPage.kt:281-306` (`bearing = courseOverGround, tilt = 60, zoom = 17`, `autoFollow`, user-pan detect via `camera.isCameraMoving`). Recenter FAB `NavigationOverlay.kt:115-126`.--**amenities.db — to REMOVE (usages):**-- Def/schema/builder: `data/Tag.kt` (`AmenityTag`, `TagDao`, `AmenityEntity`, `AmenityDao.getInBBox` FTS5, `AddressResult`/`AddressDao.search` FTS5 geocoder, `@Database AmenityDatabase`, `buildAmenityDatabase → createFromFile(amenities.db)`). Exported schema `maps/schemas/com.vayunmathur.maps.data.AmenityDatabase/1.json`.-- Repo: `data/AmenityRepository.kt`.-- Download (not bundled): `MainActivity.kt:60` Triple `https://data.vayunmathur.com/amenities.db`.-- Search flow: `util/MapsSearchViewModel.kt` (`getInBBox`, `searchAddresses`, `resolveAmenity`, `SearchResult.Amenity/.Address`); `ui/SearchPage.kt:39,57,63,90`.-- Details flow: `data/SpecificFeature.kt:40-96` (`parse(...)` → `db.tagDao().getTags(id)` for Restaurant/TransitStop/GenericPlace).-- Map tap enrichment: `ui/MapPage.kt:66,69,338-353` (`parse(raw, AmenityRepository.get(context).getDatabase())`).-- Build: `build.gradle.kts:6,42-43` (`ksp` + `implementRoom` — drop only if Room unused elsewhere). Strings: `res/values/strings.xml:110` `downloading_amenity_database`, `:33` `unnamed_amenity`.-- ⚠️ **Removing the DB kills ALL text search AND address geocoding** (`Addresses_fts`). No other geocoder exists → a Google-based search/geocode replacement is REQUIRED (see P3 / Decision D2).--**Routing — KEEP:** on-device **Rust A\*** router `libofflinerouter.so` (`util/OfflineRouter.kt`; rust in `maps/src/main/rust/src/{routing,graph,geometry,mvt,state,lib}.rs`). Outputs full turn-by-turn: `RouteService.Route{duration, distanceMeters, polyline, step[]}`, `Step{…, navInstruction, travelMode, transitDetails, speedRatio}`, maneuver enum `RouteService.kt:16`, icons `ui/ManeuverIcon.kt`. Live nav already exists: `util/NavigationSessionManager.kt` (snap/off-route/arrival/recalc), `util/NavigationService.kt` (foreground svc), `util/NavigationTts.kt` (**system TTS**), `util/PolylineProgress.kt` (ETA/remaining/next-maneuver), `ui/NavigationOverlay.kt` (maneuver card + ETA strip + recenter + arrival). Requests: `util/SelectedFeatureViewModel.kt:89-118`. Rendered: `MyMapLayers.buildRouteFeatures:335-431` → `LineLayer "route"`.--**Current UI:** scaffold `ui/MapPage.kt:308-511` (BottomSheetScaffold + AppScaffold + MaplibreMap); collapsed search bar `:433-440`; full search `ui/SearchPage.kt`; VM/contract `util/MapsSearchViewModel.kt`, `util/MapsUiContract.kt`; bottom sheet `ui/BottomSheetContent.kt` (`RouteSheet:130-242`); place detail `ui/RestaurantBottomSheet.kt`; nav overlay `ui/NavigationOverlay.kt`; downloads `ui/DownloadedMapsPage.kt`.--**Google POI code — KEEP + build on:**-- `data/google/GooglePoiDataSource.kt` — keyless scrape (ported from Vela). `fetch(name, lat, lon): GooglePoiInfo?` (cached LRU 64, 250 m match), `fetchReviews(featureId)`. Endpoints: `search?tbm=map` (`:45`, pb template `:359-378`), reviews RPC (`:47`), session warm (`:49`). `pickEntry`/`parsePlace` already parse `LAT/LNG/NAME/CATEGORY/RATING` per entry (`:167-215`) but **keep only the nearest single match**.-- `data/google/GooglePoiModels.kt` — `GooglePoiInfo{rating, reviewCount, priceText/Level, website, phone, openNow, statusText, category, editorialSummary, featuredReview, hours[], photoUrls[], reviews[], popularTimes, featureId}` (⚠️ **no id / no lat-lng / no name** — caller supplies position). `GoogleReview`, `PoiPopularTimes`.-- `data/google/GoogleResponse.kt` — XSSI strip + positional accessors.-- `ui/PoiEnrichment.kt` — `GooglePoiEnrichment(poi, hasOsmHours)` composable (subtitle/editorial/hours/photos/popular-times/reviews/attribution). Driven by `SelectedFeatureViewModel.currentPoiInfo` (`:68-85`), rendered in `RestaurantBottomSheet.kt`. **Only in the sheet — not on the map.**-------## (c) Gap analysis (Vela vs MA)--| Area | Vela | MA today | Gap → action |-|---|---|---|---|-| Renderer | MapLibre **imperative** + PMTiles | MapLibre **compose** + PMTiles | Same engine; Vela overlay/nav code is a **pattern port** (translate imperative `addLayer/queryRenderedFeatures` → maplibre-compose declarative layers + `camera.projection`). |-| Native POI suppression | `visibility=NONE` on `poi_r*` at runtime | none (baked style) | Filter/drop `pois` layer in `style.json`/`patchStyleForHybrid`. |-| Amenity source | Google (`GoogleMapsDataSource`) + OSM/Overpass | **amenities.db (OSM)** | Remove DB; make Google-only. |-| POIs on map | ambient Google `SymbolLayer` + dots + tap | **none** (pins come from vector tiles only) | **Build** custom Google-POI overlay + tap→sheet. |-| Search/geocode | Google search + Photon | amenities.db FTS + address FTS | **Replace** with Google search list (generalize `pickEntry`) + Google reverse-geocode. |-| Search-result pins | `MARKERS_LAYER` from search | route/user layers only | Add result-pin layer. |-| Routing | Google directions + on-device fallback | **on-device Rust A\*** (keep) | Reuse MA routing; only borrow UI. |-| Turn-by-turn nav UI | Rich: maneuver banner + **lane guidance** + **road shields** + **speedometer + posted limit** + arrival panel + heading-up compass toggle | Basic maneuver card + ETA strip + recenter + arrival | **Port** the richer nav overlays onto MA's existing nav session. |-| Posted speed limit | maxspeed PMTiles + queryRenderedFeatures | none | Add maxspeed source OR derive from route (Decision D4). |-| Voice | system TTS (+Piper optional) | **system TTS** (`NavigationTts`) | Keep MA's; optionally port voice toggle UI. |-| Place details | `PlaceSheet` (photos/reviews/hours/popular times/directions) | `RestaurantBottomSheet` + `GooglePoiEnrichment` | Port richer layout, keep MA enrichment data. |-| Map layout | search bar + category chips + FAB stack + scale bar + compass + speed widget | search bar + chips + nav overlay | Port layout polish (scale bar, compass toggle, FAB stack, category chips). |-| Saved/layers/settings | full stores + layers button + settings hub | partial | Port incrementally (P6). |-------## (d) Phased port plan (each phase independently shippable)--### P1 — Amenities → Google-only custom overlay layer-**Goal:** remove `amenities.db`, suppress native basemap POIs, render Google POIs as tappable pins → existing Google details.-**Vela refs:** `VelaMapView.kt` POI-hide `:781-788`; ambient source/layers `:3234-3345`; tap resolution `:1905-1946`; `MapMarker` `:221`; `PoiIcons.kt` (`resultIconKey`, `colorFor`, `vela-poi-<group>`); `GoogleMapsDataSource.nearbyPlaces` (viewport fetch) + `ambientProminence`.-**MA — ADD:**-- `data/google/GooglePoiMapModels.kt` — list-oriented `GooglePoiPin{id, name, lat, lng, category, rating, prominence}` (fills the id/latlng/name gap in `GooglePoiModels.kt`).-- `data/google/GooglePoiDiscovery.kt` — generalize existing `pickEntry`/`parsePlace` (`GooglePoiDataSource.kt:167-215`) to return **List** for a viewport/near query (nearby/search).-- `ui/GooglePoiLayer.kt` — maplibre-compose `GeoJsonSource` + `SymbolLayer` (+ dot layer) for pins, styled from category (port `PoiIcons` grouping to Compose image assets or generated bitmaps).-- POI-pin viewport fetch in a VM (new `util/GooglePoiMapViewModel.kt` or extend `SelectedFeatureViewModel`), keyed on camera idle bbox (reuse `queryVisibleBoundingBox()`).-**MA — CHANGE:**-- `style.json` (`pois` `:2684-2748`) and/or `patchStyleForHybrid` (`MapPage.kt:545-597`): drop/empty-filter the `pois` layer (and `_base`/`_hybrid` variants).-- `MapPage.kt` `onMapClick` `:335-366`: add Google-pin hit-test (query the new pin layer first) → `SelectedFeatureViewModel.set(...)` so `GooglePoiEnrichment` renders; remove the `pois` tile-feature branch + `AmenityRepository.getDatabase()` enrichment (`:66,69,338-353`).-- `MyMapLayers.kt`: mount the new POI-pin layer.-**MA — REMOVE:** `data/Tag.kt`, `data/AmenityRepository.kt`, `schemas/com.vayunmathur.maps.data.AmenityDatabase/`, `MainActivity.kt:60` download, amenity/tag branches in `data/SpecificFeature.kt` + `util/MapsSearchViewModel.kt` (amenity parts) + `ui/SearchPage.kt` (amenity parts), strings `:110,:33`, and `ksp`/`implementRoom` in `build.gradle.kts` **iff** Room unused elsewhere (verify first).-**Reuse:** MA renderer (declarative layers, `queryRenderedFeatures`), existing `GooglePoiDataSource`/`PoiEnrichment`.-**Decisions:** D1 (native POI hide method: edit `style.json` vs runtime filter in `patchStyleForHybrid`); D3 (pin fetch trigger: camera-idle bbox vs fixed radius; caching/quota for scrape); D5 (pin icon rendering: port `PoiIcons` bitmaps vs Compose `SymbolLayer` images). **Note:** address geocoding also dies here — either ship P1 with search still on the DB (remove DB only after P3) or sequence P3 before fully deleting `AddressDao`. Recommend: P1 removes amenity **map/details** paths + suppresses POIs + adds overlay, but keep DB search until P3, then delete.--### P2 — Map-screen layout to match Vela-**Goal:** match Vela's browse layout/polish.-**Vela refs:** `MapScreen.kt` (`MapScreen`, `CategoryChips`, `SearchEntryContent`, `ScaleBarReader`), `ScaleBar.kt`, `LayersButton.kt`, compass toggle (`onCompassTap`), FAB stack.-**MA — ADD:** `ui/MapScaleBar.kt`, `ui/CompassButton.kt` (heading-up/north-up toggle bound to `CameraState.bearing`), `ui/CategoryChips.kt`, `ui/LayersButton.kt`.-**MA — CHANGE:** `MapPage.kt:308-511` scaffold — arrange search bar + chips + FAB stack (locate/layers/compass) + scale bar per Vela; use `library/ui` scaffold (avoid `RawScaffoldInApp`).-**Reuse:** renderer camera (`MapPage.kt:281-306`).-**Decisions:** D6 (which controls surface on browse vs nav; FAB order).--### P3 — Search UX (Google-only)-**Goal:** replace DB search/geocode with Google; Vela search look.-**Vela refs:** `SearchBar.kt`, `MapScreen.SearchResults`/`CategoryChips`, `GoogleMapsDataSource.search`/`reverseGeocode`, `RecentSearchStore.kt`, `CategoryFilter.kt`.-**MA — ADD:** `data/google/GoogleSearchDataSource.kt` (search list + reverse-geocode via generalized discovery), `data/RecentSearchStore.kt`.-**MA — CHANGE:** `util/MapsSearchViewModel.kt` + `util/MapsUiContract.kt` (results from Google, drop `SearchResult.Amenity/.Address`), `ui/SearchPage.kt` (Vela-style results/chips, remove `AmenityRepository`).-**MA — REMOVE (final):** the remaining `amenities.db` search/geocode paths + `AddressDao`/`AmenityDao` (completes P1's deferred deletion).-**Reuse:** existing scrape/parse infra.-**Decisions:** D2 (geocode replacement: Google reverse-geocode scrape reliability/quota; offline-search story — DB removal drops offline search, confirm acceptable), D7 (debounce/session tokens for scrape).--### P4 — Place-details sheet layout-**Goal:** Vela `PlaceSheet` layout, MA data.-**Vela refs:** `PlaceSheet.kt` (`PlaceSheet`, `DirectionsPanel`, `RouteOption`, photo gallery, reviews, popular times), `RatingStars.kt`, `RouteTopCard.kt`.-**MA — ADD/CHANGE:** rework `ui/RestaurantBottomSheet.kt` → `ui/PlaceSheet.kt` layout; keep `GooglePoiEnrichment` (`PoiEnrichment.kt`) + `currentPoiInfo` as the data source; wire "Directions" to MA routing (`SelectedFeatureViewModel.routes`).-**Reuse:** `GooglePoiInfo`, MA routing, `BottomSheetContent.RouteSheet`.-**Decisions:** D8 (which Google fields are reliably scraped for the header/gallery).--### P5 — Driving / turn-by-turn nav UI (MA routing + system TTS)-**Goal:** upgrade MA's nav overlay to Vela's richness on top of MA's existing nav session.-**Vela refs:** `NavOverlays.kt` (`ManeuverBanner`, `LaneGuide`/`LaneDiagram`, `SignChip`/`roadSigns`, `NavControls`, `ArrivalSummary`), `RouteShield.kt`, `StepsSheet.kt`, `MapScreen.SpeedWidget`, `Format.formatSpeedLimit`, compass heading-up toggle.-**MA — ADD:** `ui/nav/ManeuverBanner.kt`, `ui/nav/LaneGuidance.kt`, `ui/nav/RouteShield.kt`, `ui/nav/StepsSheet.kt`, `ui/nav/SpeedWidget.kt` (speedometer + posted-limit badge), `ui/nav/ArrivalSummary.kt`.-**MA — CHANGE:** `ui/NavigationOverlay.kt` compose the new banners; `MapPage.kt` nav camera already heading-up/tilt (`:281-306`) — add compass north-up toggle + re-center override reset (port Vela's `navRecenterTick` idea). Feed from `PolylineProgress` (`distanceToNextManeuver`, `etaEpochMs`) + `RouteService.Step.navInstruction`/maneuver enum + `speedRatio`.-**MA — REUSE (do not port):** `NavigationSessionManager`, `NavigationService`, `NavigationTts` (system TTS), Rust routing, `PolylineProgress`, `ManeuverIcon`.-**Skip from Vela:** Piper/`NeuralSynth`/`PiperCatalog`/`VelaPiper`/`VoiceLibrary`.-**Decisions:** D4 (posted speed limit source: add a maxspeed PMTiles overlay + `queryRenderedFeatures` like Vela `:967-1003`, vs derive from route `speedRatio`/graph, vs omit); D9 (lane-guidance data: Rust router currently has no lane info → either extend graph output or hide `LaneDiagram` until available); D10 (road-shield data: derive from `roadName`/ref parsing).--### P6 — Saved places, layers toggle, settings + remaining features-**Goal:** feature parity extras.-**Vela refs:** `SavedPlaceStore.kt`, `PlaceListStore.kt`, `RecentPlaceStore.kt`, `SavedPlacesSettings.kt`, saved-pin layer (`SavedPin`); `LayersButton.kt` + `SatelliteLayer`/`TransitLayer`/`Traffic`/`Topography`/`Buildings3d`; `settings/*` hub.-**MA — ADD:** `data/SavedPlaceStore.kt` + saved-pin overlay layer; `ui/LayersSheet.kt` (satellite/traffic/transit toggles — MA already has `traffic-layer` in `MyMapLayers.kt:122-137`); `ui/settings/MapSettings.kt` etc. as needed.-**MA — CHANGE:** mount saved-pin layer in `MyMapLayers.kt`; add saved-pin tap → sheet in `onMapClick`.-**Reuse:** existing traffic layer + renderer.-**Decisions:** D11 (satellite/transit tile sources & keys); D12 (settings scope for v1).--### P7 — Google Street View (keyless, reuse photos app renderer)-<<<<<<< Updated upstream-**Goal:** add Street View panorama viewing. RENDERER DECISION (user): REUSE the photos app's panorama renderer rather than porting Vela's.--**CORRECTED (task 6).** The first pass read "the photos app's renderer" as its flat pan/zoom image viewer, but the photos app has two panorama viewers and the correct one is `PanoramaSphereView` — an equirectangular pano is not a flat image and must be projected onto the inside of a sphere. That renderer has now been lifted into `:library:ui` as `PanoramaSphere` (+ `PanoramaCrop`) and BOTH apps call it; photos keeps a thin wrapper that supplies its XMP `GPano` crop and decodes from a content Uri.-**Vela refs (data only, NOT the renderer):** `core/.../data/google/StreetViewParser.kt` (keyless pano metadata: panoId, lat/lng, links/neighbors, date, heading), `StreetViewTiles.kt` (equirect tile fetch/stitch by zoom), `GoogleMapsDataSource.streetView`. Skip Vela's `PanoramaView.kt` — the photos app's sphere renderer replaces it.-**MA — ADD:** `data/google/StreetViewDataSource.kt` (port StreetViewParser + equirect tile fetch/stitch via :library:network — keyless pano metadata + tiles → one equirect bitmap), `ui/streetview/StreetViewScreen.kt` (full-screen viewer projecting the equirect bitmap onto `PanoramaSphere`; full-bleed `TopAppBarOverlay`; move between adjacent panos via links).-**MA — CHANGE (task 6):** Street View is NO LONGER reachable from the place-details sheet. Its one entry point is `ui/streetview/StreetViewPegman.kt` — a Pegman-style chip you drag off the map chrome and drop on a point, projected through the camera and resolved by nearest-pano lookup. It must stay a direct child of the unpadded box `MapSurface` fills or every drop is offset by the chrome inset. No coverage overlay during the drag: `StreetViewDataSource` exposes coverage only as a per-point network lookup, not a tile layer, so a miss is reported on drop instead.-**Reuse:** the shared `PanoramaSphere` renderer (`:library:ui`), existing Google scrape infra, library/ui.-=======-**Goal:** add Street View panorama viewing. RENDERER DECISION (user): do NOT port Vela's bespoke GLES 2.0 sphere — instead REUSE the photos app's existing image viewer/renderer to display the equirectangular pano (pan/zoom), which is simpler and consistent with the suite. The P7 agent must locate the photos app's image-viewer component (photos/src/main/java/... the zoom/pan image display used in its editor/gallery) and reuse it for the pano image.-**Vela refs (data only, NOT the renderer):** `core/.../data/google/StreetViewParser.kt` (keyless pano metadata: panoId, lat/lng, links/neighbors, date, heading), `StreetViewTiles.kt` (equirect tile fetch/stitch by zoom), `GoogleMapsDataSource.streetView`. Skip Vela's `PanoramaView.kt` (GLES sphere) — replaced by the photos renderer.-**MA — ADD:** `data/google/StreetViewDataSource.kt` (port StreetViewParser + equirect tile fetch/stitch via :library:network — keyless pano metadata + tiles → one equirect bitmap), `ui/streetview/StreetViewScreen.kt` (full-screen viewer using the PHOTOS APP's image renderer/viewer to pan/zoom the equirect bitmap; shared library/ui scaffold; move between adjacent panos via links).-**MA — CHANGE:** Street View entry points — from the place-details sheet (P4 `PlaceSheet`) when a pano exists, and optionally a long-press-on-map "Street View here"; nearest-pano lookup by lat/lng.-**Reuse:** the photos app image viewer (renderer), existing Google scrape infra, library/ui, library/image.-<<<<<<< Updated upstream->>>>>>> Stashed changes-=======->>>>>>> Stashed changes-- **Defaults applied (no further input needed):** D1 runtime POI-hide (filter in `patchStyleForHybrid`, OTA-swappable); D-arch port as maplibre-compose **declarative** layers; D3/D7 debounced + LRU-cached viewport scrape; D5 pin icons as Compose `SymbolLayer` images/generated bitmaps; D10 road shields derived from road name/ref.-------## EXTENSIONS (added after initial sign-off) — P8–P13 + AA + PMTiles--- **P8 — System STT voice search:** add voice search to maps using the SYSTEM SpeechRecognizer (backed by the MA speech app) — no in-app STT. Mic button in the search bar → system STT → query.-- **P9 — Parking memory:** port Vela's `ParkingStore` — save current location as parking spot (+ note/photo/timer optional), a map pin + "find my car" recall + history. Local persistence.-- **P10 — Public transit departure boards:** integrate Transitous (open GTFS/GTFS-RT) departure boards (Vela `core/.../data/transit/Transitous.kt`); show nearby stops + live departures in a sheet.-- **P11 — Offline transit routing (feasibility spike → build if viable):** investigate offline transit routing from the SAME Transitous/GTFS data used for the boards — ingest GTFS (per-region) + a CSA/RAPTOR journey-planner (Rust preferred, JVM ok; NO hand-written C++). Report feasibility/size before full build; if viable, implement per-region offline transit routing. NOTE: this requires the DOWNLOADABLE OFFLINE REGION PACKS to include GTFS/transit data — so the `scripts/maps` OFFLINE-PACK generator (the one that builds the downloadable region files: routing graph + tiles) must be EDITED to bundle per-region GTFS (stops/trips/stop_times/calendars, compacted for on-device use). The spike must (a) locate the current offline-pack generator in scripts/maps, (b) design the GTFS-in-pack format + the on-device transit routing index, (c) report size/feasibility, then build the generator change + the Rust/JVM transit router + app wiring.-- **P12 — Android Auto (maps navigation):** CarAppService (nav category) driving MA's existing routing/nav session; render map frames without MapLibre MapSnapshotter if it needs anything C++-authored (use the existing renderer/tiles). System TTS for guidance.-- **P13 — Safety/road-furniture + admin borders BAKED INTO the custom PMTiles (not runtime Overpass):** the new PMTiles file gains layers for ALPR/speed cameras, stop signs, traffic signals, AND country/state/city borders. The maps app renders safety layers from tiles (toggle) and reads borders from tiles — then DELETE the `.fgb` border files + their loading code. Requires the new PMTiles (below).- - **MUST PRESERVE the search→highlight behavior:** today, selecting/searching a country/state/city dims everything outside its boundary (inverted mask via `createInvertedMask` in `MyMapLayers`, built from the FULL admin0/admin1 FGB polygons in `CountryMap.kt`). After swapping to the v5 `admin_country/admin_region/admin_city` VECTOR-TILE layers, searching a city/country/state name MUST still highlight that outline/area equivalently. CAVEAT: vector tiles clip geometry per-tile, so the exact inverted mask needs the selected feature's full geometry — reconstruct it (querySourceFeatures/queryRenderedFeatures on the admin_* layer filtered by ISO_A2 / iso_3166_2 / name, unioned across tiles) OR use an equivalent boundary-outline + translucent-fill highlight that matches the old UX. Acceptance: search a city/state/country → its area highlights just like before FGB. Match by the v5 keys (admin_country=ISO_A2, admin_region=iso_3166_2, admin_city=name) that CountryMap.kt used.- - For the CA TEST: point the base/style + MaxspeedSource at `pmtiles://https://data.vayunmathur.com/v5-ca.pmtiles` (built+verified). Production needs a global v5 (same pipeline, big box). Note deleting .fgb + pointing at CA-only v5 means borders/highlight only cover CA until a global v5 is hosted.-- **PMTiles generator (`scripts/maps/`):** a pipeline script producing the new `vN.pmtiles` = current base schema + safety/road-furniture features + admin borders (country/state/city). Replaces the current `v4.pmtiles` + the `.fgb` border files. The SCRIPT is the deliverable (running the full planet build is the user's infra step).--**Android Auto app scope (user):** maps (P12) + Music (media). Candidates flagged for user: youpipe (audio media), communicate (messaging). Music AA is independent of the maps phases and can build in parallel.--- **P14 — Map dark/light style by app theme:** the basemap should switch light↔dark with the app theme (DynamicTheme / isSystemInDarkTheme + the P6 day-night setting; decouple-from-OS optional like Vela's AMOLED/light/dark). PREFERRED approach: apply a dark color palette at RUNTIME inside the existing `patchStyleForHybrid` (MapPage.kt) — a per-layer light→dark paint mapping (background/earth/landcover/landuse/water/roads/buildings/boundaries + label/POI text+halo) — so we don't duplicate the 3544-line style.json; re-apply on theme change (reload style). ALT: a hand-tuned `style_dark.json` asset selected by theme. Must keep all P1/P3/P5/P6 runtime layers (POI suppression, Google pins, search pins, route line, safety/maxspeed) working in both palettes. Runs AFTER P6 (both touch MapPage/settings).--**Extension sequencing:** PMTiles generator + Music AA are independent (parallelizable now). P8/P9/P10/P12/P13 are maps-app changes → run AFTER P5/P6 (avoid MapPage collisions). P11 is a spike first. P13 depends on the new PMTiles existing.-------## Suggested sequencing--## Cross-cutting decisions (need answers before coding)-- **D1** Native-POI hide: static `style.json` edit vs runtime filter in `patchStyleForHybrid`. (Recommend runtime, so it stays OTA-swappable.)-- **D2** Geocoding after DB removal: Google reverse-geocode scrape only? Accept loss of **offline** search/geocode?-- **D3/D7** Scrape quota/caching/debounce for viewport POI fetch + search (keyless scrape rate limits).-- **D4** Posted speed limit source (maxspeed PMTiles overlay vs route-derived vs omit).-- **D5** POI pin icon rendering (port `PoiIcons` bitmap factory vs Compose `SymbolLayer` images).-- **D9/D10** Lane guidance + road shields need data the Rust router may not emit — extend router output or ship UI degraded.-- **D-arch** Port Vela's imperative MapLibre overlay code as **maplibre-compose declarative** layers (recommended, matches MA) vs reach through to raw `MapLibreMap`.--## Suggested sequencing-P1 (map/details Google-only + suppress POIs, keep DB search) → P3 (Google search, then delete DB) → P2 (layout) → P4 (details) → P7 (street view, entry from the map peg) → P5 (nav UI) → P6 (extras). P1 and P3 are the critical path (they own DB removal); P2/P4/P7/P5/P6 are largely independent afterward.-------## CONFIRMED DECISIONS (user sign-off)-- **D2 / offline search:** ACCEPT online-only (Google) search. Removing `amenities.db` intentionally drops offline search + geocoding; no offline fallback. All search + reverse-geocode = Google scrape.-- **D4 / posted speed limit:** ADD a real maxspeed data source (maxspeed PMTiles overlay + `queryRenderedFeatures` under the puck, like Vela `VelaMapView.kt:967-1003` + `OsmMaxspeed.kt`). The driving UI shows accurate posted limits (P5).-- **D9 / lane guidance:** EXTEND the Rust router (`maps/src/main/rust/`) to emit lane info so Vela's lane diagrams work (P5; can be prepped early since it's isolated from the UI phases).-- **Defaults applied (no further input needed):** D1 runtime POI-hide (filter in `patchStyleForHybrid`, OTA-swappable); D-arch port as maplibre-compose **declarative** layers; D3/D7 debounced + LRU-cached viewport scrape; D5 pin icons as Compose `SymbolLayer` images/generated bitmaps; D10 road shields derived from road name/ref.
maps/src/main/java/com/vayunmathur/maps/MainActivity.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/MainActivity.kt b/maps/src/main/java/com/vayunmathur/maps/MainActivity.ktindex f9207f23b8..5057d4deb3 100644--- a/maps/src/main/java/com/vayunmathur/maps/MainActivity.kt+++ b/maps/src/main/java/com/vayunmathur/maps/MainActivity.kt@@ -155,7 +155,7 @@ class MainActivity : ComponentActivity() { if (link.navigate) navigateTo(link) else openPlace(link) } - /** Select a place from the link and open its bottom pane (Vela place-card). */+ /** Select a place from the link and open its bottom pane. */ private fun openPlace(link: MapLink) { val lat = link.lat val lng = link.lng
maps/src/main/java/com/vayunmathur/maps/data/MapLinkParser.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/MapLinkParser.kt b/maps/src/main/java/com/vayunmathur/maps/data/MapLinkParser.ktindex dc9f9bf190..f7bcea174c 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/MapLinkParser.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/MapLinkParser.kt@@ -6,7 +6,7 @@ import java.net.URLDecoder /** * A target extracted from an external `geo:` / `google.navigation:` URI or a * Google-Maps web link, so this app can be the system maps handler on a- * de-Googled phone (mirrors Vela's MapLinkParser, extended for turn-by-turn).+ * de-Googled phone (extended for turn-by-turn). * * [zoom] is the caller's requested camera zoom (`geo:...?z=17`, `/@lat,lng,15z`) * when it carried one. [navigate] is true for `google.navigation:` and Google
maps/src/main/java/com/vayunmathur/maps/data/OsmMaxspeed.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/OsmMaxspeed.kt b/maps/src/main/java/com/vayunmathur/maps/data/OsmMaxspeed.ktindex 0bf1e2eb2e..165ff3be21 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/OsmMaxspeed.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/OsmMaxspeed.kt@@ -20,8 +20,7 @@ private const val MPH_TO_KMH = 1.609344 * unrecognised country schemes, blank, …). * * Handles the common forms: bare `"50"` (km/h), `"50 mph"`, `"30 km/h"`, and a- * subset of implicit country schemes like `"DE:urban"`. Faithful to Vela's- * `OsmMaxspeed` behaviour: unknown/relative values degrade to `null` rather+ * subset of implicit country schemes like `"DE:urban"`. Unknown/relative values * than guessing. */ fun parseMaxspeed(raw: String?): PostedLimit? {
maps/src/main/java/com/vayunmathur/maps/data/ParkingStore.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/ParkingStore.kt b/maps/src/main/java/com/vayunmathur/maps/data/ParkingStore.ktindex 0e90d849bf..0babaff0c2 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/ParkingStore.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/ParkingStore.kt@@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json /**- * A remembered parking spot (P9, Vela's `ParkingStore`): where the user left+ * A remembered parking spot: where the user left * their car, when, and an optional note. Only what we need to drop a pin, * recall the spot, and route back to it. */
maps/src/main/java/com/vayunmathur/maps/data/RecentSearchStore.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/RecentSearchStore.kt b/maps/src/main/java/com/vayunmathur/maps/data/RecentSearchStore.ktindex 775b638314..e1131ddcce 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/RecentSearchStore.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/RecentSearchStore.kt@@ -8,7 +8,7 @@ import kotlinx.serialization.json.Json /** * Persists the user's most-recent search queries so the search page can offer- * them before any text is typed (Vela's `RecentSearchStore` analog).+ * them before any text is typed. * * Backed by a single JSON-encoded ordered string list in [DataStoreUtils] (a * plain preferences string, not the removed amenities.db): most-recent first,
maps/src/main/java/com/vayunmathur/maps/data/SavedPlaceStore.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/SavedPlaceStore.kt b/maps/src/main/java/com/vayunmathur/maps/data/SavedPlaceStore.ktindex 571abac022..06af38b025 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/SavedPlaceStore.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/SavedPlaceStore.kt@@ -10,7 +10,7 @@ import kotlinx.serialization.json.Json * `SavedPlacesViewModel` so the store logic lives in one place: * * - **Saved** — a flat starred list the user builds from the place sheet.- * - **Lists** — named collections (Vela's `PlaceListStore`), e.g. "Trip",+ * - **Lists** — named collections, e.g. "Trip", * "Favorites"; a map of list-name → places. * * Each field is a small JSON string in DataStore. The store is deliberately thin
maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDataSource.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDataSource.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDataSource.ktindex 1245bcd9b7..e472b97b02 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDataSource.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDataSource.kt@@ -15,10 +15,9 @@ import kotlin.math.sqrt /** * Keyless Google Maps POI enrichment. *- * Ported from Vela (github.com/PimpinPumpkin/Vela), which follows the NewPipe- * model: the device calls the same undocumented google.com/maps web endpoints a- * logged-out browser does — no API key, no Vela/first-party backend, no Play- * Services. The request is a `pb` protobuf-ish string; the response is a+ * Follows the NewPipe model: the device calls the same undocumented google.com/maps+ * web endpoints a logged-out browser does — no API key, no first-party backend,+ * no Play Services. The request is a `pb` protobuf-ish string; the response is a * guard-prefixed, deeply nested *positional* JSON array (no field names). The * calibrated index paths ([Paths]) pull rating/reviews/hours/price/website/ * photos/popular-times out of it.@@ -39,7 +38,7 @@ import kotlin.math.sqrt */ object GooglePoiDataSource { - // Endpoints (calibrated 2026-06, Vela). hl/gl pinned to en/us so the parser's+ // Endpoints (calibrated 2026-06). hl/gl pinned to en/us so the parser's // English status keywords line up with the response text. private const val SEARCH_ENDPOINT = "https://www.google.com/search?tbm=map&authuser=0&hl=en&gl=us"@@ -339,7 +338,7 @@ object GooglePoiDataSource { return r * 2 * atan2(sqrt(a), sqrt(1 - a)) } - /** Build the search `pb`. Calibrated template (Vela, 2026-06): a plain `q=`+ /** Build the search `pb`. Calibrated template (2026-06): a plain `q=` * returns an empty envelope, so search needs this full pb, and results are * viewport-driven (the `!2d<lng>!3d<lat>` block is the OSM point). */ private fun buildSearchPb(query: String, lat: Double, lon: Double): String =@@ -370,7 +369,7 @@ object GooglePoiDataSource { "!2e2!3m1!3b1!61b1!67m5!7b1!10b1!14b1!15m1!1b0!69i782!77b1" /**- * Calibrated positional field-index paths (Vela DEFAULT_PATHS, 2026-06),+ * Calibrated positional field-index paths (2026-06), * relative to a result *entry* whose place node is `[1]` (RESULTS/SINGLE are * relative to the response root). A Google reshape moves these; when that * happens each accessor returns null and the affected field simply drops out.
maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDiscovery.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDiscovery.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDiscovery.ktindex da94650531..7029efad61 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDiscovery.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/GooglePoiDiscovery.kt@@ -24,7 +24,7 @@ import kotlin.math.log2 * keep the WHOLE list and map each entry to a [GooglePoiPin] (id + lat/lng + * name + category + rating) so the pins can be drawn and tapped. *- * COVERAGE (ported from Vela `GoogleMapsDataSource.nearbyPlaces`, 2026-06): a+ * COVERAGE: a * single wide "points of interest" query returns only the ~20 most prominent * places over a ~25 km baked window, so a strip mall shows almost none of its * small businesses. To match what Google Maps actually renders we instead:@@ -36,7 +36,7 @@ import kotlin.math.log2 * roughly doubles local coverage; * - ask for a DEEPER pool per term (`!7i60`, up from 20) so the take-N cap can * reach smaller POIs;- * - dedup by feature id and rank prominence-first (Vela `ambientProminence`),+ * - dedup by feature id and rank prominence-first, * so recognizable landmarks win the label slot but the small restaurant you * zoomed next to still survives the (raised) cap. *@@ -61,7 +61,7 @@ object GooglePoiDiscovery { private const val TAG = "GooglePoiDiscovery" - // Same calibrated endpoints/identity as GooglePoiDataSource (Vela, 2026-06).+ // Same calibrated endpoints/identity as GooglePoiDataSource (2026-06). private const val SEARCH_ENDPOINT = "https://www.google.com/search?tbm=map&authuser=0&hl=en&gl=us" private const val SESSION_WARM_URL = "https://www.google.com/maps?hl=en&gl=us"@@ -75,7 +75,7 @@ object GooglePoiDiscovery { ) /**- * Category fan-out terms (Vela `nearbyPlaces.allTerms`). "places" is the+ * Category fan-out terms. "places" is the * broad ambient query; the rest pull the tiers a single prominent-biased * query under-returns so the map shows a Google-like MIX (a gas station, a * gym, a grocer, a small restaurant) rather than only the few big names.@@ -156,7 +156,7 @@ object GooglePoiDiscovery { private suspend fun fetch(lat: Double, lon: Double, span: Double): List<GooglePoiPin> = withContext(Dispatchers.IO) { warmSession()- // Match the zoom to the tightened window (Vela: span 25229 ↔ zoom 13.1).+ // Match the zoom to the tightened window (span 25229 ↔ zoom 13.1). val zoom = (13.1 + log2(25229.0 / span)).coerceIn(13.0, 17.5) val pool = coroutineScope { FANOUT_TERMS.map { term ->@@ -208,7 +208,7 @@ object GooglePoiDiscovery { /** * Dedup by feature id (the same place returned under several terms) then rank * for the map: prominence-first, exact distance from the viewport centre only- * as a tiebreak (Vela `rankAmbientPlaces`). The recognizable landmarks lead+ * as a tiebreak. The recognizable landmarks lead * and win the label slot; the low-signal junk the fan-out drags in sinks and * is dropped by the caller's take-N cap. */@@ -219,7 +219,7 @@ object GooglePoiDiscovery { .thenBy { metersBetween(lat, lon, it.lat, it.lng) }, ) - /** Vela's `ambientProminence`: review count dominates (log-compressed so a+ /** Prominence score: review count dominates (log-compressed so a * mega-chain doesn't utterly bury everything), nudged by rating so among * similarly-popular places the better-rated wins. */ private fun prominenceOf(rating: Double?, reviews: Int): Double =@@ -247,7 +247,7 @@ object GooglePoiDiscovery { } /** Build the viewport `pb`: substitute the query + centre, then tighten the- * baked span/zoom/pool tokens to this fetch (Vela `nearbyPlaces`): `!1d` =+ * baked span/zoom/pool tokens to this fetch: `!1d` = * ground span in metres, `!4f` = matching zoom, `!7i` = the deeper pool. */ private fun buildViewportPb( query: String,
maps/src/main/java/com/vayunmathur/maps/data/google/GoogleResponse.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleResponse.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleResponse.ktindex 7b641de9c7..f395b12e0f 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleResponse.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleResponse.kt@@ -21,7 +21,7 @@ import kotlinx.serialization.json.longOrNull * hard-coded `[0][1][3]` path silently rots — so every access degrades to null * and the enrichment feature just disappears rather than crashing the sheet. *- * Ported from Vela's GoogleResponse (calibrated against maps.google.com 2026-06).+ * Ported response-shape helpers (calibrated against maps.google.com 2026-06). */ internal object GoogleResponse { private val json = Json { ignoreUnknownKeys = true; isLenient = true }
maps/src/main/java/com/vayunmathur/maps/data/google/GoogleSearchDataSource.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleSearchDataSource.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleSearchDataSource.ktindex 727371fb3b..58980d1fce 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleSearchDataSource.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/GoogleSearchDataSource.kt@@ -46,7 +46,7 @@ object GoogleSearchDataSource { private const val TAG = "GoogleSearchDataSource" - // Same calibrated endpoints/identity as GooglePoiDataSource (Vela, 2026-06).+ // Same calibrated endpoints/identity as GooglePoiDataSource (2026-06). private const val SEARCH_ENDPOINT = "https://www.google.com/search?tbm=map&authuser=0&hl=en&gl=us" private const val SESSION_WARM_URL = "https://www.google.com/maps?hl=en&gl=us"@@ -60,7 +60,7 @@ object GoogleSearchDataSource { ) /** Cap the result list so a broad query ("coffee") doesn't return a huge- * list — matches the ~20 rows a Vela search surfaces. */+ * list — matches the ~20 rows a search surfaces. */ private const val MAX_RESULTS = 20 @Volatile private var sessionWarmed = false@@ -117,7 +117,7 @@ object GoogleSearchDataSource { /** * Resolve the response to a list of result *entries* whose place node is at- * `[1]`, mirroring Vela's `SearchParser.parse` resolution order so an ADDRESS+ * `[1]`, mirroring the resolution order so an ADDRESS * query resolves too (not just POI names/categories): * 1. the `[64]` POI list — a name/category search ("restaurants"); * 2. [Paths.AT_THIS_PLACE] — a bare address that IS a business ("1020 Olive@@ -234,9 +234,9 @@ object GoogleSearchDataSource { val LNG = intArrayOf(1, 9, 3) val CATEGORY = intArrayOf(1, 13, 0) val FEATURE_ID = intArrayOf(1, 10)- // Businesses listed at a geocoded address (Vela `atThisPlace`).+ // Businesses listed at a geocoded address. val AT_THIS_PLACE = intArrayOf(0, 1, 0, 14, 68)- // Full formatted address (Vela `address` = [1][39]); ADDRESS_LINES is the+ // Full formatted address ([1][39]); ADDRESS_LINES is the // component array fallback. val ADDRESS = intArrayOf(1, 39) val ADDRESS_LINES = intArrayOf(1, 2)
maps/src/main/java/com/vayunmathur/maps/data/google/ReviewsWebParser.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/ReviewsWebParser.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/ReviewsWebParser.ktindex df87fb4c4d..9360e181fc 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/ReviewsWebParser.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/ReviewsWebParser.kt@@ -13,7 +13,7 @@ import kotlinx.serialization.json.jsonPrimitive * behind a `batchexecute` RPC (`rpcids=T4jwAf`) whose proto resisted capture, so we read the * reviews the real browser engine renders instead. *- * Ported from Vela (github.com/PimpinPumpkin/Vela); emits OUR [GoogleReview] model. Each element is+ * Parses OUR [GoogleReview] model from the reviews JSON. Each element is * `{rid:reviewId, r:rating, a:author, d:relativeDate, t:text, av:avatarUrl, p:[photoUrls]}` — `rid` * is the scraper's cross-scroll de-dup key, ignored here. An element without an author is dropped * (a card whose name never resolved isn't renderable). Best-effort: a malformed blob → empty list.
maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewDataSource.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewDataSource.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewDataSource.ktindex bcd11b479d..7e6d75ffea 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewDataSource.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewDataSource.kt@@ -22,7 +22,7 @@ import kotlin.math.sqrt /** * Keyless Google Street View. *- * Ported from Vela (data layer only): the device calls the same undocumented+ * Keyless data layer: the device calls the same undocumented * endpoints a logged-out browser / the JS Maps API does — no API key, authorised * by a browser-like `User-Agent` + `Referer`. Two metadata endpoints feed one * parser (both return a deeply nested *positional* JSON array, no field names):@@ -84,7 +84,7 @@ object StreetViewDataSource { private val json = Json { ignoreUnknownKeys = true; isLenient = true } private val PANO_ID = Regex("^[A-Za-z0-9_-]{20,25}$") - // Neighbour de-clutter (Vela): drop same-spot historical panos, cap walk+ // Neighbour de-clutter: drop same-spot historical panos, cap walk // reach, keep only the nearest pano per direction bucket. private const val SAME_SPOT_M = 4.0 private const val MAX_WALK_M = 45.0@@ -219,8 +219,7 @@ object StreetViewDataSource { /** * Parse a SingleImageSearch / photometa response into a [StreetViewPano]. * [lat]/[lng] are the fallback position used only when the response omits one.- * Only the pano id is required; everything else degrades to null. Ported from- * Vela's StreetViewParser (SF capture 2026-07-15).+ * Only the pano id is required; everything else degrades to null. */ private fun parsePano(raw: String, lat: Double, lng: Double): StreetViewPano? { val root = runCatching { json.parseToJsonElement(unwrap(raw)) }.getOrNull() ?: return null
maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewModels.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewModels.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewModels.ktindex 31f427fbfb..deaad54eb9 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewModels.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/StreetViewModels.kt@@ -11,9 +11,6 @@ package com.vayunmathur.maps.data.google * `512·2^z` wide by `256·2^z` tall, cut into [tileSize]² tiles — but the shape is * NOT fixed (pre-2016 captures are `416·2^z`), so [levelDims] carries the pano's * own per-level dimensions and the tile loader sizes its grid from THOSE.- *- * Ported from Vela's `StreetViewPano` (model only; the renderer is the shared- * `PanoramaSphere` from `:library:ui`). */ data class StreetViewPano( val panoId: String,
maps/src/main/java/com/vayunmathur/maps/data/google/WebReviewsFetcher.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/data/google/WebReviewsFetcher.kt b/maps/src/main/java/com/vayunmathur/maps/data/google/WebReviewsFetcher.ktindex 50f9f6d605..0b536e908a 100644--- a/maps/src/main/java/com/vayunmathur/maps/data/google/WebReviewsFetcher.kt+++ b/maps/src/main/java/com/vayunmathur/maps/data/google/WebReviewsFetcher.kt@@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger * **deleted** the old `listentitiesreviews` endpoint (now HTTP 404) and moved reviews behind a * `batchexecute` RPC (`rpcids=T4jwAf`) whose request proto resisted capture. *- * Ported from Vela (github.com/PimpinPumpkin/Vela). Rather than replay that RPC, we let Google's+ * Rather than replay that RPC, we let Google's * own JS render the reviews (loading the place's canonical `?cid=` page, anonymous/no-login, * desktop UA) and read them back out of the DOM: per review the star rating, author, relative date, * text **and the reviewer's uploaded photos**. The page builds a JSON array over a JS bridge;@@ -173,7 +173,7 @@ class WebReviewsFetcher(private val context: Context) { wv.settings.domStorageEnabled = true // Desktop UA so Google serves the desktop web Maps (a mobile UA deep-links to intent://). wv.settings.userAgentString = GooglePoiDataSource.USER_AGENT- wv.addJavascriptInterface(Bridge(), "VelaBridge")+ wv.addJavascriptInterface(Bridge(), "ReviewsBridge") // Give the hidden (never-attached) WebView a REAL offscreen viewport. Google's reviews list is // virtualized + lazy-loaded off the scroll viewport; a 0×0 headless WebView renders the chrome // (rating histogram, topic filters) but NEVER the review cards. A tall explicit layout makes the@@ -197,7 +197,7 @@ class WebReviewsFetcher(private val context: Context) { * ACCUMULATING each review card into a keyed set (Google virtualizes the panel — it recycles * DOM nodes as you scroll, so any single snapshot holds only ~10 cards; the union across scroll * positions is the full list). Bridges the accumulated JSON array back once the list is exhausted- * or the cap is hit. Ported verbatim from Vela — the fragile part. */+ * or the cap is hit. */ private fun extractScript(id: String): String { val idj = "\"" + id.replace("\\", "\\\\").replace("\"", "\\\"") + "\"" return """@@ -327,8 +327,8 @@ class WebReviewsFetcher(private val context: Context) { // bar) AND the accumulated reviews themselves, so the sheet fills in under the bar // while the scrape grinds instead of making the user stare at a bar for 30 s. if(accN!==lastRep){ lastRep=accN;- try{ VelaBridge.onProgress(ID, accN); }catch(e){}- try{ VelaBridge.onPartial(ID, JSON.stringify(snap())); }catch(e){}+ try{ ReviewsBridge.onProgress(ID, accN); }catch(e){}+ try{ ReviewsBridge.onPartial(ID, JSON.stringify(snap())); }catch(e){} } // Are review cards rendered RIGHT NOW? On busy business pages (food, retail) the Reviews // tab's list can take ~8 s to populate after the click; until then the panel holds only@@ -362,7 +362,7 @@ class WebReviewsFetcher(private val context: Context) { // Done: cap hit, OR settled at the bottom with no new reviews, OR provably empty, // OR ran long. if( accN>=CAP || (settled && idle) || emptyDone || tries>130 ){- try{ VelaBridge.onResult(ID, JSON.stringify(snap())); }catch(e){ try{ VelaBridge.onResult(ID,'[]'); }catch(e2){} }+ try{ ReviewsBridge.onResult(ID, JSON.stringify(snap())); }catch(e){ try{ ReviewsBridge.onResult(ID,'[]'); }catch(e2){} } return; } setTimeout(tick, 250);
maps/src/main/java/com/vayunmathur/maps/ui/CategoryChips.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/CategoryChips.kt b/maps/src/main/java/com/vayunmathur/maps/ui/CategoryChips.ktindex f01a5becb1..59f91c9b07 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/CategoryChips.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/CategoryChips.kt@@ -39,7 +39,7 @@ data class MapCategory( /** * Shared quick-category definitions, reused by both the browse map screen and- * the search page so the two stay in lock-step (Vela's `CategoryChips`). On the+ * the search page so the two stay in lock-step. On the * browse map a chip FILTERS the drawn POI layers to its [MapCategory.kinds]; * on the search page it runs the [MapCategory.query] Google search (P3). *
maps/src/main/java/com/vayunmathur/maps/ui/CompassButton.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/CompassButton.kt b/maps/src/main/java/com/vayunmathur/maps/ui/CompassButton.ktindex 477bea7606..47c730db69 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/CompassButton.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/CompassButton.kt@@ -12,7 +12,7 @@ import kotlin.math.abs * from north). The compass rose rotates to keep pointing at true north; tapping * it calls [onResetNorth] to snap the camera back to a north-up orientation. *- * Port of Vela's `onCompassTap`: the control only surfaces while the map is+ * The control only surfaces while the map is rotated — at (near) north-up * rotated — at (near) north-up there's nothing to reset, so it hides itself. */ @Composable
maps/src/main/java/com/vayunmathur/maps/ui/LayersButton.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/LayersButton.kt b/maps/src/main/java/com/vayunmathur/maps/ui/LayersButton.ktindex c19d45e2d5..a7ae8b64bb 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/LayersButton.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/LayersButton.kt@@ -7,7 +7,7 @@ import com.vayunmathur.library.ui.SmallFloatingActionButton /** * Minimal map-layers entry point in the browse FAB stack. For P2 this is just- * the button surface (Vela's `LayersButton`); the full layer-toggle sheet+ * the button surface; the full layer-toggle sheet (satellite / traffic / * (satellite / traffic / transit) lands in P6, which wires [onClick] to open it. */ @Composable
maps/src/main/java/com/vayunmathur/maps/ui/MapScaleBar.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/MapScaleBar.kt b/maps/src/main/java/com/vayunmathur/maps/ui/MapScaleBar.ktindex fba86c7546..aded5956cc 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/MapScaleBar.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/MapScaleBar.kt@@ -27,7 +27,7 @@ import kotlin.math.roundToInt * "nice" round distance (1 / 2 / 5 × 10ⁿ) that fits within a fixed on-screen * width and draws a labelled bar for it. *- * Port of Vela's `ScaleBar`/`ScaleBarReader` — kept declarative so it just reads+ * Kept declarative so it just reads `camera.position.zoom` / * `camera.position.zoom` / `camera.position.target.latitude` from the caller. */ @Composable
maps/src/main/java/com/vayunmathur/maps/ui/NavigationOverlay.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/NavigationOverlay.kt b/maps/src/main/java/com/vayunmathur/maps/ui/NavigationOverlay.ktindex 0e8323d4fc..dcac546e44 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/NavigationOverlay.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/NavigationOverlay.kt@@ -59,7 +59,7 @@ import com.vayunmathur.library.ui.R as UiR /** * Full-screen overlay drawn on top of [VectorMap][com.vayunmathur.library.map.VectorMap] while navigation is- * active. Renders the Vela-style rich driving UI on top of MA's existing nav+ * active. Renders a rich driving UI on top of MA's existing nav * session: a maneuver banner (with lane guidance + route shields), a * speedometer with posted-limit badge, an expandable step list, the bottom ETA * strip, nav controls (recenter + north-up compass toggle), and an
maps/src/main/java/com/vayunmathur/maps/ui/ParkingLayer.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/ParkingLayer.kt b/maps/src/main/java/com/vayunmathur/maps/ui/ParkingLayer.ktindex 06fd7fddf8..34f6f5612b 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/ParkingLayer.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/ParkingLayer.kt@@ -19,7 +19,7 @@ import com.vayunmathur.library.ui.Text import com.vayunmathur.maps.data.ParkingSpot /** Pin id — hit-tested in MapSurface.onMapClick so tapping the parking pin- * opens the parking sheet (Vela's parking pin). */+ * opens the parking sheet. */ const val PARKING_PIN_LAYER_ID = "parking-pin" /** Parking blue, distinct from the saved-place and search-result pins. */
maps/src/main/java/com/vayunmathur/maps/ui/SatelliteLayer.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/SatelliteLayer.kt b/maps/src/main/java/com/vayunmathur/maps/ui/SatelliteLayer.ktindex 9a34cf0014..09c4a753f5 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/SatelliteLayer.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/SatelliteLayer.kt@@ -3,14 +3,11 @@ package com.vayunmathur.maps.ui import androidx.compose.runtime.Composable /**- * Satellite / aerial imagery layer (P6), ported conceptually from Vela's- * `SatelliteLayer`.+ * Satellite / aerial imagery layer (P6). * * ⚠️ GATED — NO TILE SOURCE YET: [TILE_URL] is intentionally blank. MA's basemap * is vector (the streamed PMTiles archive, now rendered by our own Vulkan renderer);- * there is no hosted satellite/aerial raster tileset, and the Vela clone that- * referenced Google's imagery was removed after research (see- * `maps/VELA_PORT_PLAN.md`, Decision D11). While unavailable the layers sheet+ * there is no hosted satellite/aerial raster tileset. While unavailable the * hides the satellite toggle and this composable renders nothing. * * To activate: host an XYZ raster tileset, set [TILE_URL] to it, and draw it here
maps/src/main/java/com/vayunmathur/maps/ui/SavedPlacesLayer.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/SavedPlacesLayer.kt b/maps/src/main/java/com/vayunmathur/maps/ui/SavedPlacesLayer.ktindex 43e23b972d..4078603f1d 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/SavedPlacesLayer.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/SavedPlacesLayer.kt@@ -24,7 +24,7 @@ import kotlinx.serialization.json.doubleOrNull import kotlinx.serialization.json.jsonPrimitive /** Pin id — hit-tested in MapSurface.onMapClick so a tapped saved pin- * re-selects that place (Vela's `SavedPin`). */+ * re-selects that place. */ const val SAVED_PLACE_LAYER_ID = "saved-place-pins" private val PIN_SIZE = 26.dp@@ -34,7 +34,7 @@ private val PIN_SIZE = 26.dp private val SAVED_PLACE_COLOR = Color(0xFF1A73E8) /**- * Saved-place overlay (Vela's `SavedPin`): the starred list drawn as plain+ * Saved-place overlay: the starred list drawn as plain * Compose over VectorMap. Tap → details via [toSelectedSavedPlace], reusing * [SpecificFeature.GenericPlace] so the existing enrichment + place sheet render with no new * detail path.
maps/src/main/java/com/vayunmathur/maps/ui/SearchResultLayer.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/SearchResultLayer.kt b/maps/src/main/java/com/vayunmathur/maps/ui/SearchResultLayer.ktindex 6a7c0d335c..a95f50b44b 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/SearchResultLayer.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/SearchResultLayer.kt@@ -29,7 +29,7 @@ private val PIN_SIZE = 26.dp private val GLYPH_SIZE = 8.dp /**- * Search-result pin overlay (Vela's `MARKERS_LAYER` analog): the Google search results drawn+ * Search-result pin overlay: the Google search results drawn * as plain Compose over VectorMap. Distinct from the ambient POI overlay so search pins read * as "your results" (a single accent colour) rather than the category-coloured ambient POIs. * Tap → details via [toSelectedSearchResult].
maps/src/main/java/com/vayunmathur/maps/ui/nav/ArrivalSummary.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/nav/ArrivalSummary.kt b/maps/src/main/java/com/vayunmathur/maps/ui/nav/ArrivalSummary.ktindex 70eb031230..02e766002a 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/nav/ArrivalSummary.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/nav/ArrivalSummary.kt@@ -23,7 +23,7 @@ import com.vayunmathur.library.ui.Text import com.vayunmathur.maps.R /**- * End-of-trip arrival card (Vela's `ArrivalSummary`). Shows a confirmation with+ * End-of-trip arrival card. Shows a confirmation with * the destination name (when known) and a dismiss action that tears down the * navigation session. */
maps/src/main/java/com/vayunmathur/maps/ui/nav/LaneGuidance.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/nav/LaneGuidance.kt b/maps/src/main/java/com/vayunmathur/maps/ui/nav/LaneGuidance.ktindex f85dc4ea90..003fb70be0 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/nav/LaneGuidance.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/nav/LaneGuidance.kt@@ -23,7 +23,7 @@ import com.vayunmathur.maps.util.RouteService import com.vayunmathur.maps.util.RouteService.API.Maneuver /**- * Lane-guidance strip (Vela's `LaneDiagram`). Renders one cell per available+ * Lane-guidance strip. Renders one cell per available * turn lane at the upcoming junction, derived by the Rust router (P5a). Lanes * that lead onto the taken route are highlighted; the rest are dimmed. *
maps/src/main/java/com/vayunmathur/maps/ui/nav/ManeuverBanner.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/nav/ManeuverBanner.kt b/maps/src/main/java/com/vayunmathur/maps/ui/nav/ManeuverBanner.ktindex 2c67cd09fb..7100d8b9f3 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/nav/ManeuverBanner.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/nav/ManeuverBanner.kt@@ -29,7 +29,7 @@ import com.vayunmathur.maps.util.RouteService import com.vayunmathur.maps.util.formatDistance /**- * Rich turn maneuver banner (Vela's `ManeuverBanner`). Shows the upcoming+ * Rich turn maneuver banner. Shows the upcoming * maneuver icon, distance-to-maneuver, the primary instruction (with a route * shield when the road carries a ref), a "then" peek at the following * maneuver, and a lane-guidance strip from the Rust router's lane data (P5a).
maps/src/main/java/com/vayunmathur/maps/ui/nav/SpeedWidget.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/nav/SpeedWidget.kt b/maps/src/main/java/com/vayunmathur/maps/ui/nav/SpeedWidget.ktindex 128392fd5d..aaf41a3785 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/nav/SpeedWidget.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/nav/SpeedWidget.kt@@ -28,7 +28,7 @@ private const val MPS_TO_KMH = 3.6 private const val MPS_TO_MPH = 2.2369363 /**- * Speedometer + posted-limit badge (Vela's `SpeedWidget` + `formatSpeedLimit`).+ * Speedometer + posted-limit badge. * * Shows the current GPS ground speed in a rounded pill, and — when a posted * limit is available from the maxspeed overlay (P5b) — a circular red-ringed
maps/src/main/java/com/vayunmathur/maps/ui/nav/StepsSheet.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/nav/StepsSheet.kt b/maps/src/main/java/com/vayunmathur/maps/ui/nav/StepsSheet.ktindex 7f222961d3..46d1450493 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/nav/StepsSheet.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/nav/StepsSheet.kt@@ -30,7 +30,7 @@ import com.vayunmathur.maps.util.RouteService import com.vayunmathur.maps.util.formatDistance /**- * Full turn-by-turn step list (Vela's `StepsSheet`). Shows every remaining+ * Full turn-by-turn step list. Shows every remaining * maneuver with its icon, instruction, and distance. Steps already passed are * dimmed. Rendered as an overlay card the driver can dismiss. */
maps/src/main/java/com/vayunmathur/maps/util/GooglePoiMapViewModel.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/GooglePoiMapViewModel.kt b/maps/src/main/java/com/vayunmathur/maps/util/GooglePoiMapViewModel.ktindex 91e2ebbc26..a3e51b7750 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/GooglePoiMapViewModel.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/GooglePoiMapViewModel.kt@@ -145,8 +145,8 @@ class GooglePoiMapViewModel(application: Application) : AndroidViewModel(applica val cap = if (closeZoom) MAX_PINS_CLOSE else MAX_PINS_FAR // The (padded, per-zoom) ground span the fan-out should request — the- // vertical extent of the box scaled by the prefetch pad, in metres. Vela- // tightens `!1d` to this so a strip mall's small POIs come back instead of+ // vertical extent of the box scaled by the prefetch pad, in metres.+ // `!1d` is tightened to this so a strip mall's small POIs come back instead of // only the ~20 most prominent over a baked ~25 km window. val spanMeters = (vp.north - vp.south) * prefetchScale * METERS_PER_DEG_LAT @@ -228,7 +228,7 @@ class GooglePoiMapViewModel(application: Application) : AndroidViewModel(applica // close zoom so local/small POIs (restaurants) from the category fan-out // aren't filtered away. Raised from the old 60/200 now that the fetch // returns a comprehensive Google-like pool rather than ~20 prominent- // names (Vela parity).+ // names. const val MAX_PINS_FAR = 120 const val MAX_PINS_CLOSE = 350
maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt b/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.ktindex 03acf54bf5..dee3e453d6 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/SelectedFeatureViewModel.kt@@ -65,7 +65,7 @@ class SelectedFeatureViewModel(application: Application): AndroidViewModel(appli } /** A pending request for the map to fly to [position] (at [zoom] when set) and- * show the place bottom PANE (peek), the Vela-style place card. Backed by a+ * show the place bottom PANE (peek), the place card. Backed by a * StateFlow so a request made before MapPage is composed (a cold-start deep * link) survives until the map consumes it via [consumeFocus]. */ data class PlaceFocus(val position: GeoPoint, val zoom: Double? = null)
metadata_data/photos/communicate/1.png
diff --git a/metadata_data/photos/communicate/1.png b/metadata_data/photos/communicate/1.pngnew file mode 100644index 0000000000..10c47bba3fBinary files /dev/null and b/metadata_data/photos/communicate/1.png differ
metadata_data/photos/communicate/2.png
diff --git a/metadata_data/photos/communicate/2.png b/metadata_data/photos/communicate/2.pngnew file mode 100644index 0000000000..d2daf65007Binary files /dev/null and b/metadata_data/photos/communicate/2.png differ
metadata_data/photos/communicate/3.png
diff --git a/metadata_data/photos/communicate/3.png b/metadata_data/photos/communicate/3.pngnew file mode 100644index 0000000000..80685cbaccBinary files /dev/null and b/metadata_data/photos/communicate/3.png differ
metadata_data/photos/music/1.png
diff --git a/metadata_data/photos/music/1.png b/metadata_data/photos/music/1.pngindex b7580d6a3a..404dc92720 100644Binary files a/metadata_data/photos/music/1.png and b/metadata_data/photos/music/1.png differ
metadata_data/photos/music/2.png
diff --git a/metadata_data/photos/music/2.png b/metadata_data/photos/music/2.pngindex 469baf00f2..48095f073a 100644Binary files a/metadata_data/photos/music/2.png and b/metadata_data/photos/music/2.png differ
metadata_data/photos/music/3.png
diff --git a/metadata_data/photos/music/3.png b/metadata_data/photos/music/3.pngindex 22c6b5f84e..62d5a1a8a1 100644Binary files a/metadata_data/photos/music/3.png and b/metadata_data/photos/music/3.png differ
metadata_data/photos/music/4.png
diff --git a/metadata_data/photos/music/4.png b/metadata_data/photos/music/4.pngnew file mode 100644index 0000000000..951c4d9e76Binary files /dev/null and b/metadata_data/photos/music/4.png differ
metadata_data/photos/music/5.png
diff --git a/metadata_data/photos/music/5.png b/metadata_data/photos/music/5.pngnew file mode 100644index 0000000000..1096f3401aBinary files /dev/null and b/metadata_data/photos/music/5.png differ
metadata_data/photos/music/6.png
diff --git a/metadata_data/photos/music/6.png b/metadata_data/photos/music/6.pngnew file mode 100644index 0000000000..fb5114ee82Binary files /dev/null and b/metadata_data/photos/music/6.png differ
metadata_data/photos/weather/1.png
diff --git a/metadata_data/photos/weather/1.png b/metadata_data/photos/weather/1.pngindex 47327d8031..d07b3518e5 100644Binary files a/metadata_data/photos/weather/1.png and b/metadata_data/photos/weather/1.png differ
metadata_data/photos/weather/2.png
diff --git a/metadata_data/photos/weather/2.png b/metadata_data/photos/weather/2.pngindex 8946aaa19a..e06197db7c 100644Binary files a/metadata_data/photos/weather/2.png and b/metadata_data/photos/weather/2.png differ
metadata_data/photos/weather/3.png
diff --git a/metadata_data/photos/weather/3.png b/metadata_data/photos/weather/3.pngindex ac695a2eb9..b703697b9b 100644Binary files a/metadata_data/photos/weather/3.png and b/metadata_data/photos/weather/3.png differ
metadata_data/photos/weather/4.png
diff --git a/metadata_data/photos/weather/4.png b/metadata_data/photos/weather/4.pngnew file mode 100644index 0000000000..ac51ccf90dBinary files /dev/null and b/metadata_data/photos/weather/4.png differ
metadata_data/photos/weather/5.png
diff --git a/metadata_data/photos/weather/5.png b/metadata_data/photos/weather/5.pngnew file mode 100644index 0000000000..b0a5998435Binary files /dev/null and b/metadata_data/photos/weather/5.png differ
metadata_data/photos/weather/6.png
diff --git a/metadata_data/photos/weather/6.png b/metadata_data/photos/weather/6.pngnew file mode 100644index 0000000000..381048c141Binary files /dev/null and b/metadata_data/photos/weather/6.png differ
weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarDetailScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarDetailScreen.kt b/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarDetailScreen.ktindex 2e78180318..461872d44f 100644--- a/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarDetailScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarDetailScreen.kt@@ -4,6 +4,7 @@ import androidx.car.app.CarContext import androidx.car.app.Screen import androidx.car.app.constraints.ConstraintManager import androidx.car.app.model.Action+import androidx.car.app.model.CarIcon import androidx.car.app.model.MessageTemplate import androidx.car.app.model.Pane import androidx.car.app.model.PaneTemplate@@ -17,6 +18,7 @@ import com.vayunmathur.weather.domain.formatTemperatureCompact import com.vayunmathur.weather.domain.formatWind import com.vayunmathur.weather.domain.WindUnit import com.vayunmathur.weather.domain.weatherConditionForCode+import androidx.core.graphics.drawable.IconCompat import java.time.LocalDate import java.time.format.TextStyle import java.util.Locale@@ -84,6 +86,9 @@ class WeatherCarDetailScreen( "Wind ${formatWind(current.windSpeed, WindUnit.KmH)} " + compassDirection(current.windDirection), )+ runCatching {+ now.setImage(conditionIcon(current.weatherCode, current.isDay == 1), Row.IMAGE_TYPE_ICON)+ } pane.addRow(now.build()) } @@ -113,6 +118,11 @@ class WeatherCarDetailScreen( Row.Builder() .setTitle(dayLabel) .apply { if (parts.isNotEmpty()) addText(parts.joinToString(" · ")) }+ .apply {+ if (code != null) {+ runCatching { setImage(conditionIcon(code, isDay = true), Row.IMAGE_TYPE_ICON) }+ }+ } .build(), ) rows++@@ -132,6 +142,12 @@ class WeatherCarDetailScreen( }.getOrDefault(isoDate) } + /** A [CarIcon] for a WMO condition code, reusing the phone/widget glyphs. */+ private fun conditionIcon(code: Int, isDay: Boolean): CarIcon =+ CarIcon.Builder(+ IconCompat.createWithResource(carContext, weatherConditionForCode(code).iconRes(isDay)),+ ).build()+ private companion object { const val DEFAULT_PANE_LIMIT = 20 }
weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarLocationsScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarLocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarLocationsScreen.ktindex bf83b0df5b..04e55fac68 100644--- a/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarLocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/service/car/WeatherCarLocationsScreen.kt@@ -4,6 +4,7 @@ import androidx.car.app.CarContext import androidx.car.app.Screen import androidx.car.app.constraints.ConstraintManager import androidx.car.app.model.Action+import androidx.car.app.model.CarIcon import androidx.car.app.model.ItemList import androidx.car.app.model.ListTemplate import androidx.car.app.model.MessageTemplate@@ -14,6 +15,7 @@ import androidx.car.app.model.Template import com.vayunmathur.weather.domain.TemperatureUnit import com.vayunmathur.weather.domain.formatTemperatureCompact import com.vayunmathur.weather.domain.weatherConditionForCode+import androidx.core.graphics.drawable.IconCompat /** * Saved locations list: every pinned place plus the device-location row.@@ -119,6 +121,9 @@ class WeatherCarLocationsScreen( "${formatTemperatureCompact(current.temperature, tempUnit)} · " + "${carContext.getString(weatherConditionForCode(current.weatherCode).label)}", )+ runCatching {+ row.setImage(conditionIcon(current.weatherCode, current.isDay == 1), Row.IMAGE_TYPE_ICON)+ } } else { row.addText("Loading forecast…") }@@ -131,6 +136,12 @@ class WeatherCarLocationsScreen( return row.build() } + /** A [CarIcon] for a WMO condition code, reusing the phone/widget glyphs. */+ private fun conditionIcon(code: Int, isDay: Boolean): CarIcon =+ CarIcon.Builder(+ IconCompat.createWithResource(carContext, weatherConditionForCode(code).iconRes(isDay)),+ ).build()+ private fun contentLimit(type: Int): Int { return runCatching { carContext.getCarService(ConstraintManager::class.java).getContentLimit(type)
weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/CarMetadataPreviews.kt
diff --git a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/CarMetadataPreviews.kt b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/CarMetadataPreviews.ktindex d21bd792a8..c40bbadef6 100644--- a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/CarMetadataPreviews.kt+++ b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/CarMetadataPreviews.kt@@ -3,7 +3,9 @@ package com.vayunmathur.weather.ui import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier+import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.Preview+import androidx.core.graphics.drawable.IconCompat import com.android.tools.screenshot.PreviewTest import com.vayunmathur.library.carhost.CarTemplateView import com.vayunmathur.library.carhost.HostTemplate@@ -11,6 +13,7 @@ import com.vayunmathur.library.carhost.HostUiRow import com.vayunmathur.library.carhost.HostUiSection import com.vayunmathur.library.ui.DynamicTheme import com.vayunmathur.library.ui.Surface+import com.vayunmathur.weather.R /** Landscape head-unit display, ~Android Auto reference. */ private const val CAR = "spec:width=1024dp,height=600dp,dpi=160"@@ -19,8 +22,8 @@ private const val CAR = "spec:width=1024dp,height=600dp,dpi=160" * Store-listing screenshots of the Android Auto car views for `:weather`. * * Feeds representative [HostTemplate]s to the shared [CarTemplateView] renderer- * from `:library:carhost`. Shows the saved-locations list and a forecast detail.- * Numbered after the phone previews in [MetadataPreviews].+ * from `:library:carhost`. Shows the saved-locations list and a forecast detail,+ * each row carrying its WMO condition glyph. Numbered after the phone previews. */ class CarMetadataPreviews { @@ -28,6 +31,8 @@ class CarMetadataPreviews { @Preview(name = "5-car-locations", device = CAR, showSystemUi = false) @Composable fun Preview5CarLocations() {+ val ctx = LocalContext.current+ fun icon(res: Int) = IconCompat.createWithResource(ctx, res) DynamicTheme(darkTheme = true) { Surface(Modifier.fillMaxSize()) { CarTemplateView(@@ -37,10 +42,10 @@ class CarMetadataPreviews { HostUiSection( header = "Weather", rows = listOf(- HostUiRow("San Francisco · Here", listOf("14° · Partly cloudy"), browse = true) {},- HostUiRow("New York", listOf("United States", "8° · Light rain"), browse = true) {},- HostUiRow("London", listOf("United Kingdom", "11° · Overcast"), browse = true) {},- HostUiRow("Tokyo", listOf("Japan", "19° · Clear"), browse = true) {},+ HostUiRow("San Francisco · Here", listOf("14° · Partly cloudy"), browse = true, image = icon(R.drawable.outline_partly_cloudy_day_24)) {},+ HostUiRow("New York", listOf("United States", "8° · Light rain"), browse = true, image = icon(R.drawable.outline_rain_24)) {},+ HostUiRow("London", listOf("United Kingdom", "11° · Overcast"), browse = true, image = icon(R.drawable.outline_cloudy_24)) {},+ HostUiRow("Tokyo", listOf("Japan", "19° · Clear"), browse = true, image = icon(R.drawable.outline_clear_day_24)) {}, ), ), ),@@ -54,17 +59,19 @@ class CarMetadataPreviews { @Preview(name = "6-car-detail", device = CAR, showSystemUi = false) @Composable fun Preview6CarDetail() {+ val ctx = LocalContext.current+ fun icon(res: Int) = IconCompat.createWithResource(ctx, res) DynamicTheme(darkTheme = true) { Surface(Modifier.fillMaxSize()) { CarTemplateView( HostTemplate.Pane( title = "San Francisco", rows = listOf(- HostUiRow("Now · 14° · Partly cloudy", listOf("Feels like 13° · Humidity 72% · Wind 12 km/h NW")),- HostUiRow("Today", listOf("16° / 9° · Partly cloudy · 10% rain")),- HostUiRow("Tuesday", listOf("17° / 10° · Sunny")),- HostUiRow("Wednesday", listOf("15° / 9° · Light rain · 60% rain")),- HostUiRow("Thursday", listOf("14° / 8° · Overcast")),+ HostUiRow("Now · 14° · Partly cloudy", listOf("Feels like 13° · Humidity 72% · Wind 12 km/h NW"), image = icon(R.drawable.outline_partly_cloudy_day_24)),+ HostUiRow("Today", listOf("16° / 9° · Partly cloudy · 10% rain"), image = icon(R.drawable.outline_partly_cloudy_day_24)),+ HostUiRow("Tuesday", listOf("17° / 10° · Sunny"), image = icon(R.drawable.outline_clear_day_24)),+ HostUiRow("Wednesday", listOf("15° / 9° · Light rain · 60% rain"), image = icon(R.drawable.outline_rain_24)),+ HostUiRow("Thursday", listOf("14° / 8° · Overcast"), image = icon(R.drawable.outline_cloudy_24)), ), ), )
weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt
diff --git a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.ktindex 024f527a0f..29a0317602 100644--- a/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt+++ b/weather/src/screenshotTest/kotlin/com/vayunmathur/weather/ui/MetadataPreviews.kt@@ -12,9 +12,9 @@ import com.vayunmathur.weather.network.Current import com.vayunmathur.weather.network.Daily import com.vayunmathur.weather.network.ForecastResponse import com.vayunmathur.weather.network.Hourly-import com.vayunmathur.weather.domain.LocationRow-import com.vayunmathur.weather.domain.LocationUiState-import com.vayunmathur.weather.domain.LocationsUiState+import com.vayunmathur.weather.platform.LocationRow+import com.vayunmathur.weather.platform.LocationUiState+import com.vayunmathur.weather.platform.LocationsUiState import com.vayunmathur.weather.domain.SelectedDateOrTime import com.vayunmathur.weather.platform.DisplayUnits import com.vayunmathur.weather.platform.WeatherActions