mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Added filter to Open Street Maps
This commit is contained in:
parent
09b064e9c1
commit
0da94ace19
3 changed files with 89 additions and 85 deletions
|
|
@ -40,7 +40,6 @@ public interface NearbyParentFragmentContract {
|
||||||
void setTabItemContributions();
|
void setTabItemContributions();
|
||||||
boolean isDetailsBottomSheetVisible();
|
boolean isDetailsBottomSheetVisible();
|
||||||
void setBottomSheetDetailsSmaller();
|
void setBottomSheetDetailsSmaller();
|
||||||
boolean isSearchThisAreaButtonVisible();
|
|
||||||
void setRecyclerViewAdapterAllSelected();
|
void setRecyclerViewAdapterAllSelected();
|
||||||
void setRecyclerViewAdapterItemsGreyedOut();
|
void setRecyclerViewAdapterItemsGreyedOut();
|
||||||
void setCheckBoxAction();
|
void setCheckBoxAction();
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import android.view.MenuItem;
|
||||||
import android.view.MenuItem.OnMenuItemClickListener;
|
import android.view.MenuItem.OnMenuItemClickListener;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
|
|
@ -132,6 +133,7 @@ import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.osmdroid.events.MapEventsReceiver;
|
||||||
import org.osmdroid.events.MapListener;
|
import org.osmdroid.events.MapListener;
|
||||||
import org.osmdroid.events.ScrollEvent;
|
import org.osmdroid.events.ScrollEvent;
|
||||||
import org.osmdroid.events.ZoomEvent;
|
import org.osmdroid.events.ZoomEvent;
|
||||||
|
|
@ -143,6 +145,7 @@ import org.osmdroid.util.constants.GeoConstants;
|
||||||
import org.osmdroid.views.CustomZoomButtonsController;
|
import org.osmdroid.views.CustomZoomButtonsController;
|
||||||
import org.osmdroid.views.overlay.ItemizedIconOverlay.OnItemGestureListener;
|
import org.osmdroid.views.overlay.ItemizedIconOverlay.OnItemGestureListener;
|
||||||
import org.osmdroid.views.overlay.ItemizedOverlayWithFocus;
|
import org.osmdroid.views.overlay.ItemizedOverlayWithFocus;
|
||||||
|
import org.osmdroid.views.overlay.MapEventsOverlay;
|
||||||
import org.osmdroid.views.overlay.Overlay;
|
import org.osmdroid.views.overlay.Overlay;
|
||||||
import org.osmdroid.views.overlay.OverlayItem;
|
import org.osmdroid.views.overlay.OverlayItem;
|
||||||
import org.osmdroid.views.overlay.ScaleBarOverlay;
|
import org.osmdroid.views.overlay.ScaleBarOverlay;
|
||||||
|
|
@ -385,18 +388,12 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
compassArrow.setRotation(0);
|
compassArrow.setRotation(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
//cameraMoveListener= () -> presenter.onCameraMove(mapBox.getCameraPosition().target);
|
|
||||||
//TODO
|
|
||||||
addCheckBoxCallback();
|
|
||||||
presenter.attachView(this);
|
presenter.attachView(this);
|
||||||
isPermissionDenied = false;
|
isPermissionDenied = false;
|
||||||
recenterToUserLocation = false;
|
recenterToUserLocation = false;
|
||||||
|
|
||||||
//initRvNearbyList();
|
|
||||||
initThemePreferences();
|
initThemePreferences();
|
||||||
initViews();
|
initViews();
|
||||||
presenter.setActionListeners(applicationKvStore);
|
presenter.setActionListeners(applicationKvStore);
|
||||||
initNearbyFilter();
|
|
||||||
|
|
||||||
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),PreferenceManager.getDefaultSharedPreferences(this.getContext()));
|
org.osmdroid.config.Configuration.getInstance().load(this.getContext(),PreferenceManager.getDefaultSharedPreferences(this.getContext()));
|
||||||
mMapView.setTilesScaledToDpi(true);
|
mMapView.setTilesScaledToDpi(true);
|
||||||
|
|
@ -431,12 +428,23 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
TilesOverlay tilesOverlay = new TilesOverlay(tileProvider, this.getContext());
|
TilesOverlay tilesOverlay = new TilesOverlay(tileProvider, this.getContext());
|
||||||
tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
|
tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
|
||||||
mMapView.getOverlays().add(tilesOverlay);
|
mMapView.getOverlays().add(tilesOverlay);
|
||||||
|
mMapView.getOverlays().add(new MapEventsOverlay(new MapEventsReceiver() {
|
||||||
|
@Override
|
||||||
|
public boolean singleTapConfirmedHelper(GeoPoint p) {
|
||||||
|
if(isListBottomSheetExpanded()) {
|
||||||
|
// Back should first hide the bottom sheet if it is expanded
|
||||||
|
hideBottomSheet();
|
||||||
|
} else if (isDetailsBottomSheetVisible()) {
|
||||||
|
hideBottomDetailsSheet();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
RotationGestureOverlay rotationGestureOverlay = new RotationGestureOverlay(mMapView,compassArrow,compassBg);
|
@Override
|
||||||
rotationGestureOverlay.setEnabled(true);
|
public boolean longPressHelper(GeoPoint p) {
|
||||||
mMapView.setMultiTouchControls(true);
|
return false;
|
||||||
mMapView.getOverlays().add(rotationGestureOverlay);
|
}
|
||||||
setSearchThisAreaButtonVisibility(false);
|
}));
|
||||||
mMapView.addMapListener(new MapListener() {
|
mMapView.addMapListener(new MapListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onScroll(ScrollEvent event) {
|
public boolean onScroll(ScrollEvent event) {
|
||||||
|
|
@ -449,7 +457,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
mylocation.setLongitude(lastMapFocus.getLongitude());
|
mylocation.setLongitude(lastMapFocus.getLongitude());
|
||||||
Float distance = mylocation.distanceTo(dest_location);//in meters
|
Float distance = mylocation.distanceTo(dest_location);//in meters
|
||||||
if (lastMapFocus != null) {
|
if (lastMapFocus != null) {
|
||||||
if (isNetworkConnectionEstablished()) {
|
if (isNetworkConnectionEstablished() && (event.getX() > 0 || event.getY() > 0)) {
|
||||||
if (distance > 2000.0) {
|
if (distance > 2000.0) {
|
||||||
setSearchThisAreaButtonVisibility(true);
|
setSearchThisAreaButtonVisibility(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -463,7 +471,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onZoom(ZoomEvent event) {
|
public boolean onZoom(ZoomEvent event) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -471,53 +478,21 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
RotationGestureOverlay rotationGestureOverlay = new RotationGestureOverlay(mMapView,compassArrow,compassBg);
|
||||||
|
rotationGestureOverlay.setEnabled(true);
|
||||||
|
mMapView.setMultiTouchControls(true);
|
||||||
|
mMapView.getOverlays().add(rotationGestureOverlay);
|
||||||
|
|
||||||
if(nearbyParentFragmentInstanceReadyCallback!=null){
|
if(nearbyParentFragmentInstanceReadyCallback!=null){
|
||||||
nearbyParentFragmentInstanceReadyCallback.onReady();
|
nearbyParentFragmentInstanceReadyCallback.onReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initNearbyFilter();
|
||||||
|
addCheckBoxCallback();
|
||||||
performMapReadyActions();
|
performMapReadyActions();
|
||||||
moveCameraToPosition(lastMapFocus);
|
moveCameraToPosition(lastMapFocus);
|
||||||
setSearchThisAreaButtonVisibility(false);
|
|
||||||
initRvNearbyList();
|
initRvNearbyList();
|
||||||
//TODO Remove MapBox Code
|
onResume();
|
||||||
// mapView.onCreate(savedInstanceState);
|
|
||||||
// mapView.getMapAsync(mapBoxMap -> {
|
|
||||||
// mapBox =mapBoxMap;
|
|
||||||
// initViews();
|
|
||||||
// presenter.setActionListeners(applicationKvStore);
|
|
||||||
// initNearbyFilter();
|
|
||||||
// mapBoxMap.setStyle(isDarkTheme? MapStyle.DARK :
|
|
||||||
// MapStyle.OUTDOORS, style -> {
|
|
||||||
// final UiSettings uiSettings = mapBoxMap.getUiSettings();
|
|
||||||
// uiSettings.setCompassGravity(Gravity.BOTTOM | Gravity.LEFT);
|
|
||||||
// uiSettings.setCompassMargins(12, 0, 0, 24);
|
|
||||||
// uiSettings.setLogoEnabled(false);
|
|
||||||
// uiSettings.setAttributionEnabled(false);
|
|
||||||
// uiSettings.setRotateGesturesEnabled(false);
|
|
||||||
// isMapBoxReady =true;
|
|
||||||
// if(nearbyParentFragmentInstanceReadyCallback!=null){
|
|
||||||
// nearbyParentFragmentInstanceReadyCallback.onReady();
|
|
||||||
// }
|
|
||||||
// performMapReadyActions();
|
|
||||||
// final CameraPosition cameraPosition;
|
|
||||||
// if(applicationKvStore.getString("LastLocation")!=null) { // Checking for last searched location
|
|
||||||
// String[] locationLatLng = applicationKvStore.getString("LastLocation").split(",");
|
|
||||||
// cameraPosition = new CameraPosition.Builder()
|
|
||||||
// .target(new LatLng(Double.valueOf(locationLatLng[0]),
|
|
||||||
// Double.valueOf(locationLatLng[1])))
|
|
||||||
// .zoom(ZOOM_LEVEL)
|
|
||||||
// .build();
|
|
||||||
// }else {
|
|
||||||
// cameraPosition = new CameraPosition.Builder()
|
|
||||||
// .target(new LatLng(51.50550, -0.07520))
|
|
||||||
// .zoom(ZOOM_OUT)
|
|
||||||
// .build();
|
|
||||||
// }
|
|
||||||
// mapBoxMap.setCameraPosition(cameraPosition);
|
|
||||||
// onResume();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
tvAttribution.setText(Html.fromHtml(getString(R.string.map_attribution)));
|
tvAttribution.setText(Html.fromHtml(getString(R.string.map_attribution)));
|
||||||
tvAttribution.setMovementMethod(LinkMovementMethod.getInstance());
|
tvAttribution.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
@ -580,6 +555,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
rvNearbyList.setLayoutManager(new LinearLayoutManager(getContext()));
|
rvNearbyList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
adapter = new PlaceAdapter(bookmarkLocationDao,
|
adapter = new PlaceAdapter(bookmarkLocationDao,
|
||||||
place -> {
|
place -> {
|
||||||
|
recenterMap(place.getLocation());
|
||||||
centerMapToPlace(place);
|
centerMapToPlace(place);
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
},
|
},
|
||||||
|
|
@ -710,7 +686,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mapView.onPause();
|
|
||||||
mMapView.onPause();
|
mMapView.onPause();
|
||||||
compositeDisposable.clear();
|
compositeDisposable.clear();
|
||||||
presenter.detachView();
|
presenter.detachView();
|
||||||
|
|
@ -724,9 +699,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
locationManager.removeLocationListener(presenter);
|
locationManager.removeLocationListener(presenter);
|
||||||
locationManager.unregisterLocationManager();
|
locationManager.unregisterLocationManager();
|
||||||
}
|
}
|
||||||
if (null != mapBox) {
|
|
||||||
mapBox.removeOnCameraMoveListener(cameraMoveListener);
|
|
||||||
}
|
|
||||||
}catch (final Exception e){
|
}catch (final Exception e){
|
||||||
Timber.e(e);
|
Timber.e(e);
|
||||||
//Broadcast receivers should always be unregistered inside catch, you never know if they were already registered or not
|
//Broadcast receivers should always be unregistered inside catch, you never know if they were already registered or not
|
||||||
|
|
@ -810,16 +782,16 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
|
|
||||||
public void initNearbyFilter() {
|
public void initNearbyFilter() {
|
||||||
nearbyFilterList.setVisibility(View.GONE);
|
nearbyFilterList.setVisibility(View.GONE);
|
||||||
|
hideBottomSheet();
|
||||||
searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {
|
searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {
|
||||||
|
LayoutUtils.setLayoutHeightAllignedToWidth(1.25, nearbyFilterList);
|
||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
presenter.searchViewGainedFocus();
|
|
||||||
nearbyFilterList.setVisibility(View.VISIBLE);
|
nearbyFilterList.setVisibility(View.VISIBLE);
|
||||||
|
presenter.searchViewGainedFocus();
|
||||||
} else {
|
} else {
|
||||||
nearbyFilterList.setVisibility(View.GONE);
|
nearbyFilterList.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
recyclerView.setHasFixedSize(true);
|
recyclerView.setHasFixedSize(true);
|
||||||
recyclerView.addItemDecoration(new DividerItemDecoration(getContext(),
|
recyclerView.addItemDecoration(new DividerItemDecoration(getContext(),
|
||||||
DividerItemDecoration.VERTICAL));
|
DividerItemDecoration.VERTICAL));
|
||||||
|
|
@ -848,7 +820,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
nearbyFilterList.getLayoutParams().width = (int) LayoutUtils.getScreenWidth(getActivity(), 0.75);
|
nearbyFilterList.getLayoutParams().width = (int) LayoutUtils.getScreenWidth(getActivity(), 0.75);
|
||||||
recyclerView.setAdapter(nearbyFilterSearchRecyclerViewAdapter);
|
recyclerView.setAdapter(nearbyFilterSearchRecyclerViewAdapter);
|
||||||
LayoutUtils.setLayoutHeightAllignedToWidth(1.25, nearbyFilterList);
|
LayoutUtils.setLayoutHeightAllignedToWidth(1.25, nearbyFilterList);
|
||||||
|
|
||||||
compositeDisposable.add(RxSearchView.queryTextChanges(searchView)
|
compositeDisposable.add(RxSearchView.queryTextChanges(searchView)
|
||||||
.takeUntil(RxView.detaches(searchView))
|
.takeUntil(RxView.detaches(searchView))
|
||||||
.debounce(500, TimeUnit.MILLISECONDS)
|
.debounce(500, TimeUnit.MILLISECONDS)
|
||||||
|
|
@ -1327,7 +1298,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
private void updateMapMarkers(final NearbyController.NearbyPlacesInfo nearbyPlacesInfo, final boolean shouldUpdateSelectedMarker) {
|
private void updateMapMarkers(final NearbyController.NearbyPlacesInfo nearbyPlacesInfo, final boolean shouldUpdateSelectedMarker) {
|
||||||
presenter.updateMapMarkers(nearbyPlacesInfo, selectedMarker,shouldUpdateSelectedMarker);
|
presenter.updateMapMarkers(nearbyPlacesInfo, selectedMarker,shouldUpdateSelectedMarker);
|
||||||
//TODO
|
//TODO
|
||||||
//setFilterState();
|
setFilterState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1364,11 +1335,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSearchThisAreaButtonVisible() {
|
|
||||||
return searchThisAreaButton.getVisibility() == View.VISIBLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRecyclerViewAdapterAllSelected() {
|
public void setRecyclerViewAdapterAllSelected() {
|
||||||
if (nearbyFilterSearchRecyclerViewAdapter != null && NearbyController.currentLocation != null) {
|
if (nearbyFilterSearchRecyclerViewAdapter != null && NearbyController.currentLocation != null) {
|
||||||
|
|
@ -1652,13 +1618,8 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
final boolean displayWlm,
|
final boolean displayWlm,
|
||||||
final boolean filterForPlaceState,
|
final boolean filterForPlaceState,
|
||||||
final boolean filterForAllNoneType) {
|
final boolean filterForAllNoneType) {
|
||||||
|
|
||||||
// Remove the previous markers before updating them
|
// Remove the previous markers before updating them
|
||||||
hideAllMarkers();
|
clearAllMarkers();
|
||||||
//TODO
|
|
||||||
// clearAllMarkers();
|
|
||||||
|
|
||||||
filteredMarkers = new ArrayList<>();
|
|
||||||
|
|
||||||
for (final MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
|
for (final MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
|
||||||
final Place place = markerPlaceGroup.getPlace();
|
final Place place = markerPlaceGroup.getPlace();
|
||||||
|
|
@ -1704,11 +1665,15 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
updateMarker(markerPlaceGroup.getIsBookmarked(), place, NearbyController.currentLocation);
|
updateMarker(markerPlaceGroup.getIsBookmarked(), place, NearbyController.currentLocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO
|
if (selectedLabels == null || selectedLabels.size() == 0 ) {
|
||||||
// mapBox.clear();
|
ArrayList<NearbyBaseMarker> markerArrayList = new ArrayList<>();
|
||||||
// mapBox.addMarkers(filteredMarkers);
|
for (final MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
|
||||||
// addNearbyMarkersToMapBoxMap(filteredMarkers,null);
|
NearbyBaseMarker nearbyBaseMarker = new NearbyBaseMarker();
|
||||||
addMarkersToMap(filteredMarkers,null);
|
nearbyBaseMarker.place(markerPlaceGroup.getPlace());
|
||||||
|
markerArrayList.add(nearbyBaseMarker);
|
||||||
|
}
|
||||||
|
addMarkersToMap(markerArrayList, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -1786,9 +1751,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
* @param nearbyBaseMarkers The list of Place objects containing information about the locations.
|
* @param nearbyBaseMarkers The list of Place objects containing information about the locations.
|
||||||
*/
|
*/
|
||||||
private void addMarkersToMap(List<NearbyBaseMarker> nearbyBaseMarkers,final Marker selectedMarker){
|
private void addMarkersToMap(List<NearbyBaseMarker> nearbyBaseMarkers,final Marker selectedMarker){
|
||||||
//TODO Work on bookmarks
|
|
||||||
//clearAllMarkers();
|
|
||||||
|
|
||||||
ArrayList<OverlayItem> items = new ArrayList<>();
|
ArrayList<OverlayItem> items = new ArrayList<>();
|
||||||
for (int i = 0;i<nearbyBaseMarkers.size();i++){
|
for (int i = 0;i<nearbyBaseMarkers.size();i++){
|
||||||
Drawable icon = ContextCompat.getDrawable(getContext(),getIconFor(nearbyBaseMarkers.get(i).getPlace(),false));
|
Drawable icon = ContextCompat.getDrawable(getContext(),getIconFor(nearbyBaseMarkers.get(i).getPlace(),false));
|
||||||
|
|
@ -1858,6 +1820,26 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
}
|
}
|
||||||
addCurrentLocationMarker(curLatLng);
|
addCurrentLocationMarker(curLatLng);
|
||||||
mMapView.getController().animateTo(new GeoPoint(curLatLng.getLatitude(),curLatLng.getLongitude()));
|
mMapView.getController().animateTo(new GeoPoint(curLatLng.getLatitude(),curLatLng.getLongitude()));
|
||||||
|
if (lastMapFocus != null ) {
|
||||||
|
Location mylocation = new Location("");
|
||||||
|
Location dest_location = new Location("");
|
||||||
|
dest_location.setLatitude(mMapView.getMapCenter().getLatitude());
|
||||||
|
dest_location.setLongitude(mMapView.getMapCenter().getLongitude());
|
||||||
|
mylocation.setLatitude(lastMapFocus.getLatitude());
|
||||||
|
mylocation.setLongitude(lastMapFocus.getLongitude());
|
||||||
|
Float distance = mylocation.distanceTo(dest_location);//in meters
|
||||||
|
if (lastMapFocus != null) {
|
||||||
|
if (isNetworkConnectionEstablished()) {
|
||||||
|
if (distance > 2000.0) {
|
||||||
|
setSearchThisAreaButtonVisibility(true);
|
||||||
|
} else {
|
||||||
|
setSearchThisAreaButtonVisibility(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setSearchThisAreaButtonVisibility(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -2117,6 +2099,28 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
scaleBarOverlay.setBackgroundPaint(barPaint);
|
scaleBarOverlay.setBackgroundPaint(barPaint);
|
||||||
scaleBarOverlay.enableScaleBar();
|
scaleBarOverlay.enableScaleBar();
|
||||||
mMapView.getOverlays().add(scaleBarOverlay);
|
mMapView.getOverlays().add(scaleBarOverlay);
|
||||||
|
mMapView.getOverlays().add(new MapEventsOverlay(new MapEventsReceiver() {
|
||||||
|
@Override
|
||||||
|
public boolean singleTapConfirmedHelper(GeoPoint p) {
|
||||||
|
if(isListBottomSheetExpanded()) {
|
||||||
|
// Back should first hide the bottom sheet if it is expanded
|
||||||
|
hideBottomSheet();
|
||||||
|
} else if (isDetailsBottomSheetVisible()) {
|
||||||
|
hideBottomDetailsSheet();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean longPressHelper(GeoPoint p) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
RotationGestureOverlay rotationGestureOverlay = new RotationGestureOverlay(mMapView,compassArrow,compassBg);
|
||||||
|
rotationGestureOverlay.setEnabled(true);
|
||||||
|
mMapView.setMultiTouchControls(true);
|
||||||
|
mMapView.getOverlays().add(rotationGestureOverlay);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ public class NearbyParentFragmentPresenter
|
||||||
(LocationUtils.commonsLatLngToMapBoxLatLng(NearbyController.latestSearchLocation));
|
(LocationUtils.commonsLatLngToMapBoxLatLng(NearbyController.latestSearchLocation));
|
||||||
if (nearbyParentFragmentView.isNetworkConnectionEstablished()) {
|
if (nearbyParentFragmentView.isNetworkConnectionEstablished()) {
|
||||||
if (distance > NearbyController.latestSearchRadius) {
|
if (distance > NearbyController.latestSearchRadius) {
|
||||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(true);
|
//nearbyParentFragmentView.setSearchThisAreaButtonVisibility(true);
|
||||||
} else {
|
} else {
|
||||||
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
nearbyParentFragmentView.setSearchThisAreaButtonVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
@ -314,6 +314,7 @@ public class NearbyParentFragmentPresenter
|
||||||
// Do nothing
|
// Do nothing
|
||||||
break;
|
break;
|
||||||
case UNCHECKED:
|
case UNCHECKED:
|
||||||
|
//TODO
|
||||||
nearbyParentFragmentView.filterOutAllMarkers();
|
nearbyParentFragmentView.filterOutAllMarkers();
|
||||||
nearbyParentFragmentView.setRecyclerViewAdapterItemsGreyedOut();
|
nearbyParentFragmentView.setRecyclerViewAdapterItemsGreyedOut();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue