mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin/5806-refresh-btn' into 5806-refresh-btn
# Conflicts: # app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java
This commit is contained in:
		
						commit
						979f3a3fbc
					
				
					 3 changed files with 17 additions and 8 deletions
				
			
		|  | @ -32,7 +32,6 @@ import android.preference.PreferenceManager; | ||||||
| import android.provider.Settings; | import android.provider.Settings; | ||||||
| import android.text.Html; | import android.text.Html; | ||||||
| import android.text.method.LinkMovementMethod; | import android.text.method.LinkMovementMethod; | ||||||
| import android.util.Log; |  | ||||||
| import android.view.LayoutInflater; | import android.view.LayoutInflater; | ||||||
| import android.view.Menu; | import android.view.Menu; | ||||||
| import android.view.MenuInflater; | import android.view.MenuInflater; | ||||||
|  | @ -320,7 +319,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | ||||||
|             @Override |             @Override | ||||||
|             public boolean onMenuItemClick(MenuItem item) { |             public boolean onMenuItemClick(MenuItem item) { | ||||||
|                 try { |                 try { | ||||||
|                     Timber.d("Reload: menuItem"); |  | ||||||
|                     // REFRESH BUTTON FUNCTIONALITY HERE |                     // REFRESH BUTTON FUNCTIONALITY HERE | ||||||
|                     emptyCache(); |                     emptyCache(); | ||||||
|                     reloadMap(); |                     reloadMap(); | ||||||
|  | @ -1132,11 +1130,22 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Reloads the Nearby map. |      *  Reloads the Nearby map | ||||||
|      * This method clears the existing markers, resets the map state, and repopulates the map with the latest data. |      *  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 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ buildscript { | ||||||
|         maven { url "https://plugins.gradle.org/m2/" } |         maven { url "https://plugins.gradle.org/m2/" } | ||||||
|     } |     } | ||||||
|     dependencies { |     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 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2' | ||||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" |         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" | ||||||
|         classpath 'org.codehaus.groovy:groovy-all:2.4.15' |         classpath 'org.codehaus.groovy:groovy-all:2.4.15' | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,6 @@ | ||||||
| #Sun Apr 23 18:22:54 IST 2023 | #Sun Apr 23 18:22:54 IST 2023 | ||||||
| distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||||
| distributionPath=wrapper/dists | 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 | zipStoreBase=GRADLE_USER_HOME | ||||||
| zipStorePath=wrapper/dists | zipStorePath=wrapper/dists | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Noah Vendrig
						Noah Vendrig