From 86f0d2a8d592b555e51af1d8ea9ebfb1b4a59bb7 Mon Sep 17 00:00:00 2001 From: MarcusBarta Date: Mon, 21 Oct 2024 12:44:27 +1100 Subject: [PATCH] Attempt at reloadMap(), no testing done yet. --- .../nearby/fragments/NearbyParentFragment.java | 18 +++++++++++++++--- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java index 943352d92..99ef571b6 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java @@ -1131,16 +1131,28 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment /** * Reloads the Nearby map + * Clears all location markers, refreshes them, reinserts them into the map. + * @author Marcus Barta - marcusbarta@icloud.com */ - private void reloadMap(){ - + private void reloadMap() { + // TODO: Marcus's section + clearAllMarkers(); // clear the list of markers + binding.map.getController().setZoom(ZOOM_LEVEL); // reset the zoom level + binding.map.getController().setCenter(lastMapFocus); // recentre the focus + if (locationPermissionsHelper.checkLocationPermission(getActivity())) { + locationPermissionGranted(); // reload map with user's location + } else { + startMapWithoutPermission(); // reload map without user's location + } + binding.map.invalidate(); // invalidate the map + presenter.updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED); // restart the map } /** * Empties the Nearby local cache */ - private void emptyCache(){ + private void emptyCache() { } diff --git a/build.gradle b/build.gradle index 003163cb8..b0bad89a5 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' + classpath 'com.android.tools.build:gradle:8.7.0' classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath 'org.codehaus.groovy:groovy-all:2.4.15' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fb6a72053..fd53d45f9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Apr 23 18:22:54 IST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file