Style ,issues

This commit is contained in:
neslihanturan 2019-05-27 14:03:10 +03:00
parent ceab7f4c1b
commit f57d2cd264
2 changed files with 10 additions and 12 deletions

View file

@ -144,7 +144,6 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
} }
return false; return false;
}); });
//viewsAreReadyCallback.nearbyFragmentAndMapViewReady();
} }
@Override @Override
@ -155,8 +154,7 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
@Override @Override
public MapView setupMapView(Bundle savedInstanceState) { public MapView setupMapView(Bundle savedInstanceState) {
Log.d("deneme1","setupMapView"); Timber.d("setting up map view");
Timber.d("setupMapView called");
boolean isDarkTheme = applicationKvStore.getBoolean("theme", false); boolean isDarkTheme = applicationKvStore.getBoolean("theme", false);
MapboxMapOptions options = new MapboxMapOptions() MapboxMapOptions options = new MapboxMapOptions()
.compassGravity(Gravity.BOTTOM | Gravity.LEFT) .compassGravity(Gravity.BOTTOM | Gravity.LEFT)
@ -211,13 +209,13 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
bookmarkLocationDao.getAllBookmarksLocations()); bookmarkLocationDao.getAllBookmarksLocations());
mapboxMap.clear(); mapboxMap.clear();
// TODO: set search latlang here // TODO: set search latlang here
// TODO: arrange camera positions according to all other parameters
CameraPosition cameraPosition = new CameraPosition.Builder().target CameraPosition cameraPosition = new CameraPosition.Builder().target
(LocationUtils.commonsLatLngToMapBoxLatLng(curLatLng)).build(); (LocationUtils.commonsLatLngToMapBoxLatLng(curLatLng)).build();
mapboxMap.setCameraPosition(cameraPosition); mapboxMap.setCameraPosition(cameraPosition);
/*mapboxMap.animateCamera(CameraUpdateFactory /*mapboxMap.animateCamera(CameraUpdateFactory
.newCameraPosition(cameraPosition), 1000);*/ .newCameraPosition(cameraPosition), 1000);*/
// TODO: set position depening to botom sheet position heere // TODO: set position depening to botom sheet position heere
// We are trying to find nearby places around our custom searched area, thus custom parameter is nonnull
addNearbyMarkersToMapBoxMap(customBaseMarkerOptions); addNearbyMarkersToMapBoxMap(customBaseMarkerOptions);
// Re-enable mapbox gestures on custom location markers load // Re-enable mapbox gestures on custom location markers load
mapboxMap.getUiSettings().setAllGesturesEnabled(true); mapboxMap.getUiSettings().setAllGesturesEnabled(true);
@ -226,8 +224,9 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
@Override @Override
public void updateMapToTrackPosition(LatLng curLatLng) { public void updateMapToTrackPosition(LatLng curLatLng) {
Log.d("deneme1","updateMapToTrackPosition"); Timber.d("updates map cuyrrent location marker to track user location");
addCurrentLocationMarker(curLatLng); addCurrentLocationMarker(curLatLng);
// TODO change camera target here depending to several parameters
} }
@ -247,7 +246,6 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
*/ */
@Override @Override
public void addCurrentLocationMarker(LatLng curLatLng) { public void addCurrentLocationMarker(LatLng curLatLng) {
Log.d("deneme1","addCurrentLocationMarker");
Timber.d("addCurrentLocationMarker is called"); Timber.d("addCurrentLocationMarker is called");
Icon icon = IconFactory.getInstance(getContext()).fromResource(R.drawable.current_location_marker); Icon icon = IconFactory.getInstance(getContext()).fromResource(R.drawable.current_location_marker);
@ -256,8 +254,6 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
.position(new com.mapbox.mapboxsdk.geometry.LatLng(curLatLng.getLatitude(), curLatLng.getLongitude())); .position(new com.mapbox.mapboxsdk.geometry.LatLng(curLatLng.getLatitude(), curLatLng.getLongitude()));
currentLocationMarkerOptions.setIcon(icon); // Set custom icon currentLocationMarkerOptions.setIcon(icon); // Set custom icon
Marker currentLocationMarker = mapboxMap.addMarker(currentLocationMarkerOptions);
List<com.mapbox.mapboxsdk.geometry.LatLng> circle = createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(), List<com.mapbox.mapboxsdk.geometry.LatLng> circle = createCircleArray(curLatLng.getLatitude(), curLatLng.getLongitude(),
curLatLng.getAccuracy() * 2, 100); curLatLng.getAccuracy() * 2, 100);
@ -403,14 +399,13 @@ public class NearbyMapFragment extends CommonsDaggerSupportFragment implements N
} }
/** /**
* Means that views are set in presenter * Means that views are set in presenter to reference variables
* @param viewsAreReadyCallback * @param viewsAreReadyCallback
*/ */
@Override @Override
public void viewsAreSet(NearbyParentFragmentContract.ViewsAreReadyCallback viewsAreReadyCallback) { public void viewsAreSet(NearbyParentFragmentContract.ViewsAreReadyCallback viewsAreReadyCallback) {
Log.d("deneme1","viewsAreSet"); Timber.d("Views are set");
this.viewsAreReadyCallback = viewsAreReadyCallback; this.viewsAreReadyCallback = viewsAreReadyCallback;
this.viewsAreReadyCallback.nearbyFragmentAndMapViewReady(); this.viewsAreReadyCallback.nearbyFragmentAndMapViewReady();
} }

View file

@ -159,10 +159,13 @@ public class NearbyParentFragmentPresenter
|| locationChangeType.equals(MAP_UPDATED)) { || locationChangeType.equals(MAP_UPDATED)) {
nearbyParentFragmentView.populatePlaces(lastLocation, lastLocation); nearbyParentFragmentView.populatePlaces(lastLocation, lastLocation);
// TODO add a search location here // TODO add a search location here
// TODO dont forget map updated state after an wikidata item is updated
} else { } else { // Means location changed slightly, ie user is walking or driving.
nearbyMapFragmentView.updateMapToTrackPosition(curLatLng); nearbyMapFragmentView.updateMapToTrackPosition(curLatLng);
} }
// TODO: update camera angle accordingly here, 1- search this area mode, 2- following current location, 3- list sheet expanded, 4- landcaped
} }
/** /**