Delete some files that are no longer used
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package app.klottr.util
|
||||
|
||||
//import android.location.Location
|
||||
import app.klottr.data.NoteEntity
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlin.math.*
|
||||
|
||||
// OBS: distanceMeters ligger numera i :shared (app.klottr.util.distanceMeters).
|
||||
// Den lokala dubbletten är borttagen för att undvika divergens mellan plattformar.
|
||||
|
||||
|
||||
//fun distanceMeters(lat1: Double, lon1: Double, lat2: Double, lon2: Double): Double {
|
||||
//val R = 6371000.0
|
||||
//val dLat = Math.toRadians(lat2 - lat1)
|
||||
//val dLon = Math.toRadians(lon2 - lon1)
|
||||
//val a = sin(dLat/2).pow(2.0) + cos(Math.toRadians(lat1)) * cos(Math.toRadians(lat2)) * sin(dLon/2).pow(2.0)
|
||||
// return 2 * R * atan2(sqrt(a), sqrt(1 - a))
|
||||
//}
|
||||
|
||||
//fun roundCoord(v: Double): Double = (v * 1e5).roundToInt() / 1e5
|
||||
//
|
||||
//object MatchBus {
|
||||
// val match = MutableSharedFlow<NoteEntity?>(extraBufferCapacity = 1)
|
||||
// fun emit(n: NoteEntity) { match.tryEmit(n) }
|
||||
//}
|
||||
|
||||
//object LastLocationStore {
|
||||
// // Adapter som låter befintlig Android-kod använda android.location.Location,
|
||||
// // men under huven lagras värdet i KMP-store (GeoPoint) i :shared.
|
||||
// var lastKnownLocation: Location?
|
||||
// get() {
|
||||
// val gp = app.klottr.location.LastLocationStore.lastKnownLocation // Hämta från delad store
|
||||
// return gp?.let {
|
||||
// Location("klottr").apply { latitude = it.lat; longitude = it.lon }
|
||||
// }
|
||||
// }
|
||||
// set(value) {
|
||||
// app.klottr.location.LastLocationStore.lastKnownLocation = value?.let {
|
||||
// app.klottr.location.GeoPoint(it.latitude, it.longitude)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package app.klottr.location
|
||||
|
||||
//import android.content.Context
|
||||
//import com.google.android.gms.location.LocationServices
|
||||
//import com.google.android.gms.location.Priority
|
||||
//import kotlinx.coroutines.tasks.await
|
||||
//
|
||||
///** Android-implementation som använder FusedLocationProvider. */
|
||||
//object AndroidLocationProvider : LocationProvider {
|
||||
//
|
||||
// /** Hämtar lastLocation och faller tillbaka till getCurrentLocation. */
|
||||
// suspend fun currentOrLastKnown(context: Context): GeoPoint? {
|
||||
// val client = LocationServices.getFusedLocationProviderClient(context)
|
||||
// return try {
|
||||
// val last = client.lastLocation.await()
|
||||
// val loc = last ?: client.getCurrentLocation(Priority.PRIORITY_HIGH_ACCURACY, null).await()
|
||||
// loc?.let { GeoPoint(it.latitude, it.longitude) }
|
||||
// } catch (_: Exception) {
|
||||
// null
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Interface-override finns för framtida DI utan Context (används ej av :app idag).
|
||||
// override suspend fun currentOrLastKnown(): GeoPoint? = null
|
||||
//}
|
||||
@@ -1,7 +0,0 @@
|
||||
package app.klottr.location
|
||||
|
||||
///** Android-implementationen håller bara ett volatilt fält. */
|
||||
//actual object LastLocationStore {
|
||||
// @Volatile
|
||||
// actual var lastKnown: GeoPoint? = null
|
||||
//}
|
||||
@@ -1,6 +0,0 @@
|
||||
package app.klottr.location
|
||||
|
||||
///** Delad platsstore: senaste kända position som enkel GeoPoint. */
|
||||
//expect object LastLocationStore {
|
||||
// var lastKnown: GeoPoint?
|
||||
//}
|
||||
@@ -1,10 +0,0 @@
|
||||
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?
|
||||
//}
|
||||
@@ -1,6 +0,0 @@
|
||||
package app.klottr.location
|
||||
//
|
||||
///** iOS-stub tills riktig plats läggs till. */
|
||||
//object IosLocationProvider : LocationProvider {
|
||||
// override suspend fun currentOrLastKnown(): GeoPoint? = null
|
||||
//}
|
||||
@@ -1,6 +0,0 @@
|
||||
package app.klottr.location
|
||||
|
||||
///** iOS implementation keeps the last known point in memory. */
|
||||
//actual object LastLocationStore {
|
||||
// actual var lastKnown: GeoPoint? = null
|
||||
//}
|
||||
Reference in New Issue
Block a user