Add map marker listener

This commit is contained in:
neslihanturan 2017-12-11 14:22:37 +03:00 committed by maskara
parent e2a7b4ffd8
commit de2b05fc0b

View file

@ -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) {