shared(nearby): add layerDisplayName and wire into subtitleFor;

app(found): use shared layerDisplayName for Hittat subtitle (no UI change)
This commit is contained in:
2025-09-13 14:36:54 +02:00
parent 23e237c457
commit 0ed70edb9e
3 changed files with 16 additions and 17 deletions

View File

@@ -805,13 +805,8 @@ private fun KlottrApp(
} else base
},
subtitleFor = { f -> // Undertext "<lager> • <avstånd> m" (+ ev. koordinater)
val layerName = when (f.layer) {
FoundStore.LAYER_KLOTTER -> "Klotter"
FoundStore.LAYER_FORNSOK -> "Fornsök"
FoundStore.LAYER_DM -> "DigitaltMuseum"
FoundStore.LAYER_WIKI -> "Wikipedia"
else -> "Plats"
}
val layerName = app.klottr.nearby.layerDisplayName(f.layer) // Centralt visningsnamn från :shared
val my = LastLocationStore.lastKnownLocation //
val distM = my?.let { app.klottr.util.distanceMeters(it.latitude, it.longitude, f.lat, f.lon).roundToInt() } //
val distText = distM?.let { formatDistance(it) } ?: "-" //