aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2021-12-06 01:04:55 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2021-12-06 01:04:55 -0600
commit28dd1f8dd383d2f67b41c927f652c0183cfff2fc (patch)
tree7fc0b2908afa4a63a1f144bc2d2718d91500333d /androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
parente9152f42e7bf8cdfbd491f951019e2fb058d67ef (diff)
downloadetbsa-trackermap-mobile-28dd1f8dd383d2f67b41c927f652c0183cfff2fc.tar.gz
etbsa-trackermap-mobile-28dd1f8dd383d2f67b41c927f652c0183cfff2fc.tar.bz2
etbsa-trackermap-mobile-28dd1f8dd383d2f67b41c927f652c0183cfff2fc.zip
WIP: Implements the Login functionality
- Adds multiple android dependencies, for DI and some utilities - Updates colors and styles - Adds an Application - Adds the Login Fragment and ViewModel
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt30
1 files changed, 30 insertions, 0 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
new file mode 100644
index 0000000..a8efbf2
--- /dev/null
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt
@@ -0,0 +1,30 @@
+package mx.trackermap.TrackerMap.android
+
+import android.app.Application
+import mx.trackermap.TrackerMap.android.session.LoginViewModel
+import mx.trackermap.TrackerMap.client.apis.SessionApi
+import org.koin.android.ext.koin.androidContext
+import org.koin.android.ext.koin.androidLogger
+import org.koin.androidx.viewmodel.dsl.viewModel
+import org.koin.core.context.startKoin
+import org.koin.core.logger.Level
+import org.koin.dsl.module
+
+class TrackerApp: Application() {
+ override fun onCreate() {
+ super.onCreate()
+
+ val appModule = module {
+ single { "https://etbsa.net/api/" }
+ single { SessionApi(get()) }
+
+ viewModel { LoginViewModel(get(), get()) }
+ }
+
+ startKoin {
+ androidLogger(Level.ERROR)
+ androidContext(this@TrackerApp)
+ modules(appModule)
+ }
+ }
+} \ No newline at end of file