mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	fix app Crash when tapping on the nearbyNotification (#4139)
* bugfix-#4086 -> implement CallBack interface in MainActivity centerMapToPlace() function * update previous commit * reformed the codechanges
This commit is contained in:
		
							parent
							
								
									7730112807
								
							
						
					
					
						commit
						86c571ceee
					
				
					 2 changed files with 21 additions and 1 deletions
				
			
		|  | @ -214,6 +214,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | |||
|     private fr.free.nrw.commons.location.LatLng lastFocusLocation; | ||||
|     private LatLngBounds latLngBounds; | ||||
|     private PlaceAdapter adapter; | ||||
|     private NearbyParentFragmentInstanceReadyCallback nearbyParentFragmentInstanceReadyCallback; | ||||
| 
 | ||||
|     @NonNull | ||||
|     public static NearbyParentFragment newInstance() { | ||||
|  | @ -271,6 +272,9 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | |||
|                 uiSettings.setAttributionEnabled(false); | ||||
|                 uiSettings.setRotateGesturesEnabled(false); | ||||
|                 isMapBoxReady =true; | ||||
|                 if(nearbyParentFragmentInstanceReadyCallback!=null){ | ||||
|                     nearbyParentFragmentInstanceReadyCallback.onReady(); | ||||
|                 } | ||||
|                 performMapReadyActions(); | ||||
|                 final CameraPosition cameraPosition = new CameraPosition.Builder() | ||||
|                         .target(new LatLng(51.50550, -0.07520)) | ||||
|  | @ -1531,4 +1535,12 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment | |||
|         mapView.onStart(); | ||||
|         performMapReadyActions(); | ||||
|     } | ||||
| 
 | ||||
|     public interface  NearbyParentFragmentInstanceReadyCallback{ | ||||
|         void onReady(); | ||||
|     } | ||||
| 
 | ||||
|     public void setNearbyParentFragmentInstanceReadyCallback(NearbyParentFragmentInstanceReadyCallback nearbyParentFragmentInstanceReadyCallback) { | ||||
|         this.nearbyParentFragmentInstanceReadyCallback = nearbyParentFragmentInstanceReadyCallback; | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Prince kushwaha
						Prince kushwaha