KMP/location + UI: centralize location lookups and use shared panel shell in NearbyDialog

shared(commonMain): add location/LocationProvider (GeoPoint + interface).
app(location): add AndroidLocationProvider using FusedLocationProviderClient.
app(MainActivity): replace ad-hoc location calls with provider in startup, auto-scans (Wiki/DM/Fornsok), and “Nearby” button; persist lastKnownLat/Lon.
app(ui): use MapPanelShell inside NearbyDialog and set sensible max height (~80% of screen).
app(found): fix fetchNearbyData call to use gp.lat/gp.lon.
This commit is contained in:
2025-09-14 18:20:38 +02:00
parent 4e2d062329
commit 5eb96a0ff1
3 changed files with 70 additions and 56 deletions

View File

@@ -0,0 +1,10 @@
package app.klottr.location
/** Enkel delad platsmodell för KMP. */
data class GeoPoint(val lat: Double, val lon: Double)
/** Gränssnitt för plattforms-specifik platsinhämtning. */
interface LocationProvider {
/** Returnerar aktuell plats eller senaste kända, eller null vid fel/tidsutlöpning. */
suspend fun currentOrLastKnown(): GeoPoint?
}