mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
Merge branch 'upgrade' of https://github.com/rohit9625/apps-android-commons into upgrade
This commit is contained in:
commit
c2c6dc26e3
2 changed files with 4 additions and 46 deletions
|
|
@ -108,7 +108,7 @@ dependencies {
|
||||||
testImplementation 'androidx.test.ext:junit:1.1.5'
|
testImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
testImplementation "androidx.test:rules:1.5.0"
|
testImplementation "androidx.test:rules:1.5.0"
|
||||||
testImplementation "com.squareup.okhttp3:mockwebserver:$OKHTTP_VERSION"
|
testImplementation "com.squareup.okhttp3:mockwebserver:$OKHTTP_VERSION"
|
||||||
testImplementation "com.jraska.livedata:testing-ktx:1.1.2"
|
testImplementation "com.jraska.livedata:testing-ktx:1.2.0"
|
||||||
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
testImplementation "androidx.arch.core:core-testing:2.2.0"
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.0"
|
testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.0"
|
||||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.0"
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.0"
|
||||||
|
|
|
||||||
|
|
@ -1992,51 +1992,9 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
* locations.
|
* locations.
|
||||||
*/
|
*/
|
||||||
private void addMarkersToMap(List<BaseMarker> nearbyBaseMarkers) {
|
private void addMarkersToMap(List<BaseMarker> nearbyBaseMarkers) {
|
||||||
for (int i = 0; i < nearbyBaseMarkers.size(); i++) {
|
|
||||||
Drawable icon = ContextCompat.getDrawable(getContext(),
|
for(int i = 0; i< nearbyBaseMarkers.size(); i++){
|
||||||
getIconFor(nearbyBaseMarkers.get(i).getPlace(), false));
|
addMarkerToMap(nearbyBaseMarkers.get(i).getPlace(), false);
|
||||||
GeoPoint point = new GeoPoint(
|
|
||||||
nearbyBaseMarkers.get(i).getPlace().location.getLatitude(),
|
|
||||||
nearbyBaseMarkers.get(i).getPlace().location.getLongitude());
|
|
||||||
Marker marker = new Marker(binding.map);
|
|
||||||
marker.setPosition(point);
|
|
||||||
marker.setIcon(icon);
|
|
||||||
Place place = nearbyBaseMarkers.get(i).getPlace();
|
|
||||||
if (!Objects.equals(place.name, "")) {
|
|
||||||
marker.setTitle(place.name);
|
|
||||||
marker.setSnippet(
|
|
||||||
containsParentheses(place.getLongDescription())
|
|
||||||
? getTextBetweenParentheses(
|
|
||||||
place.getLongDescription()) : place.getLongDescription());
|
|
||||||
}
|
|
||||||
marker.setTextLabelFontSize(40);
|
|
||||||
marker.setId(String.valueOf(i));
|
|
||||||
marker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_TOP);
|
|
||||||
marker.setOnMarkerClickListener((marker1, mapView) -> {
|
|
||||||
marker1.showInfoWindow();
|
|
||||||
if (clickedMarker != null) {
|
|
||||||
clickedMarker.closeInfoWindow();
|
|
||||||
}
|
|
||||||
clickedMarker = marker1;
|
|
||||||
int index = Integer.parseInt(marker1.getId());
|
|
||||||
Place updatedPlace = nearbyBaseMarkers.get(index).getPlace();
|
|
||||||
binding.bottomSheetDetails.dataCircularProgress.setVisibility(View.VISIBLE);
|
|
||||||
binding.bottomSheetDetails.icon.setVisibility(View.GONE);
|
|
||||||
binding.bottomSheetDetails.wikiDataLl.setVisibility(View.GONE);
|
|
||||||
if (Objects.equals(updatedPlace.name, "")) {
|
|
||||||
getPlaceData(updatedPlace.getWikiDataEntityId(), updatedPlace, marker1, false);
|
|
||||||
} else {
|
|
||||||
marker.showInfoWindow();
|
|
||||||
binding.bottomSheetDetails.dataCircularProgress.setVisibility(View.GONE);
|
|
||||||
binding.bottomSheetDetails.icon.setVisibility(View.VISIBLE);
|
|
||||||
binding.bottomSheetDetails.wikiDataLl.setVisibility(View.VISIBLE);
|
|
||||||
passInfoToSheet(place);
|
|
||||||
hideBottomSheet();
|
|
||||||
}
|
|
||||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
binding.map.getOverlays().add(marker);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue