Bimba.git

commit 70e489f76f1d6948fa6dd435946aedb4f0dbd14b

Author: Adam Evyčędo <git@apiote.xyz>

change realtime icon

 app/build.gradle.kts | 24 
 app/src/main/java/xyz/apiote/bimba/czwek/departures/Departures.kt | 53 
 app/src/main/res/drawable/radar.xml | 15 


diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index c52a049409bc20e9edfcedfb699bcc38a1e3434f..f0481fe773315686516130d05f5de05037e64df6 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -11,9 +11,9 @@ }
 
 android {
 	namespace = "xyz.apiote.bimba.czwek"
-	compileSdk = 34  // https://gitlab.com/fdroid/fdroiddata/-/issues/3299#note_1989808414
-	buildToolsVersion =
-		"34.0.0"  // https://gitlab.com/fdroid/fdroiddata/-/issues/3299#note_1989808414
+	// TODO apksigner with `--alignment-preserved` https://gitlab.com/fdroid/fdroiddata/-/issues/3299#note_1989808414
+	compileSdk = 35
+	buildToolsVersion = "35.0.0"
 
 	defaultConfig {
 		applicationId = "xyz.apiote.bimba.czwek"
@@ -50,26 +50,26 @@ 	}
 }
 
 dependencies {
-	implementation("androidx.core:core-ktx:1.13.1")
+	implementation("androidx.core:core-ktx:1.15.0")
 	implementation("androidx.appcompat:appcompat:1.7.0")
 	implementation("com.google.android.material:material:1.12.0")
-	implementation("androidx.constraintlayout:constraintlayout:2.1.4")
-	implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.6")
-	implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6")
-	implementation("androidx.navigation:navigation-fragment-ktx:2.8.2")
-	implementation("androidx.navigation:navigation-ui-ktx:2.8.2")
+	implementation("androidx.constraintlayout:constraintlayout:2.2.0")
+	implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7")
+	implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
+	implementation("androidx.navigation:navigation-fragment-ktx:2.8.3")
+	implementation("androidx.navigation:navigation-ui-ktx:2.8.3")
 	implementation("androidx.legacy:legacy-support-v4:1.0.0")
 	implementation("androidx.core:core-splashscreen:1.0.1")
 	implementation("com.google.openlocationcode:openlocationcode:1.0.4")
 	implementation("org.osmdroid:osmdroid-android:6.1.20")
 	implementation("org.yaml:snakeyaml:2.3")
-	implementation("androidx.activity:activity-ktx:1.9.2")
+	implementation("androidx.activity:activity-ktx:1.9.3")
 	implementation("com.otaliastudios:zoomlayout:1.9.0")
 	implementation("dev.bandb.graphview:graphview:0.8.1")
 	implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3")
 	implementation("com.github.jershell:kbson:0.5.0")
 	implementation("androidx.preference:preference-ktx:1.2.1")
-	implementation("androidx.work:work-runtime-ktx:2.9.1")
+	implementation("androidx.work:work-runtime-ktx:2.10.0")
 	implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.10.0")
 	implementation("commons-io:commons-io:2.17.0")
 	implementation("com.google.guava:guava:33.3.1-android")
@@ -77,7 +77,7 @@ 	implementation(project(":fruchtfleisch"))
 	implementation("ch.acra:acra-http:5.11.4")
 	implementation("ch.acra:acra-notification:5.11.4")
 
-	coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
+	coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3")
 
 	testImplementation("junit:junit:4.13.2")
 	androidTestImplementation("androidx.test.ext:junit:1.2.1")




diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/departures/Departures.kt b/app/src/main/java/xyz/apiote/bimba/czwek/departures/Departures.kt
index 17c08de21676990de2632a77c932c099454c4626..1f732ae3e9c31ed6ecc8dd9c8a343738ea0ff0ac 100644
--- a/app/src/main/java/xyz/apiote/bimba/czwek/departures/Departures.kt
+++ b/app/src/main/java/xyz/apiote/bimba/czwek/departures/Departures.kt
@@ -34,7 +34,6 @@ import org.osmdroid.views.MapView
 import org.osmdroid.views.overlay.Marker
 import org.osmdroid.views.overlay.TilesOverlay
 import org.osmdroid.views.overlay.gestures.RotationGestureOverlay
-import org.w3c.dom.Text
 import xyz.apiote.bimba.czwek.R
 import xyz.apiote.bimba.czwek.dpToPixelI
 import xyz.apiote.bimba.czwek.repo.Alert
@@ -80,22 +79,31 @@ 				)
 
 			when {
 				departure.isRealtime -> {
-					holder?.timeStatus?.setImageResource(R.drawable.radar)
-					holder?.timeStatus?.contentDescription =
-						context?.getString(R.string.realtime_content_description)
 					holder?.timeStatus?.let {
+						it.contentDescription =
+							context?.getString(R.string.realtime_content_description)
+						it.setImageResource(R.drawable.radar)
 						TooltipCompat.setTooltipText(
 							it,
 							context?.getString(R.string.realtime_content_description)
 						)
+						// TODO all at the same time with setCurrentFraction based on wall clock
+						/*ObjectAnimator.ofPropertyValuesHolder(it, PropertyValuesHolder.ofFloat("alpha", 0.0f))
+							.apply {
+								setDuration(1000)
+								repeatCount = ObjectAnimator.INFINITE
+								repeatMode = ObjectAnimator.REVERSE
+							}
+							.start()*/
 					}
 				}
 
 				departure.exact -> {
-					holder?.timeStatus?.setImageResource(R.drawable.calendar)
-					holder?.timeStatus?.contentDescription =
-						context?.getString(R.string.exact_content_description)
+					// FIXME clear animation
 					holder?.timeStatus?.let {
+						it.setImageResource(R.drawable.calendar)
+						it.contentDescription =
+							context?.getString(R.string.exact_content_description)
 						TooltipCompat.setTooltipText(
 							it,
 							context?.getString(R.string.exact_content_description)
@@ -104,6 +112,7 @@ 					}
 				}
 
 				else -> {
+					// FIXME clear animation
 					holder?.timeStatus?.setImageResource(R.drawable.inexact)
 					holder?.timeStatus?.contentDescription =
 						context?.getString(R.string.inexact_content_description)
@@ -205,15 +214,15 @@ 			val oldDeparture = oldDepartures[oldItemPosition]
 			val newDeparture = newDepartures[newItemPosition]
 			return if (oldDeparture.departure != null && newDeparture.departure != null) {
 				!oldDeparture.departure.terminusArrival &&
-						oldDeparture.departure.terminusArrival == newDeparture.departure.terminusArrival &&
-						oldDeparture.departure.exact == newDeparture.departure.exact &&
-						oldDeparture.departure.vehicle.Line == newDeparture.departure.vehicle.Line &&
-						oldDeparture.departure.vehicle.Headsign == newDeparture.departure.vehicle.Headsign &&
-						oldDeparture.departure.statusText(
-							context,
-							false,
-							lastUpdate
-						) == newDeparture.departure.statusText(context, false) && !showAsTimeChanged
+					oldDeparture.departure.terminusArrival == newDeparture.departure.terminusArrival &&
+					oldDeparture.departure.exact == newDeparture.departure.exact &&
+					oldDeparture.departure.vehicle.Line == newDeparture.departure.vehicle.Line &&
+					oldDeparture.departure.vehicle.Headsign == newDeparture.departure.vehicle.Headsign &&
+					oldDeparture.departure.statusText(
+						context,
+						false,
+						lastUpdate
+					) == newDeparture.departure.statusText(context, false) && !showAsTimeChanged
 			} else if (oldDeparture.alert.isNotEmpty() && newDeparture.alert.isEmpty()) {
 				oldDeparture.alert == newDeparture.alert
 			} else {
@@ -382,11 +391,11 @@
 
 			departure.boardingText(ctx).let {
 				findViewById<TextView>(R.id.boarding_text).text = it
-					findViewById<ImageView>(R.id.boarding_icon).visibility = if (it == "") {
-						View.GONE
-					} else {
-						View.VISIBLE
-					}
+				findViewById<ImageView>(R.id.boarding_icon).visibility = if (it == "") {
+					View.GONE
+				} else {
+					View.VISIBLE
+				}
 			}
 			UnitSystem.getSelected(requireContext()).let { us ->
 				findViewById<TextView>(R.id.speed_text).apply {
@@ -537,7 +546,7 @@ 			content.apply {
 				findViewById<MapView>(R.id.map).let { map ->
 					map.setTileSource(TileSourceFactory.MAPNIK)
 					if (((context?.resources?.configuration?.uiMode ?: UI_MODE_NIGHT_UNDEFINED)
-								and UI_MODE_NIGHT_MASK) == UI_MODE_NIGHT_YES
+							and UI_MODE_NIGHT_MASK) == UI_MODE_NIGHT_YES
 					) {
 						map.overlayManager.tilesOverlay.setColorFilter(TilesOverlay.INVERT_COLORS)
 					}




diff --git a/app/src/main/res/drawable/radar.xml b/app/src/main/res/drawable/radar.xml
index f68d13754fc956d4f9ac08166860576029d28b09..376de31d4cfec3e89591559016392ec6588e29ca 100644
--- a/app/src/main/res/drawable/radar.xml
+++ b/app/src/main/res/drawable/radar.xml
@@ -4,8 +4,15 @@
 SPDX-License-Identifier: Apache-2.0
 -->
 
-<vector android:height="24dp" android:tint="?attr/colorOnSurface"
-    android:viewportHeight="24" android:viewportWidth="24"
-    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
-    <path android:fillColor="@android:color/white" android:pathData="M19.74,18.33C21.15,16.6 22,14.4 22,12c0,-5.52 -4.48,-10 -10,-10S2,6.48 2,12s4.48,10 10,10c2.4,0 4.6,-0.85 6.33,-2.26c0.27,-0.22 0.53,-0.46 0.78,-0.71c0.03,-0.03 0.05,-0.06 0.07,-0.08C19.38,18.75 19.57,18.54 19.74,18.33zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8c0,1.85 -0.63,3.54 -1.69,4.9l-1.43,-1.43c0.69,-0.98 1.1,-2.17 1.1,-3.46c0,-3.31 -2.69,-6 -6,-6s-6,2.69 -6,6s2.69,6 6,6c1.3,0 2.51,-0.42 3.49,-1.13l1.42,1.42C15.54,19.37 13.85,20 12,20zM13.92,12.51c0.17,-0.66 0.02,-1.38 -0.49,-1.9l-0.02,-0.02c-0.77,-0.77 -2,-0.78 -2.78,-0.04c-0.01,0.01 -0.03,0.02 -0.05,0.04c-0.78,0.78 -0.78,2.05 0,2.83l0.02,0.02c0.52,0.51 1.25,0.67 1.91,0.49l1.51,1.51c-0.6,0.36 -1.29,0.58 -2.04,0.58c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4s4,1.79 4,4c0,0.73 -0.21,1.41 -0.56,2L13.92,12.51z" />
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+	android:width="24dp"
+	android:height="24dp"
+	android:tint="?attr/colorOnSurface"
+	android:viewportWidth="24"
+	android:viewportHeight="24">
+
+	<path
+		android:fillColor="@android:color/white"
+		android:pathData="M15.44,0.59l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L11.55,7.3c-0.78,-0.78 -2.05,-0.78 -2.83,0L7.3,8.72c-0.78,0.78 -0.78,2.05 0,2.83l1.24,1.24l-0.71,0.71L6.6,12.25c-0.78,-0.78 -2.05,-0.78 -2.83,0l-3.18,3.18c-0.78,0.78 -0.78,2.05 0,2.83l3.54,3.54c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-1.24,-1.24l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l1.41,-1.41c0.78,-0.78 0.78,-2.05 0,-2.83L13.84,9.6l0.71,-0.71l1.24,1.24c0.78,0.78 2.05,0.78 2.83,0l3.18,-3.18c0.78,-0.78 0.78,-2.05 0,-2.83l-3.54,-3.54C17.48,-0.2 16.22,-0.2 15.44,0.59zM6.6,19.32l-1.06,1.06L2,16.85l1.06,-1.06L6.6,19.32zM8.72,17.2l-1.06,1.06l-3.54,-3.54l1.06,-1.06L8.72,17.2zM18.26,7.66L17.2,8.72l-3.54,-3.54l1.06,-1.06L18.26,7.66zM20.38,5.54L19.32,6.6l-3.54,-3.54L16.85,2L20.38,5.54zM14,21l0,2c4.97,0 9,-4.03 9,-9l-2,0C21,17.87 17.87,21 14,21zM14,17l0,2c2.76,0 5,-2.24 5,-5l-2,0C17,15.66 15.66,17 14,17z" />
+
 </vector>