use of io.jawg.osmcontributor.ui.events.map.PleaseLoadLastUsedPoiType in project osm-contributor by jawg.
the class MapFragment method switchMode.
public void switchMode(MapMode mode) {
mapMode = mode;
Bitmap bitmap;
switchToolbarMode(mapMode);
editNodeRefPosition.setVisibility(View.GONE);
// progressBar.setVisibility(View.GONE);
final MapMode.MapModeProperties properties = mode.getProperties();
if (properties.isUnSelectIcon()) {
unselectMarker();
}
showFloatingButtonAddPoi(properties.isShowAddPoiFab());
displayPoiTypePicker();
displayPoiDetailBanner(properties.isShowPoiBanner());
displayNoteDetailBanner(properties.isShowNodeBanner());
switch(mode) {
case DETAIL_POI:
break;
case DETAIL_NOTE:
break;
case TYPE_PICKER:
eventBus.post(new PleaseLoadLastUsedPoiType());
break;
case POI_CREATION:
animationPoiCreation();
break;
case NOTE_CREATION:
noteSelected();
animationPoiCreation();
break;
case POI_POSITION_EDITION:
// This marker is being moved
bitmap = bitmapHandler.getMarkerBitmap(((Poi) markerSelected.getRelatedObject()).getType(), Poi.computeState(false, true, false));
creationPin.setImageBitmap(bitmap);
break;
case NODE_REF_POSITION_EDITION:
wayCreationPin.setImageBitmap(bitmapHandler.getNodeRefBitmap(PoiNodeRef.State.MOVING));
break;
case WAY_EDITION:
if (getZoomLevel() < zoomVectorial) {
changeMapZoomSmooth(configManager.getZoomVectorial());
}
loadAreaForEdition();
break;
default:
poiTypeSelected = null;
poiTypeEditText.setText("");
clearAllNodeRef();
switchToolbarMode(mapMode);
displayHomeButton(true);
unselectMarker();
break;
}
// the marker is displayed at the end of the animation
displayCreationPin(properties.isShowCreationPin());
wayCreationPin.setVisibility(properties.isShowCreationPin() ? View.VISIBLE : View.GONE);
if (addPoiFloatingMenu.isOpened()) {
addPoiFloatingMenu.toggle(true);
}
}
Aggregations