mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Add map marker listener
This commit is contained in:
		
							parent
							
								
									e2a7b4ffd8
								
							
						
					
					
						commit
						de2b05fc0b
					
				
					 1 changed files with 26 additions and 4 deletions
				
			
		|  | @ -48,7 +48,6 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|     private FloatingActionButton fabCamera; | ||||
|     private FloatingActionButton fabGallery; | ||||
|     private View transparentView; | ||||
|     private int currBottomSheetState; | ||||
|     private boolean isFabOpen=false; | ||||
|     private Animation rotate_backward; | ||||
|     private Animation fab_close; | ||||
|  | @ -137,7 +136,8 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         bottomSheetDetailsBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { | ||||
|         bottomSheetDetailsBehavior.setBottomSheetCallback(new BottomSheetBehavior | ||||
|                 .BottomSheetCallback() { | ||||
|             @Override | ||||
|             public void onStateChanged(@NonNull View bottomSheet, int newState) { | ||||
|                 prepareViewsForSheetPosition(newState); | ||||
|  | @ -150,6 +150,21 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|                 } | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         bottomSheetListBehavior.setBottomSheetCallback(new BottomSheetBehavior | ||||
|                 .BottomSheetCallback() { | ||||
|             @Override | ||||
|             public void onStateChanged(@NonNull View bottomSheet, int newState) { | ||||
|                 if (newState == BottomSheetBehavior.STATE_EXPANDED){ | ||||
|                     bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             @Override | ||||
|             public void onSlide(@NonNull View bottomSheet, float slideOffset) { | ||||
| 
 | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     private void setupMapView(Bundle savedInstanceState) { | ||||
|  | @ -172,7 +187,10 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|                 if (marker instanceof NearbyMarker) { | ||||
|                     NearbyMarker nearbyMarker = (NearbyMarker) marker; | ||||
|                     Place place = nearbyMarker.getNearbyBaseMarker().getPlace(); | ||||
|                     NearbyInfoDialog.showYourself(getActivity(), place); | ||||
|                     passInfoToSheet(place); | ||||
|                     bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                     bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); | ||||
|                     //NearbyInfoDialog.showYourself(getActivity(), place); | ||||
|                 } | ||||
|                 return false; | ||||
|             }); | ||||
|  | @ -259,7 +277,11 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { | |||
|             fabPlus.hide(); | ||||
|             //moreInfo.setVisibility(View.GONE); | ||||
|         } | ||||
|         currBottomSheetState = bottomSheetState; | ||||
|         //currBottomSheetState = bottomSheetState; | ||||
|     } | ||||
| 
 | ||||
|     private void passInfoToSheet(Place place) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     private void animateFAB(boolean isFabOpen) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan