Bimba.git

commit 3ddf8ece77302b3b0578d6e7c40e9f0716364485

Author: Adam <git@apiote.xyz>

cleanup

%!v(PANIC=String method: strings: negative Repeat count)


diff --git a/app/src/main/java/ml/adamsprogs/bimba/api/Api.kt b/app/src/main/java/ml/adamsprogs/bimba/api/Api.kt
index 3b34947f08ab9c64c6358eedea3554e11ed538b8..173e954ef3625e71ddcb0c376c7ca2929aea3f31 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/api/Api.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/api/Api.kt
@@ -84,6 +84,7 @@ 	return request(server, "departures", params, cm)
 }
 
 suspend fun rawRequest(url: URL, server: Server, cm: ConnectivityManager): Result {
+	// todo[api-freeze] request and check api version
 	@Suppress("DEPRECATION")  // fixme later(API_29, API_23) https://developer.android.com/reference/android/net/ConnectivityManager#getActiveNetwork()
 	if (cm.activeNetworkInfo == null) {
 		return Result(null, Error(0, R.string.error_offline, R.drawable.error_net))




diff --git a/app/src/main/java/ml/adamsprogs/bimba/api/Structs.kt b/app/src/main/java/ml/adamsprogs/bimba/api/Structs.kt
index cc674596de82f8f5dd40e9ecaa83d9887e2e2af2..18f77b37bc4e46641615a2bedf43204dc38f5bb6 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/api/Structs.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/api/Structs.kt
@@ -53,7 +53,7 @@ 	val offsetH: Int,
 	val offsetM: Int
 ) {
 	fun toString(context: Context): String {
-		return DateFormat.getDateFormat(context).format(Date(year, month, day))
+		return DateFormat.getDateFormat(context).format(GregorianCalendar(year, month, day))
 	}
 
 	companion object {




diff --git a/app/src/main/java/ml/adamsprogs/bimba/dashboard/ui/map/MapFragment.kt b/app/src/main/java/ml/adamsprogs/bimba/dashboard/ui/map/MapFragment.kt
index 6267a6598bbb72421f39492c77ec29ac1c70cc7b..65286da00108c3fe6d9957042c063c67bbb490a3 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/dashboard/ui/map/MapFragment.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/dashboard/ui/map/MapFragment.kt
@@ -38,7 +38,7 @@ import org.osmdroid.views.overlay.gestures.RotationGestureOverlay
 import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider
 import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay
 
-// todo empty state on no network
+// todo[3.1] empty state on no network
 
 class MapFragment : Fragment() {
 




diff --git a/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt b/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt
index 2fc1050efba838eb958e88b9a000baf5d517c6bd..bf522b8731c94c5357101e8d8d82064aee2a6c1a 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/departures/Departures.kt
@@ -239,7 +239,7 @@ 				if (departure.vehicle.Position.isZero()) {
 					map.visibility = View.GONE
 					return@let
 				}
-				map.controller.apply { // todo glide to centre, not jump
+				map.controller.apply { // todo[3.1] glide to centre, not jump
 					setZoom(19.0f.toDouble())
 					setCenter(
 						GeoPoint(




diff --git a/app/src/main/java/ml/adamsprogs/bimba/settings/ServerChooserActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/settings/ServerChooserActivity.kt
index 5834d738306c49f102253ad222c965047e5cc14d..d39f1d61c77c6318abaf8c6e439e011e74b8308d 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/settings/ServerChooserActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/settings/ServerChooserActivity.kt
@@ -4,10 +4,10 @@ import android.content.Context
 import android.content.Intent
 import android.content.SharedPreferences
 import android.net.ConnectivityManager
-import androidx.appcompat.app.AppCompatActivity
 import android.os.Bundle
 import android.util.Log
 import androidx.activity.result.contract.ActivityResultContracts
+import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.content.res.AppCompatResources
 import androidx.core.content.edit
 import androidx.core.widget.addTextChangedListener




diff --git a/app/src/main/java/ml/adamsprogs/bimba/settings/feeds/FeedChooserActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/settings/feeds/FeedChooserActivity.kt
index f88d41691203b2ac081947a674be713c0fc27960..f6b54709744b3b1f7457987b065ec7a8760b8a1b 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/settings/feeds/FeedChooserActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/settings/feeds/FeedChooserActivity.kt
@@ -3,10 +3,10 @@
 import android.content.Context
 import android.content.Intent
 import android.net.ConnectivityManager
-import androidx.appcompat.app.AppCompatActivity
 import android.os.Bundle
 import android.util.Log
 import android.view.View
+import androidx.appcompat.app.AppCompatActivity
 import androidx.core.content.edit
 import androidx.recyclerview.widget.LinearLayoutManager
 import kotlinx.coroutines.MainScope




diff --git a/app/src/main/java/xyz/apiote/fruchtfleisch/Reader.kt b/app/src/main/java/xyz/apiote/fruchtfleisch/Reader.kt
index 385a0005f01e6003f91deca497a3f10a63a15c2d..77921d8841da356c489f7c19f7576691ab1fe2f1 100644
--- a/app/src/main/java/xyz/apiote/fruchtfleisch/Reader.kt
+++ b/app/src/main/java/xyz/apiote/fruchtfleisch/Reader.kt
@@ -5,6 +5,7 @@ import java.io.InputStream
 import java.lang.Double.longBitsToDouble
 import java.lang.Float.intBitsToFloat
 
+@Suppress("MemberVisibilityCanBePrivate", "unused", "BooleanMethodIsAlwaysInverted")
 class Reader(private val stream: InputStream) {
 	fun readUInt(): ULong {
 		var result: ULong = 0UL