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:
@@ -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?
|
||||
}
|
||||
Reference in New Issue
Block a user