mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Minor fixes for entries, settings and maps
This commit is contained in:
1 parent
942c7ce65f
commit
5d2a870319
10 files changed
+149
-134
No files matched your search
@@ -22,9 +22,13 @@ import com.rtbishop.look4sat.domain.ISettingsRepository
|
||||
import com.rtbishop.look4sat.model.DataState
|
||||
import com.rtbishop.look4sat.model.SatEntry
|
||||
import com.rtbishop.look4sat.model.SatItem
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.InputStream
|
||||
import java.util.zip.ZipInputStream
|
||||
|
||||
@@ -56,7 +60,7 @@ class DataRepository(
|
||||
override suspend fun getEntriesWithIds(ids: List<Int>) = entrySource.getEntriesWithIds(ids)
|
||||
|
||||
override suspend fun getEntriesWithSelection(): List<SatItem> {
|
||||
val selectedIds = settingsRepository.loadEntriesSelection()
|
||||
val selectedIds = settingsRepository.satelliteSelection.value
|
||||
return getEntriesWithModes().onEach { it.isSelected = it.catnum in selectedIds }
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ interface ISettingsRepository {
|
||||
|
||||
val stationPosition: StateFlow<GeoPos>
|
||||
|
||||
val satelliteSelection: StateFlow<List<Int>>
|
||||
|
||||
fun setGpsPosition(): Boolean
|
||||
|
||||
fun setGeoPosition(latitude: Double, longitude: Double, altitude: Double = 0.0): Boolean
|
||||
@@ -64,8 +66,6 @@ interface ISettingsRepository {
|
||||
|
||||
fun saveEntriesSelection(catnums: List<Int>)
|
||||
|
||||
fun loadEntriesSelection(): List<Int>
|
||||
|
||||
fun saveSatType(type: String, catnums: List<Int>)
|
||||
|
||||
fun loadSatType(type: String): List<Int>
|
||||
|
||||
Reference in new issue
Block a user