From 7da841d2de9ac0526c3863e85d7d603facabb95c Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 20 Jan 2022 20:43:14 -0600 Subject: Implemented feature to switch to different Traccar servers by URL and removed annoying auto-generated redundant qualifiers --- .../TrackerMap/client/apis/AttributesApi.kt | 16 ++++++------ .../TrackerMap/client/apis/CalendarsApi.kt | 16 ++++++------ .../TrackerMap/client/apis/CommandsApi.kt | 30 +++++++++++----------- .../TrackerMap/client/apis/DevicesApi.kt | 22 ++++++++-------- .../TrackerMap/client/apis/DriversApi.kt | 16 ++++++------ .../trackermap/TrackerMap/client/apis/EventsApi.kt | 4 +-- .../TrackerMap/client/apis/GeofencesApi.kt | 2 +- .../trackermap/TrackerMap/client/apis/GroupsApi.kt | 16 ++++++------ .../TrackerMap/client/apis/MaintenanceApi.kt | 16 ++++++------ .../TrackerMap/client/apis/NotificationsApi.kt | 24 ++++++++--------- .../TrackerMap/client/apis/PermissionsApi.kt | 8 +++--- .../TrackerMap/client/apis/PositionsApi.kt | 8 +++--- .../TrackerMap/client/apis/ReportsApi.kt | 2 +- .../trackermap/TrackerMap/client/apis/ServerApi.kt | 4 +-- .../TrackerMap/client/apis/SessionApi.kt | 4 +-- .../TrackerMap/client/apis/StatisticsApi.kt | 8 +++--- .../trackermap/TrackerMap/client/apis/UsersApi.kt | 2 +- .../TrackerMap/client/infrastructure/ApiClient.kt | 5 +++- .../TrackerMap/client/models/Session_body.kt | 7 +++-- .../TrackerMap/controllers/SessionController.kt | 9 +++++++ 20 files changed, 117 insertions(+), 102 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt index 388df19..1c9b663 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Attribute import mx.trackermap.TrackerMap.client.infrastructure.* -class AttributesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class AttributesApi : ApiClient() { /** * Fetch a list of Attributes @@ -28,18 +28,18 @@ class AttributesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun attributesComputedGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun attributesComputedGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId"), "deviceId" to listOf("$deviceId"), "groupId" to listOf("$groupId"), "refresh" to listOf("$refresh")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/attributes/computed", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -52,7 +52,7 @@ class AttributesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @param id * @return void */ - suspend fun attributesComputedIdDelete(id: kotlin.Int): Unit { + suspend fun attributesComputedIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -78,8 +78,8 @@ class AttributesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @return Attribute */ @Suppress("UNCHECKED_CAST") - suspend fun attributesComputedIdPut(body: Attribute, id: kotlin.Int): Attribute { - val localVariableBody: kotlin.Any? = body + suspend fun attributesComputedIdPut(body: Attribute, id: Int): Attribute { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -105,7 +105,7 @@ class AttributesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : */ @Suppress("UNCHECKED_CAST") suspend fun attributesComputedPost(body: Attribute): Attribute { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt index 70e3a02..56ee7b5 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Calendar import mx.trackermap.TrackerMap.client.infrastructure.* -class CalendarsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class CalendarsApi : ApiClient() { /** * Fetch a list of Calendars @@ -25,18 +25,18 @@ class CalendarsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun calendarsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null): kotlin.Array { + suspend fun calendarsGet(all: Boolean? = null, userId: Int? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/calendars", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -49,7 +49,7 @@ class CalendarsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A * @param id * @return void */ - suspend fun calendarsIdDelete(id: kotlin.Int): Unit { + suspend fun calendarsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -75,8 +75,8 @@ class CalendarsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A * @return Calendar */ @Suppress("UNCHECKED_CAST") - suspend fun calendarsIdPut(body: Calendar, id: kotlin.Int): Calendar { - val localVariableBody: kotlin.Any? = body + suspend fun calendarsIdPut(body: Calendar, id: Int): Calendar { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -102,7 +102,7 @@ class CalendarsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A */ @Suppress("UNCHECKED_CAST") suspend fun calendarsPost(body: Calendar): Calendar { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt index e840888..f00bc93 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.CommandType import mx.trackermap.TrackerMap.client.infrastructure.* -class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class CommandsApi : ApiClient() { /** * Fetch a list of Saved Commands @@ -29,7 +29,7 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun commandsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun commandsGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val query: MutableMap> = mutableMapOf() all?.let { query["all"] = listOf("$it") } userId?.let { query["userId"] = listOf("$it") } @@ -42,12 +42,12 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap RequestMethod.GET, "/commands", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -60,7 +60,7 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap * @param id * @return void */ - suspend fun commandsIdDelete(id: kotlin.Int): Unit { + suspend fun commandsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -86,8 +86,8 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap * @return Command */ @Suppress("UNCHECKED_CAST") - suspend fun commandsIdPut(body: Command, id: kotlin.Int): Command { - val localVariableBody: kotlin.Any? = body + suspend fun commandsIdPut(body: Command, id: Int): Command { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -113,7 +113,7 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap */ @Suppress("UNCHECKED_CAST") suspend fun commandsPost(body: Command): Command { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -138,18 +138,18 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun commandsSendGet(deviceId: kotlin.Int? = null): kotlin.Array { + suspend fun commandsSendGet(deviceId: Int? = null): Array { val localVariableQuery: MultiValueMap = mapOf("deviceId" to listOf("$deviceId")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/commands/send", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -164,7 +164,7 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap */ @Suppress("UNCHECKED_CAST") suspend fun commandsSendPost(body: Command): Command { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -191,18 +191,18 @@ class CommandsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Ap * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun commandsTypesGet(deviceId: kotlin.Int? = null, protocol: kotlin.String? = null, textChannel: kotlin.Boolean? = null): kotlin.Array { + suspend fun commandsTypesGet(deviceId: Int? = null, protocol: String? = null, textChannel: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("deviceId" to listOf("$deviceId"), "protocol" to listOf("$protocol"), "textChannel" to listOf("$textChannel")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/commands/types", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt index 331cc4e..22903d1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.DeviceAccumulators import mx.trackermap.TrackerMap.client.infrastructure.* -class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class DevicesApi : ApiClient() { /** * Fetch a list of Devices @@ -28,24 +28,24 @@ class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun devicesGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, id: kotlin.Int? = null, uniqueId: kotlin.String? = null): kotlin.Array { + suspend fun devicesGet(all: Boolean? = null, userId: Int? = null, id: Int? = null, uniqueId: String? = null): Array { val query: MutableMap> = mutableMapOf() all?.let { query["all"] = listOf("$it") } userId?.let { query["userId"] = listOf("$it") } id?.let { query["id"] = listOf("$it") } - uniqueId?.let { query["uniqueId"] = listOf("$it") } + uniqueId?.let { query["uniqueId"] = listOf(it) } val localVariableQuery: MultiValueMap = query val localVariableConfig = RequestConfig( RequestMethod.GET, "/devices", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -59,8 +59,8 @@ class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @param id * @return void */ - suspend fun devicesIdAccumulatorsPut(body: DeviceAccumulators, id: kotlin.Int): Unit { - val localVariableBody: kotlin.Any? = body + suspend fun devicesIdAccumulatorsPut(body: DeviceAccumulators, id: Int) { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -84,7 +84,7 @@ class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @param id * @return void */ - suspend fun devicesIdDelete(id: kotlin.Int): Unit { + suspend fun devicesIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -110,8 +110,8 @@ class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return Device */ @Suppress("UNCHECKED_CAST") - suspend fun devicesIdPut(body: Device, id: kotlin.Int): Device { - val localVariableBody: kotlin.Any? = body + suspend fun devicesIdPut(body: Device, id: Int): Device { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -137,7 +137,7 @@ class DevicesApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api */ @Suppress("UNCHECKED_CAST") suspend fun devicesPost(body: Device): Device { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt index 2a8f92c..7cf26d0 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Driver import mx.trackermap.TrackerMap.client.infrastructure.* -class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class DriversApi : ApiClient() { /** * Fetch a list of Drivers @@ -28,18 +28,18 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun driversGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun driversGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId"), "deviceId" to listOf("$deviceId"), "groupId" to listOf("$groupId"), "refresh" to listOf("$refresh")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/drivers", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -52,7 +52,7 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @param id * @return void */ - suspend fun driversIdDelete(id: kotlin.Int): Unit { + suspend fun driversIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -78,8 +78,8 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api * @return Driver */ @Suppress("UNCHECKED_CAST") - suspend fun driversIdPut(body: Driver, id: kotlin.Int): Driver { - val localVariableBody: kotlin.Any? = body + suspend fun driversIdPut(body: Driver, id: Int): Driver { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -105,7 +105,7 @@ class DriversApi(basePath: kotlin.String = "https://demo.traccar.org/api") : Api */ @Suppress("UNCHECKED_CAST") suspend fun driversPost(body: Driver): Driver { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt index 8c1f2b0..5e5b8e6 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Event import mx.trackermap.TrackerMap.client.infrastructure.* -class EventsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class EventsApi : ApiClient() { /** * @@ -24,7 +24,7 @@ class EventsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @return Event */ @Suppress("UNCHECKED_CAST") - suspend fun eventsIdGet(id: kotlin.Int): Event { + suspend fun eventsIdGet(id: Int): Event { val localVariableConfig = RequestConfig( RequestMethod.GET, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt index dd9c89d..23ac8c8 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Geofence import mx.trackermap.TrackerMap.client.infrastructure.* -class GeofencesApi(basePath: String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class GeofencesApi : ApiClient() { /** * Fetch a list of Geofences diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt index c86e66c..3b0dfa1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Group import mx.trackermap.TrackerMap.client.infrastructure.* -class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class GroupsApi : ApiClient() { /** * Fetch a list of Groups @@ -25,18 +25,18 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun groupsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null): kotlin.Array { + suspend fun groupsGet(all: Boolean? = null, userId: Int? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/groups", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -49,7 +49,7 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @param id * @return void */ - suspend fun groupsIdDelete(id: kotlin.Int): Unit { + suspend fun groupsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -75,8 +75,8 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC * @return Group */ @Suppress("UNCHECKED_CAST") - suspend fun groupsIdPut(body: Group, id: kotlin.Int): Group { - val localVariableBody: kotlin.Any? = body + suspend fun groupsIdPut(body: Group, id: Int): Group { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -102,7 +102,7 @@ class GroupsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC */ @Suppress("UNCHECKED_CAST") suspend fun groupsPost(body: Group): Group { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt index 7fcee92..92480fe 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Maintenance import mx.trackermap.TrackerMap.client.infrastructure.* -class MaintenanceApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class MaintenanceApi : ApiClient() { /** * Fetch a list of Maintenance @@ -28,18 +28,18 @@ class MaintenanceApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun maintenanceGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun maintenanceGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId"), "deviceId" to listOf("$deviceId"), "groupId" to listOf("$groupId"), "refresh" to listOf("$refresh")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/maintenance", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -52,7 +52,7 @@ class MaintenanceApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @param id * @return void */ - suspend fun maintenanceIdDelete(id: kotlin.Int): Unit { + suspend fun maintenanceIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -78,8 +78,8 @@ class MaintenanceApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @return Maintenance */ @Suppress("UNCHECKED_CAST") - suspend fun maintenanceIdPut(body: Maintenance, id: kotlin.Int): Maintenance { - val localVariableBody: kotlin.Any? = body + suspend fun maintenanceIdPut(body: Maintenance, id: Int): Maintenance { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -105,7 +105,7 @@ class MaintenanceApi(basePath: kotlin.String = "https://demo.traccar.org/api") : */ @Suppress("UNCHECKED_CAST") suspend fun maintenancePost(body: Maintenance): Maintenance { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt index 86c34d0..1f0d744 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.NotificationType import mx.trackermap.TrackerMap.client.infrastructure.* -class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class NotificationsApi : ApiClient() { /** * Fetch a list of Notifications @@ -29,18 +29,18 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsGet(all: kotlin.Boolean? = null, userId: kotlin.Int? = null, deviceId: kotlin.Int? = null, groupId: kotlin.Int? = null, refresh: kotlin.Boolean? = null): kotlin.Array { + suspend fun notificationsGet(all: Boolean? = null, userId: Int? = null, deviceId: Int? = null, groupId: Int? = null, refresh: Boolean? = null): Array { val localVariableQuery: MultiValueMap = mapOf("all" to listOf("$all"), "userId" to listOf("$userId"), "deviceId" to listOf("$deviceId"), "groupId" to listOf("$groupId"), "refresh" to listOf("$refresh")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/notifications", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") @@ -53,7 +53,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @param id * @return void */ - suspend fun notificationsIdDelete(id: kotlin.Int): Unit { + suspend fun notificationsIdDelete(id: Int) { val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -79,8 +79,8 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return Notification */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsIdPut(body: Notification, id: kotlin.Int): Notification { - val localVariableBody: kotlin.Any? = body + suspend fun notificationsIdPut(body: Notification, id: Int): Notification { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, @@ -106,7 +106,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") */ @Suppress("UNCHECKED_CAST") suspend fun notificationsPost(body: Notification): Notification { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -129,7 +129,7 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * * @return void */ - suspend fun notificationsTestPost(): Unit { + suspend fun notificationsTestPost(){ val localVariableConfig = RequestConfig( RequestMethod.POST, @@ -153,18 +153,18 @@ class NotificationsApi(basePath: kotlin.String = "https://demo.traccar.org/api") * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun notificationsTypesGet(): kotlin.Array { + suspend fun notificationsTypesGet(): Array { val localVariableConfig = RequestConfig( RequestMethod.GET, "/notifications/types" ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt index bfa2c2e..02c9348 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Permission import mx.trackermap.TrackerMap.client.infrastructure.* -class PermissionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class PermissionsApi : ApiClient() { /** * Unlink an Object from another Object @@ -23,8 +23,8 @@ class PermissionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @param body * @return void */ - suspend fun permissionsDelete(body: Permission): Unit { - val localVariableBody: kotlin.Any? = body + suspend fun permissionsDelete(body: Permission) { + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.DELETE, @@ -50,7 +50,7 @@ class PermissionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : */ @Suppress("UNCHECKED_CAST") suspend fun permissionsPost(body: Permission): Permission { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt index 278611f..ecbf649 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Position import mx.trackermap.TrackerMap.client.infrastructure.* -class PositionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class PositionsApi : ApiClient() { /** * Fetches a list of Positions @@ -27,7 +27,7 @@ class PositionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun positionsGet(deviceId: kotlin.Int? = null, from: LocalDateTimeAdapter? = null, to: LocalDateTimeAdapter? = null, id: kotlin.Int? = null): kotlin.Array { + suspend fun positionsGet(deviceId: Int? = null, from: LocalDateTimeAdapter? = null, to: LocalDateTimeAdapter? = null, id: Int? = null): Array { val query: MutableMap> = mutableMapOf() deviceId?.let { query["deviceId"] = listOf("$it") } from?.let { query["from"] = listOf("$it") } @@ -39,12 +39,12 @@ class PositionsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : A RequestMethod.GET, "/positions", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt index d77064e..3dbee22 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt @@ -20,7 +20,7 @@ import mx.trackermap.TrackerMap.client.models.ReportTrips import mx.trackermap.TrackerMap.client.infrastructure.* -class ReportsApi(basePath: String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class ReportsApi : ApiClient() { /** * Fetch a list of Events within the time period for the Devices or Groups diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt index 659761b..3c7787d 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Server import mx.trackermap.TrackerMap.client.infrastructure.* -class ServerApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class ServerApi : ApiClient() { /** * Fetch Server information @@ -49,7 +49,7 @@ class ServerApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiC */ @Suppress("UNCHECKED_CAST") suspend fun serverPut(body: Server): Server { - val localVariableBody: kotlin.Any? = body + val localVariableBody: Any = body val localVariableConfig = RequestConfig( RequestMethod.PUT, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt index b57f126..ad9e450 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt @@ -15,9 +15,10 @@ import com.russhwolf.settings.Settings import mx.trackermap.TrackerMap.client.models.User import mx.trackermap.TrackerMap.client.infrastructure.* +const val SERVER_URL_KEY = "server_url" const val ACCESS_TOKEN_KEY = "access_token" -class SessionApi(basePath: String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class SessionApi : ApiClient() { /** * Close the Session @@ -90,7 +91,6 @@ class SessionApi(basePath: String = "https://demo.traccar.org/api") : ApiClient( @Suppress("UNCHECKED_CAST") suspend fun sessionPost(email: String, password: String): User { val localVariableBody = mapOf("email" to email, "password" to password) - val localVariableHeaders = mapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.POST, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt index f7651ac..1857cc5 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Statistics import mx.trackermap.TrackerMap.client.infrastructure.* -class StatisticsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class StatisticsApi : ApiClient() { /** * Fetch server Statistics @@ -25,18 +25,18 @@ class StatisticsApi(basePath: kotlin.String = "https://demo.traccar.org/api") : * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun statisticsGet(from: java.time.LocalDateTime, to: java.time.LocalDateTime): kotlin.Array { + suspend fun statisticsGet(from: java.time.LocalDateTime, to: java.time.LocalDateTime): Array { val localVariableQuery: MultiValueMap = mapOf("from" to listOf("$from"), "to" to listOf("$to")) val localVariableConfig = RequestConfig( RequestMethod.GET, "/statistics", query = localVariableQuery ) - val response = request>( + val response = request>( localVariableConfig ) return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + ResponseType.Success -> (response as Success<*>).data as Array ResponseType.Informational -> TODO() ResponseType.Redirection -> TODO() ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt index 858cd10..7b8d837 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.User import mx.trackermap.TrackerMap.client.infrastructure.* -class UsersApi(basePath: String = "https://demo.traccar.org/api") : ApiClient(basePath) { +class UsersApi : ApiClient() { /** * Fetch a list of Users diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index 606fef0..88aaa26 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -17,9 +17,10 @@ import io.ktor.client.statement.* import io.ktor.http.* import io.ktor.util.* import mx.trackermap.TrackerMap.client.apis.ACCESS_TOKEN_KEY +import mx.trackermap.TrackerMap.client.apis.SERVER_URL_KEY import kotlinx.serialization.json.Json as KotlinJson -open class ApiClient(val baseUrl: String) { +open class ApiClient() { companion object { protected const val ApiContentType = "Content-Type" protected const val ApiAccept = "Accept" @@ -58,10 +59,12 @@ open class ApiClient(val baseUrl: String) { ) } + var baseUrl: String = "" var token: String = "" init { val settings = Settings() + baseUrl = settings.getString(SERVER_URL_KEY, "") token = settings.getString(ACCESS_TOKEN_KEY, "") } diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Session_body.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Session_body.kt index e98ff34..52c5abc 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Session_body.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Session_body.kt @@ -12,11 +12,14 @@ package mx.trackermap.TrackerMap.client.models /** - * + * + * @param url * @param email - * @param password + * @param password + * @param fcmToken */ data class SessionBody ( + val url: String, val email: String, val password: String, val fcmToken: String? = null diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt index 2ce4dc6..7d944b7 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt @@ -20,6 +20,7 @@ class SessionController( sealed class LoginState { object Nothing: LoginState() object Loading: LoginState() + object UrlMissing: LoginState() object EmailMissing : LoginState() object PasswordMissing : LoginState() object Failure : LoginState() @@ -58,10 +59,16 @@ class SessionController( } fun login(body: SessionBody) { + val url = body.url.trim() val email = body.email.trim() val password = body.password.trim() val token = body.fcmToken + if (url.isEmpty()) { + loginStateFlow.value = LoginState.UrlMissing + return + } + if (email.isEmpty()) { loginStateFlow.value = LoginState.EmailMissing return @@ -75,6 +82,8 @@ class SessionController( loginStateFlow.value = LoginState.Loading GlobalScope.launch { try { + sessionApi.baseUrl = url + usersApi.baseUrl = sessionApi.baseUrl val session = sessionApi.sessionPost(email, password) userFlow.value = session usersApi.token = sessionApi.token -- cgit v1.2.3 From 1366da35eb569a9b1efdf7252adbcfbede7e32d6 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 20 Jan 2022 21:57:54 -0600 Subject: Fallback ApiClient to default URL, so pre-URL-switch-capable apps don't fail at login --- .../java/mx/trackermap/TrackerMap/android/TrackerApp.kt | 16 +++++++++------- .../trackermap/TrackerMap/client/apis/AttributesApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/CommandsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/DevicesApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/DriversApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/EventsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/GroupsApi.kt | 2 +- .../trackermap/TrackerMap/client/apis/MaintenanceApi.kt | 2 +- .../TrackerMap/client/apis/NotificationsApi.kt | 2 +- .../trackermap/TrackerMap/client/apis/PermissionsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/PositionsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/ReportsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/ServerApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/SessionApi.kt | 2 +- .../trackermap/TrackerMap/client/apis/StatisticsApi.kt | 2 +- .../mx/trackermap/TrackerMap/client/apis/UsersApi.kt | 2 +- .../TrackerMap/client/infrastructure/ApiClient.kt | 6 ++++-- 19 files changed, 30 insertions(+), 26 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') 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()) } diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt index 1c9b663..2a67fd0 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/AttributesApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Attribute import mx.trackermap.TrackerMap.client.infrastructure.* -class AttributesApi : ApiClient() { +class AttributesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Attributes diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt index 56ee7b5..8dd2da8 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CalendarsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Calendar import mx.trackermap.TrackerMap.client.infrastructure.* -class CalendarsApi : ApiClient() { +class CalendarsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Calendars diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt index f00bc93..8ee7436 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/CommandsApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.CommandType import mx.trackermap.TrackerMap.client.infrastructure.* -class CommandsApi : ApiClient() { +class CommandsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Saved Commands diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt index 22903d1..74d105f 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DevicesApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.DeviceAccumulators import mx.trackermap.TrackerMap.client.infrastructure.* -class DevicesApi : ApiClient() { +class DevicesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Devices diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt index 7cf26d0..a9f47b8 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/DriversApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Driver import mx.trackermap.TrackerMap.client.infrastructure.* -class DriversApi : ApiClient() { +class DriversApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Drivers diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt index 5e5b8e6..360d6e1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/EventsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Event import mx.trackermap.TrackerMap.client.infrastructure.* -class EventsApi : ApiClient() { +class EventsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt index 23ac8c8..d7174e5 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GeofencesApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Geofence import mx.trackermap.TrackerMap.client.infrastructure.* -class GeofencesApi : ApiClient() { +class GeofencesApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Geofences diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt index 3b0dfa1..620a25e 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/GroupsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Group import mx.trackermap.TrackerMap.client.infrastructure.* -class GroupsApi : ApiClient() { +class GroupsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Groups diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt index 92480fe..5b10e9e 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/MaintenanceApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Maintenance import mx.trackermap.TrackerMap.client.infrastructure.* -class MaintenanceApi : ApiClient() { +class MaintenanceApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Maintenance diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt index 1f0d744..290a14d 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/NotificationsApi.kt @@ -16,7 +16,7 @@ import mx.trackermap.TrackerMap.client.models.NotificationType import mx.trackermap.TrackerMap.client.infrastructure.* -class NotificationsApi : ApiClient() { +class NotificationsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Notifications diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt index 02c9348..33aab48 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PermissionsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Permission import mx.trackermap.TrackerMap.client.infrastructure.* -class PermissionsApi : ApiClient() { +class PermissionsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Unlink an Object from another Object diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt index ecbf649..61285e9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/PositionsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Position import mx.trackermap.TrackerMap.client.infrastructure.* -class PositionsApi : ApiClient() { +class PositionsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetches a list of Positions diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt index 3dbee22..569a036 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt @@ -20,7 +20,7 @@ import mx.trackermap.TrackerMap.client.models.ReportTrips import mx.trackermap.TrackerMap.client.infrastructure.* -class ReportsApi : ApiClient() { +class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Events within the time period for the Devices or Groups diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt index 3c7787d..bf65dfe 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ServerApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Server import mx.trackermap.TrackerMap.client.infrastructure.* -class ServerApi : ApiClient() { +class ServerApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch Server information diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt index ad9e450..3f90c4c 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/SessionApi.kt @@ -18,7 +18,7 @@ import mx.trackermap.TrackerMap.client.infrastructure.* const val SERVER_URL_KEY = "server_url" const val ACCESS_TOKEN_KEY = "access_token" -class SessionApi : ApiClient() { +class SessionApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Close the Session diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt index 1857cc5..d121f81 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.Statistics import mx.trackermap.TrackerMap.client.infrastructure.* -class StatisticsApi : ApiClient() { +class StatisticsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch server Statistics diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt index 7b8d837..51f2138 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/UsersApi.kt @@ -15,7 +15,7 @@ import mx.trackermap.TrackerMap.client.models.User import mx.trackermap.TrackerMap.client.infrastructure.* -class UsersApi : ApiClient() { +class UsersApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { /** * Fetch a list of Users diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index 88aaa26..e5413e5 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -20,7 +20,9 @@ import mx.trackermap.TrackerMap.client.apis.ACCESS_TOKEN_KEY import mx.trackermap.TrackerMap.client.apis.SERVER_URL_KEY import kotlinx.serialization.json.Json as KotlinJson -open class ApiClient() { +open class ApiClient( + defaultBaseUrl: String = "", +) { companion object { protected const val ApiContentType = "Content-Type" protected const val ApiAccept = "Accept" @@ -64,7 +66,7 @@ open class ApiClient() { init { val settings = Settings() - baseUrl = settings.getString(SERVER_URL_KEY, "") + baseUrl = settings.getString(SERVER_URL_KEY, defaultBaseUrl) token = settings.getString(ACCESS_TOKEN_KEY, "") } -- cgit v1.2.3 From 166dab07f7f7ed60d87f584e03e90853356a2fcd Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 20 Jan 2022 23:23:59 -0600 Subject: Added license headers and removed unused imports --- .../mx/trackermap/TrackerMap/android/TrackerApp.kt | 18 +++++++++++++++++- .../TrackerMap/android/details/DetailsActivity.kt | 17 +++++++++++++++++ .../TrackerMap/android/details/UnitDetailsAdapter.kt | 17 +++++++++++++++++ .../android/details/commands/UnitCommandsFragment.kt | 17 +++++++++++++++++ .../android/details/commands/UnitCommandsViewModel.kt | 17 +++++++++++++++++ .../details/information/UnitInformationFragment.kt | 17 +++++++++++++++++ .../details/information/UnitInformationViewModel.kt | 17 +++++++++++++++++ .../android/details/reports/UnitReportsFragment.kt | 17 +++++++++++++++++ .../android/details/reports/UnitReportsViewModel.kt | 17 +++++++++++++++++ .../TrackerMap/android/devices/DevicesAdapter.kt | 17 +++++++++++++++++ .../TrackerMap/android/devices/DevicesFragment.kt | 17 +++++++++++++++++ .../trackermap/TrackerMap/android/map/MapFragment.kt | 17 +++++++++++++++++ .../TrackerMap/android/map/MapWrapperFragment.kt | 17 +++++++++++++++++ .../TrackerMap/android/map/UnitMapFragment.kt | 17 +++++++++++++++++ .../TrackerMap/android/session/LoginActivity.kt | 17 +++++++++++++++++ .../TrackerMap/android/session/LoginFragment.kt | 17 +++++++++++++++++ .../TrackerMap/android/session/LoginViewModel.kt | 19 +++++++++++++++++-- .../android/session/UserInformationActivity.kt | 17 +++++++++++++++++ .../android/session/UserInformationViewModel.kt | 17 +++++++++++++++++ .../android/shared/MarkerTransformations.kt | 17 +++++++++++++++++ .../TrackerMap/android/shared/UnitRenderData.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/android/shared/Utils.kt | 17 +++++++++++++++++ .../TrackerMap/android/units/UnitFragment.kt | 17 +++++++++++++++++ .../TrackerMap/android/units/UnitsActivity.kt | 19 +++++++++++++++++-- .../TrackerMap/android/units/UnitsViewModel.kt | 17 +++++++++++++++++ .../client/infrastructure/ApiAbstractions.kt | 17 +++++++++++++++++ .../TrackerMap/client/infrastructure/ApiClient.kt | 18 +++++++++++++++++- .../infrastructure/ApiInfrastructureResponse.kt | 17 +++++++++++++++++ .../TrackerMap/client/infrastructure/Errors.kt | 17 +++++++++++++++++ .../client/infrastructure/LocalDateAdapter.kt | 17 +++++++++++++++++ .../client/infrastructure/LocalDateTimeAdapter.kt | 17 +++++++++++++++++ .../TrackerMap/client/infrastructure/RequestConfig.kt | 17 +++++++++++++++++ .../TrackerMap/client/infrastructure/RequestMethod.kt | 17 +++++++++++++++++ .../TrackerMap/controllers/GeofencesController.kt | 17 +++++++++++++++++ .../TrackerMap/controllers/ReportController.kt | 17 +++++++++++++++++ .../TrackerMap/controllers/SessionController.kt | 18 +++++++++++++++++- .../TrackerMap/controllers/UnitsController.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/utils/Coroutines.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/utils/Formatter.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/utils/MapCalculus.kt | 19 +++++++++++++++++-- .../mx/trackermap/TrackerMap/utils/MarkerType.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/utils/ReportDates.kt | 17 +++++++++++++++++ .../mx/trackermap/TrackerMap/utils/SpeedUnit.kt | 17 +++++++++++++++++ 43 files changed, 731 insertions(+), 9 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') 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 c21cfe1..3ece19a 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt @@ -1,7 +1,23 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ 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 diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt index 9633332..aaa985f 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details import android.Manifest diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt index cc2a7c2..4eabfc9 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details import android.os.Bundle diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt index 9d12608..225ad96 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.commands import android.os.Bundle diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt index 06c0439..e4e8801 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.commands import android.util.Log diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt index 7966c5b..2a6a362 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.information import android.content.Intent diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt index 721fa68..838edb0 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.information import android.util.Log diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 08d7076..9aec401 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.reports import android.app.Activity diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt index 0bdf61b..c5390c9 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.details.reports import androidx.lifecycle.* diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt index b1854a9..2b968c6 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.devices import android.view.LayoutInflater diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt index b905beb..9428e93 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.devices import android.content.Intent diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt index c483d52..4f93b5c 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.map import android.graphics.Bitmap diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt index c8ef688..39dcbb5 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.map import android.os.Bundle diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt index 9718262..d475247 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.map import android.content.Intent diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt index 3fbab80..5d10cff 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.session import android.os.Bundle diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt index c87e134..884ea4f 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.session import android.content.* diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt index b5516e7..412c790 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt @@ -1,7 +1,22 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.session -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.zhuinden.eventemitter.EventEmitter diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt index 81577c7..8b1e84e 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.session import android.content.Intent diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt index 9bb5ac7..5835554 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.session import android.util.Log diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt index 660b436..68eef0c 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.shared import android.util.Log diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt index e8a4bd6..6b2a4b2 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.shared import android.content.Context diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt index fe18997..76358fb 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.shared import android.app.NotificationManager diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt index e514094..6b570b2 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.units import androidx.fragment.app.Fragment diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index 58147e4..dab692f 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.units import android.content.Context @@ -8,10 +25,8 @@ import android.view.View import android.view.inputmethod.InputMethodManager import android.widget.Toast import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.TooltipCompat import androidx.core.widget.doAfterTextChanged -import androidx.fragment.app.FragmentTransaction.TRANSIT_FRAGMENT_FADE import androidx.fragment.app.commit import kotlinx.coroutines.DelicateCoroutinesApi import mx.trackermap.TrackerMap.android.R diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt index cb30725..641dba6 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.android.units import android.util.Log diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt index f63f301..d88079b 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure typealias MultiValueMap = Map> diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index e5413e5..7f79a41 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -1,7 +1,23 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure import com.russhwolf.settings.Settings -import com.russhwolf.settings.string import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.engine.cio.* diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt index bc0b4fb..d104367 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure enum class ResponseType { diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt index 3c44140..c35e024 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure open class ClientException : RuntimeException { diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt index 7142665..5996d3a 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure import kotlinx.datetime.LocalDate diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt index d073ff4..b0f63d7 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure import kotlinx.datetime.LocalDateTime diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt index 73205ff..bcb75e1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure /** diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt index f118678..43846e1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.client.infrastructure /** diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt index e9b19b6..49adcb9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.controllers import kotlinx.coroutines.DelicateCoroutinesApi diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt index fcde002..027a25a 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.controllers import android.util.Log diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt index 7d944b7..42684ad 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt @@ -1,9 +1,25 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.controllers import android.util.Log import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.launch import kotlinx.serialization.json.JsonPrimitive diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt index a9ebae2..944caa9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.controllers import kotlinx.coroutines.CoroutineScope diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt index c953887..919fa72 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils import kotlinx.coroutines.delay diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt index c113bef..332c5c7 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils import kotlinx.datetime.* diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt index 1a0d27b..928e325 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt @@ -1,7 +1,22 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils -import kotlin.math.roundToLong - class MapCalculus { companion object { /** diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt index 65048ed..dc92ebc 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils enum class MarkerType { diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt index 360cce8..0f3640e 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils import kotlinx.coroutines.DelicateCoroutinesApi diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt index bc9cdb4..3d2de67 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt @@ -1,3 +1,20 @@ +/** + * TrackerMap + * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package mx.trackermap.TrackerMap.utils enum class SpeedUnit { -- cgit v1.2.3 From d49934780c10ba8af159e164be27aa7cb6755855 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 20 Jan 2022 23:26:05 -0600 Subject: Added 2022 to copyright. Damn, I forgot we were in 2022. --- README.md | 2 +- androidApp/src/main/java/mx/trackermap/TrackerMap/android/TrackerApp.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt | 2 +- .../TrackerMap/android/details/commands/UnitCommandsFragment.kt | 2 +- .../TrackerMap/android/details/commands/UnitCommandsViewModel.kt | 2 +- .../TrackerMap/android/details/information/UnitInformationFragment.kt | 2 +- .../TrackerMap/android/details/information/UnitInformationViewModel.kt | 2 +- .../TrackerMap/android/details/reports/UnitReportsFragment.kt | 2 +- .../TrackerMap/android/details/reports/UnitReportsViewModel.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt | 2 +- .../src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt | 2 +- .../mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt | 2 +- .../trackermap/TrackerMap/android/session/UserInformationViewModel.kt | 2 +- .../mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt | 2 +- .../src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 2 +- .../main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt | 2 +- .../mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt | 2 +- .../TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt | 2 +- .../mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt | 2 +- .../trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt | 2 +- .../mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt | 2 +- .../mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt | 2 +- .../kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt | 2 +- .../src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt | 2 +- 44 files changed, 44 insertions(+), 44 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/README.md b/README.md index 6707094..3a55a12 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ We're grateful to the developers of the following libraries, for making this pro ## License ``` -Copyright (C) 2021 Iván Ávalos , Henoch Ojeda +Copyright (C) 2021-2022-2022 Iván Ávalos , Henoch Ojeda This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as 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 3ece19a..1d181dd 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,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt index aaa985f..5272f06 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt index 4eabfc9..e913cb5 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/UnitDetailsAdapter.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt index 225ad96..ecd1a53 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt index e4e8801..3bb7f11 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt index 2a6a362..e731587 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt index 838edb0..43d8821 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 9aec401..22c75f4 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt index c5390c9..41a6b6d 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt index 2b968c6..4cfd6b5 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt index 9428e93..ad93429 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt index 4f93b5c..c715d07 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt index 39dcbb5..c9eab70 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt index d475247..e7e5ce0 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt index 5d10cff..23e781b 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginActivity.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt index 884ea4f..c855f44 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt index 412c790..bcee2ec 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt index 8b1e84e..e78e2b0 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt index 5835554..0d3784c 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt index 68eef0c..58ee108 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/MarkerTransformations.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt index 6b2a4b2..123e1ab 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt index 76358fb..aee7e51 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt index 6b570b2..05a14c9 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitFragment.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index dab692f..4371eed 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt index 641dba6..d7b6db1 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt index d88079b..47ab320 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiAbstractions.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index 7f79a41..2ae2b2e 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt index d104367..3e8cbed 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiInfrastructureResponse.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt index c35e024..737f98c 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/Errors.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt index 5996d3a..f60d986 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateAdapter.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt index b0f63d7..cbfc311 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/LocalDateTimeAdapter.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt index bcb75e1..ba5b12f 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestConfig.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt index 43846e1..2488ccb 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/RequestMethod.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt index 49adcb9..0e4c5c9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/GeofencesController.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt index 027a25a..82168da 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt index 42684ad..83b66fa 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt index 944caa9..b282a34 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt index 919fa72..21b6fc1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Coroutines.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt index 332c5c7..77d0d14 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt index 928e325..4476e39 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MapCalculus.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt index dc92ebc..fc2abf1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/MarkerType.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt index 0f3640e..5672536 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/ReportDates.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt index 3d2de67..a696b67 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/SpeedUnit.kt @@ -1,6 +1,6 @@ /** * TrackerMap - * Copyright (C) 2021 Iván Ávalos , Henoch Ojeda + * Copyright (C) 2021-2022 Iván Ávalos , Henoch Ojeda * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by -- cgit v1.2.3 From b4486deddafa28cfc441c7cbfa7f69540df89599 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 22 Jan 2022 00:28:07 -0600 Subject: Prepare shared module for iOS support and updated appcompat and constraintlayout libraries --- androidApp/build.gradle.kts | 4 ++-- shared/build.gradle.kts | 7 +++++-- .../trackermap/TrackerMap/client/infrastructure/ApiClient.kt | 11 ++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 5347780..6920eb1 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -45,8 +45,8 @@ val googleImplementation by configurations dependencies { implementation(project(":shared")) implementation("com.google.android.material:material:1.5.0") - implementation("androidx.appcompat:appcompat:1.4.0") - implementation("androidx.constraintlayout:constraintlayout:2.1.2") + implementation("androidx.appcompat:appcompat:1.4.1") + implementation("androidx.constraintlayout:constraintlayout:2.1.3") implementation("com.squareup.okhttp3:okhttp:4.9.1") implementation("com.github.Zhuinden:live-event:1.2.0") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 8832b1d..b8d36ff 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -24,7 +24,6 @@ kotlin { val commonMain by getting { dependencies { implementation("io.ktor:ktor-client-core:$ktor_version") - implementation("io.ktor:ktor-client-cio:$ktor_version") implementation("io.ktor:ktor-client-logging:$ktor_version") implementation("io.ktor:ktor-client-serialization:$ktor_version") implementation("ch.qos.logback:logback-classic:1.2.6") @@ -41,7 +40,11 @@ kotlin { implementation(kotlin("test-annotations-common")) } } - val androidMain by getting + val androidMain by getting { + dependencies { + implementation("io.ktor:ktor-client-cio:$ktor_version") + } + } val androidTest by getting { dependencies { implementation(kotlin("test-junit")) diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index 2ae2b2e..dd61893 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -20,7 +20,7 @@ package mx.trackermap.TrackerMap.client.infrastructure import com.russhwolf.settings.Settings import io.ktor.client.* import io.ktor.client.call.* -import io.ktor.client.engine.cio.* +import io.ktor.client.features.* import io.ktor.client.features.json.* import io.ktor.client.features.json.serializer.KotlinxSerializer import io.ktor.client.features.logging.DEFAULT @@ -47,7 +47,11 @@ open class ApiClient( protected const val ApiFormURLType = "application/x-www-form-urlencoded" protected const val ApiXmlMediaType = "application/xml" - val client: HttpClient = HttpClient(CIO) { + val client: HttpClient = HttpClient { + install(HttpTimeout) { + connectTimeoutMillis = 20_000 + requestTimeoutMillis = 20_000 + } install(JsonFeature) { serializer = KotlinxSerializer( KotlinJson { @@ -59,9 +63,6 @@ open class ApiClient( logger = Logger.DEFAULT level = LogLevel.ALL } - engine { - requestTimeout = 20_000 - } } val defaultHeaders: Map = -- cgit v1.2.3 From 707b89f48297c68af514d6aa475b13624652df51 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 22 Jan 2022 22:32:27 -0600 Subject: Removed all Java references from shared module --- .../TrackerMap/client/apis/ReportsApi.kt | 9 ++--- .../TrackerMap/client/apis/StatisticsApi.kt | 3 +- .../TrackerMap/client/models/Attribute.kt | 13 +++++--- .../TrackerMap/client/models/Calendar.kt | 4 ++- .../TrackerMap/client/models/CommandType.kt | 5 ++- .../TrackerMap/client/models/DeviceAccumulators.kt | 9 +++-- .../trackermap/TrackerMap/client/models/Driver.kt | 2 ++ .../TrackerMap/client/models/EventInformation.kt | 3 ++ .../trackermap/TrackerMap/client/models/Group.kt | 2 ++ .../TrackerMap/client/models/Maintenance.kt | 6 ++-- .../TrackerMap/client/models/Notification.kt | 2 ++ .../TrackerMap/client/models/NotificationType.kt | 5 ++- .../TrackerMap/client/models/Permission.kt | 19 ++++++----- .../TrackerMap/client/models/ReportSummary.kt | 17 ++++++---- .../TrackerMap/client/models/ReportTrips.kt | 38 ++++++++++++---------- .../trackermap/TrackerMap/client/models/Server.kt | 6 ++-- .../TrackerMap/client/models/Statistics.kt | 15 +++++---- 17 files changed, 100 insertions(+), 58 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt index 569a036..eff40ad 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/ReportsApi.kt @@ -12,6 +12,7 @@ package mx.trackermap.TrackerMap.client.apis import io.ktor.content.* +import kotlinx.datetime.LocalDateTime import mx.trackermap.TrackerMap.client.models.Event import mx.trackermap.TrackerMap.client.models.Position import mx.trackermap.TrackerMap.client.models.Stop @@ -248,8 +249,8 @@ class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { */ @Suppress("UNCHECKED_CAST") suspend fun reportsSummaryGet( - from: java.time.LocalDateTime, - to: java.time.LocalDateTime, + from: LocalDateTime, + to: LocalDateTime, deviceId: Array? = null, groupId: Array? = null ): Array { @@ -291,8 +292,8 @@ class ReportsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { */ @Suppress("UNCHECKED_CAST") suspend fun reportsTripsGet( - from: java.time.LocalDateTime, - to: java.time.LocalDateTime, + from: LocalDateTime, + to: LocalDateTime, deviceId: Array? = null, groupId: Array? = null ): Array { diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt index d121f81..296e589 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/apis/StatisticsApi.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.apis +import kotlinx.datetime.LocalDateTime import mx.trackermap.TrackerMap.client.models.Statistics import mx.trackermap.TrackerMap.client.infrastructure.* @@ -25,7 +26,7 @@ class StatisticsApi(defaultBaseUrl: String) : ApiClient(defaultBaseUrl) { * @return kotlin.Array */ @Suppress("UNCHECKED_CAST") - suspend fun statisticsGet(from: java.time.LocalDateTime, to: java.time.LocalDateTime): Array { + suspend fun statisticsGet(from: LocalDateTime, to: LocalDateTime): Array { val localVariableQuery: MultiValueMap = mapOf("from" to listOf("$from"), "to" to listOf("$to")) val localVariableConfig = RequestConfig( RequestMethod.GET, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt index 0404967..7c139b5 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Attribute.kt @@ -11,6 +11,8 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * @@ -20,13 +22,14 @@ package mx.trackermap.TrackerMap.client.models * @param expression * @param type String|Number|Boolean */ +@Serializable data class Attribute ( - val id: kotlin.Int? = null, - val description: kotlin.String? = null, - val attribute: kotlin.String? = null, - val expression: kotlin.String? = null, + val id: Int? = null, + val description: String? = null, + val attribute: String? = null, + val expression: String? = null, /* String|Number|Boolean */ - val type: kotlin.String? = null + val type: String? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt index c528673..6501ff4 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -19,8 +20,9 @@ import kotlinx.serialization.json.JsonPrimitive * @param id * @param name * @param `data` base64 encoded in iCalendar format - * @param attributes + * @param attributes */ +@Serializable data class Calendar ( val id: Int? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt index 7b1a742..fa00d24 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/CommandType.kt @@ -11,13 +11,16 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * * @param type */ +@Serializable data class CommandType ( - val type: kotlin.String? = null + val type: String? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt index 43c8fb9..87cb0a7 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/DeviceAccumulators.kt @@ -11,6 +11,8 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * @@ -18,11 +20,12 @@ package mx.trackermap.TrackerMap.client.models * @param totalDistance in meters * @param hours */ +@Serializable data class DeviceAccumulators ( - val deviceId: kotlin.Int? = null, + val deviceId: Int? = null, /* in meters */ - val totalDistance: java.math.BigDecimal? = null, - val hours: java.math.BigDecimal? = null + val totalDistance: Double? = null, + val hours: Long? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt index c83543e..309e4b9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -21,6 +22,7 @@ import kotlinx.serialization.json.JsonPrimitive * @param uniqueId * @param attributes */ +@Serializable data class Driver ( val id: Int? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt index 5e4b2d5..a008fa8 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/EventInformation.kt @@ -1,5 +1,8 @@ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + +@Serializable data class EventInformation( val event: Event, val position: Position?, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt index b90e591..6ab32cd 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -21,6 +22,7 @@ import kotlinx.serialization.json.JsonPrimitive * @param groupId * @param attributes */ +@Serializable data class Group ( val id: Int? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt index f9d4fcd..1979e1a 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -23,13 +24,14 @@ import kotlinx.serialization.json.JsonPrimitive * @param period * @param attributes */ +@Serializable data class Maintenance ( val id: Int? = null, val name: String? = null, val type: String? = null, - val start: java.math.BigDecimal? = null, - val period: java.math.BigDecimal? = null, + val start: Double? = null, + val period: Double? = null, val attributes: Map = mapOf() ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt index 2be5468..eb35ecd 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -25,6 +26,7 @@ import kotlinx.serialization.json.JsonPrimitive * @param calendarId * @param attributes */ +@Serializable data class Notification ( val id: Int? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt index 55763ca..486c67b 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/NotificationType.kt @@ -11,13 +11,16 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * * @param type */ +@Serializable data class NotificationType ( - val type: kotlin.String? = null + val type: String? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt index c4c236b..0d1be29 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Permission.kt @@ -11,6 +11,8 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 } @@ -23,23 +25,24 @@ package mx.trackermap.TrackerMap.client.models * @param driverId Driver Id, can be second parameter only * @param managedUserId User Id, can be second parameter only and only in combination with userId */ +@Serializable data class Permission ( /* User Id, can be only first parameter */ - val userId: kotlin.Int? = null, + val userId: Int? = null, /* Device Id, can be first parameter or second only in combination with userId */ - val deviceId: kotlin.Int? = null, + val deviceId: Int? = null, /* Group Id, can be first parameter or second only in combination with userId */ - val groupId: kotlin.Int? = null, + val groupId: Int? = null, /* Geofence Id, can be second parameter only */ - val geofenceId: kotlin.Int? = null, + val geofenceId: Int? = null, /* Calendar Id, can be second parameter only and only in combination with userId */ - val calendarId: kotlin.Int? = null, + val calendarId: Int? = null, /* Computed Attribute Id, can be second parameter only */ - val attributeId: kotlin.Int? = null, + val attributeId: Int? = null, /* Driver Id, can be second parameter only */ - val driverId: kotlin.Int? = null, + val driverId: Int? = null, /* User Id, can be second parameter only and only in combination with userId */ - val managedUserId: kotlin.Int? = null + val managedUserId: Int? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt index c6f59a6..25f5b9d 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportSummary.kt @@ -11,6 +11,8 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * @@ -22,18 +24,19 @@ package mx.trackermap.TrackerMap.client.models * @param spentFuel in liters * @param engineHours */ +@Serializable data class ReportSummary ( - val deviceId: kotlin.Int? = null, - val deviceName: kotlin.String? = null, + val deviceId: Int? = null, + val deviceName: String? = null, /* in knots */ - val maxSpeed: java.math.BigDecimal? = null, + val maxSpeed: Double? = null, /* in knots */ - val averageSpeed: java.math.BigDecimal? = null, + val averageSpeed: Double? = null, /* in meters */ - val distance: java.math.BigDecimal? = null, + val distance: Double? = null, /* in liters */ - val spentFuel: java.math.BigDecimal? = null, - val engineHours: kotlin.Int? = null + val spentFuel: Double? = null, + val engineHours: Double? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt index d7e9598..666b2ad 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/ReportTrips.kt @@ -11,6 +11,9 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.datetime.LocalDateTime +import kotlinx.serialization.Serializable + /** * @@ -32,30 +35,31 @@ package mx.trackermap.TrackerMap.client.models * @param driverUniqueId * @param driverName */ +@Serializable data class ReportTrips ( - val deviceId: kotlin.Int? = null, - val deviceName: kotlin.String? = null, + val deviceId: Int? = null, + val deviceName: String? = null, /* in knots */ - val maxSpeed: java.math.BigDecimal? = null, + val maxSpeed: Double? = null, /* in knots */ - val averageSpeed: java.math.BigDecimal? = null, + val averageSpeed: Double? = null, /* in meters */ - val distance: java.math.BigDecimal? = null, + val distance: Double? = null, /* in liters */ - val spentFuel: java.math.BigDecimal? = null, - val duration: kotlin.Int? = null, + val spentFuel: Double? = null, + val duration: Int? = null, /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ - val startTime: java.time.LocalDateTime? = null, - val startAddress: kotlin.String? = null, - val startLat: java.math.BigDecimal? = null, - val startLon: java.math.BigDecimal? = null, + val startTime: String? = null, + val startAddress: String? = null, + val startLat: Double? = null, + val startLon: Double? = null, /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ - val endTime: java.time.LocalDateTime? = null, - val endAddress: kotlin.String? = null, - val endLat: java.math.BigDecimal? = null, - val endLon: java.math.BigDecimal? = null, - val driverUniqueId: kotlin.Int? = null, - val driverName: kotlin.String? = null + val endTime: String? = null, + val endAddress: String? = null, + val endLat: Double? = null, + val endLon: Double? = null, + val driverUniqueId: Int? = null, + val driverName: String? = null ) { } \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt index d2ea44e..0c1e790 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt @@ -11,6 +11,7 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonPrimitive @@ -34,6 +35,7 @@ import kotlinx.serialization.json.JsonPrimitive * @param coordinateFormat * @param attributes */ +@Serializable data class Server ( val id: Int? = null, @@ -45,8 +47,8 @@ data class Server ( val bingKey: String? = null, val mapUrl: String? = null, val poiLayer: String? = null, - val latitude: java.math.BigDecimal? = null, - val longitude: java.math.BigDecimal? = null, + val latitude: Double? = null, + val longitude: Double? = null, val zoom: Int? = null, val twelveHourFormat: Boolean? = null, val version: String? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt index 32027b9..4ad71ce 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Statistics.kt @@ -11,6 +11,8 @@ */ package mx.trackermap.TrackerMap.client.models +import kotlinx.serialization.Serializable + /** * @@ -21,14 +23,15 @@ package mx.trackermap.TrackerMap.client.models * @param messagesReceived * @param messagesStored */ +@Serializable data class Statistics ( /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ - val captureTime: java.time.LocalDateTime? = null, - val activeUsers: kotlin.Int? = null, - val activeDevices: kotlin.Int? = null, - val requests: kotlin.Int? = null, - val messagesReceived: kotlin.Int? = null, - val messagesStored: kotlin.Int? = null + val captureTime: String? = null, + val activeUsers: Int? = null, + val activeDevices: Int? = null, + val requests: Int? = null, + val messagesReceived: Int? = null, + val messagesStored: Int? = null ) { } \ No newline at end of file -- cgit v1.2.3 From 0d85802f05fa0409b65891dce8fffe98d4d8b464 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 22 Jan 2022 22:34:14 -0600 Subject: Removed Log.d in SessionController.kt --- .../kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt index 83b66fa..a945ee9 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt @@ -17,7 +17,6 @@ */ package mx.trackermap.TrackerMap.controllers -import android.util.Log import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.MutableStateFlow @@ -52,7 +51,6 @@ class SessionController( GlobalScope.launch { try { userFlow.value = sessionApi.sessionGet() - Log.d("LoginViewModel", userFlow.value.toString()) loginStateFlow.value = LoginState.Success } catch (e: Exception) { loginStateFlow.value = LoginState.Failure @@ -65,10 +63,8 @@ class SessionController( GlobalScope.launch { try { userFlow.value = sessionApi.sessionGet() - Log.d("LoginViewModel", userFlow.value.toString()) loginStateFlow.value = LoginState.Success } catch (e: Exception) { - Log.d("LoginViewModel", "No session") loginStateFlow.value = LoginState.Nothing } } -- cgit v1.2.3 From 6256c457ce6fe49f564e9d5c718d3116f3a0d9c0 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 22 Jan 2022 22:36:48 -0600 Subject: Removed more references to Log.d in controllers --- .../TrackerMap/controllers/ReportController.kt | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'shared/src/commonMain/kotlin/mx') diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt index 82168da..b60a034 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt @@ -17,7 +17,6 @@ */ package mx.trackermap.TrackerMap.controllers -import android.util.Log import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.MutableStateFlow @@ -61,10 +60,6 @@ class ReportController( } val (currentDate, previousDate) = ReportDates.getDates(reportPeriod) - Log.d("UnitReportsVM", "Current report type: $reportType") - Log.d("UnitReportsVM", "Current report period: $reportType") - Log.d("UnitReportsVM", "Current date:${currentDate}") - Log.d("UnitReportsVM", "Previous date:${previousDate}") if (!xlsx) { reportFlow.value = Report.LoadingReport @@ -84,15 +79,11 @@ class ReportController( to: String, xlsx: Boolean ) { - Log.d("UnitReportsVM", "Fetching positions") - if (!xlsx) { val result = reportsApi.reportsRouteGet(from, to, deviceId) - Log.d("UnitReportsVM", "Positions report: $result") reportFlow.value = Report.PositionsReport(result) } else { val result = reportsApi.reportsRouteGetXlsx(from, to, deviceId) - Log.d("UnitReportsVM", "Positions report: $result") reportFlow.value = Report.XlsxReport(result) } @@ -105,7 +96,6 @@ class ReportController( types: List, xlsx: Boolean ) { - Log.d("UnitReportsVM", "Fetching events") if (!xlsx) { val positionsResult = reportsApi.reportsRouteGet(from, to, deviceId) @@ -123,14 +113,12 @@ class ReportController( )) } - Log.d("UnitReportsVM", "Events report: $result") reportFlow.value = Report.EventsReport(result.toTypedArray()) } else { val result = reportsApi.reportsEventsGetXlsx( from, to, EventInformation.reportTypesToStrings(types), deviceId ) - Log.d("UnitReportsVM", "Events report: $result") reportFlow.value = Report.XlsxReport(result) } } @@ -141,15 +129,11 @@ class ReportController( to: String, xlsx: Boolean ) { - Log.d("UnitReportsVM", "Fetching stops") - if (!xlsx) { val result = reportsApi.reportsStopsGet(from, to, deviceId) - Log.d("UnitReportsVM", "Stops report: $result") reportFlow.value = Report.StopsReport(result) } else { val result = reportsApi.reportsStopsGetXlsx(from, to, deviceId) - Log.d("UnitReportsVM", "Stops report: $result") reportFlow.value = Report.XlsxReport(result) } -- cgit v1.2.3