mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Merge remote-tracking branch 'refs/remotes/commons-app/directNearbyUploads' into nearby-uploads
This commit is contained in:
		
						commit
						405c163e60
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		|  | @ -26,6 +26,7 @@ import com.google.gson.Gson; | |||
| import com.google.gson.GsonBuilder; | ||||
| import com.google.gson.reflect.TypeToken; | ||||
| import com.mapbox.mapboxsdk.Mapbox; | ||||
| import com.mapbox.mapboxsdk.annotations.Marker; | ||||
| import com.mapbox.mapboxsdk.annotations.MarkerOptions; | ||||
| import com.mapbox.mapboxsdk.annotations.PolygonOptions; | ||||
| import com.mapbox.mapboxsdk.camera.CameraPosition; | ||||
|  | @ -83,6 +84,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     private ContributionController controller; | ||||
| 
 | ||||
|     private Place place; | ||||
|     private Marker selected; | ||||
| 
 | ||||
|     public NearbyMapFragment() { | ||||
|     } | ||||
|  | @ -142,6 +144,8 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|                 else if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior | ||||
|                         .STATE_COLLAPSED) { | ||||
|                     bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                     mapView.getMapAsync(MapboxMap::deselectMarkers); | ||||
|                     selected=null; | ||||
|                     return true; | ||||
|                 } | ||||
|             } | ||||
|  | @ -257,8 +261,15 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|         mapView.getMapAsync(mapboxMap -> { | ||||
|             mapboxMap.addMarkers(baseMarkerOptions); | ||||
| 
 | ||||
|             mapboxMap.setOnInfoWindowCloseListener(marker -> { | ||||
|                 if (marker == selected){ | ||||
|                     bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                 } | ||||
|             }); | ||||
| 
 | ||||
|             mapboxMap.setOnMarkerClickListener(marker -> { | ||||
|                 if (marker instanceof NearbyMarker) { | ||||
|                     this.selected = marker; | ||||
|                     NearbyMarker nearbyMarker = (NearbyMarker) marker; | ||||
|                     Place place = nearbyMarker.getNearbyBaseMarker().getPlace(); | ||||
|                     passInfoToSheet(place); | ||||
|  | @ -332,6 +343,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|                 this.getView().requestFocus(); | ||||
|                 break; | ||||
|             case (BottomSheetBehavior.STATE_HIDDEN): | ||||
|                 mapView.getMapAsync(MapboxMap::deselectMarkers); | ||||
|                 transparentView.setClickable(false); | ||||
|                 transparentView.setAlpha(0); | ||||
|                 closeFabs(isFabOpen); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 misaochan
						misaochan