aboutsummaryrefslogtreecommitdiff
path: root/androidApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-20 21:58:10 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-20 21:58:10 -0600
commite141c251bd4d5111246ab398efdaa64ae1900ea0 (patch)
tree2c39ff8b5980464249ed13a768a9fa1a432aa190 /androidApp
parent83efbccf0a3783ace6d91073d391bce6924553a9 (diff)
parent1366da35eb569a9b1efdf7252adbcfbede7e32d6 (diff)
downloadetbsa-trackermap-mobile-e141c251bd4d5111246ab398efdaa64ae1900ea0.tar.gz
etbsa-trackermap-mobile-e141c251bd4d5111246ab398efdaa64ae1900ea0.tar.bz2
etbsa-trackermap-mobile-e141c251bd4d5111246ab398efdaa64ae1900ea0.zip
Merge branch 'url_switch' of https://git.sr.ht/~avalos/trackermap-mobile into url_switch
Diffstat (limited to 'androidApp')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt16
1 files changed, 9 insertions, 7 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
index 2901dbb..c21cfe1 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
@@ -1,6 +1,7 @@
package mx.trackermap.TrackerMap.android
import android.app.Application
+import androidx.preference.PreferenceManager
import kotlinx.coroutines.DelicateCoroutinesApi
import mx.trackermap.TrackerMap.android.details.commands.UnitCommandsViewModel
import mx.trackermap.TrackerMap.android.details.information.UnitInformationViewModel
@@ -29,13 +30,14 @@ open class TrackerApp : Application() {
super.onCreate()
val appModule = module {
- factory { SessionApi() }
- factory { UsersApi() }
- factory { DevicesApi() }
- factory { PositionsApi() }
- factory { CommandsApi() }
- factory { ReportsApi() }
- factory { GeofencesApi() }
+ single { getString(R.string.default_server_url) }
+ factory { SessionApi(get()) }
+ factory { UsersApi(get()) }
+ factory { DevicesApi(get()) }
+ factory { PositionsApi(get()) }
+ factory { CommandsApi(get()) }
+ factory { ReportsApi(get()) }
+ factory { GeofencesApi(get()) }
factory { SessionController(get(), get()) }
factory { UnitsController(get(), get()) }