From 344474859073388be0c028002c80f4de6afa6f01 Mon Sep 17 00:00:00 2001 From: Cristan Meijer Date: Sat, 30 Nov 2024 19:13:07 +0100 Subject: [PATCH] Clean up code --- .../java/nl/ovfietsbeschikbaarheid/util/LocationLoader.kt | 1 - .../nl/ovfietsbeschikbaarheid/viewmodel/HomeViewModel.kt | 5 +---- app/src/main/res/values/strings.xml | 1 - app/src/main/res/xml/data_extraction_rules.xml | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/nl/ovfietsbeschikbaarheid/util/LocationLoader.kt b/app/src/main/java/nl/ovfietsbeschikbaarheid/util/LocationLoader.kt index 56c098f..3bc4cab 100644 --- a/app/src/main/java/nl/ovfietsbeschikbaarheid/util/LocationLoader.kt +++ b/app/src/main/java/nl/ovfietsbeschikbaarheid/util/LocationLoader.kt @@ -20,7 +20,6 @@ class LocationLoader( @SuppressLint("MissingPermission") suspend fun loadCurrentCoordinates(): Coordinates? { - // TODO: add delay to test not calling when it is already recently called val currentLocationRequest = CurrentLocationRequest.Builder() .setDurationMillis(5000) .setGranularity(Granularity.GRANULARITY_COARSE) diff --git a/app/src/main/java/nl/ovfietsbeschikbaarheid/viewmodel/HomeViewModel.kt b/app/src/main/java/nl/ovfietsbeschikbaarheid/viewmodel/HomeViewModel.kt index 56afcf7..728a91f 100644 --- a/app/src/main/java/nl/ovfietsbeschikbaarheid/viewmodel/HomeViewModel.kt +++ b/app/src/main/java/nl/ovfietsbeschikbaarheid/viewmodel/HomeViewModel.kt @@ -233,11 +233,8 @@ class HomeViewModel( } } catch (e: CancellationException) { // The job got cancelled. That's fine: the new job will show the user what they want. - // TODO: check if this is still needed after the refactoring is complete } catch (e: Exception) { - Timber.e(e, "fetchLocation: Failed to fetch location ${this@launch}") - // TODO: get rid of the printlns and maybe some of the Timbers - println("fetchLocation: Failed to fetch location ${this@launch}; $e") + Timber.e(e, "fetchLocation: Failed to fetch location") _content.value = HomeContent.NetworkError } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b4372ec..d4b3f0d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -55,7 +55,6 @@ • Gaat %1$s open om %2$s Sluit snel • Sluit om %1$s - Open Open tot %1$s 24/7 open Openingstijden diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml index 9ee9997..48808cc 100644 --- a/app/src/main/res/xml/data_extraction_rules.xml +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -5,7 +5,7 @@ --> -