Merge pull request #7095 from osmandapp/7051_expand_coordnates

crash fixes
This commit is contained in:
vshcherb 2019-06-25 16:38:48 +02:00 committed by GitHub
commit 35cfcee9b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -203,8 +203,12 @@ public class PointDescription {
results.put(PointDescription.formatToHumanString(ctx, f),
ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, 0, 0));
}
int zoom = 17;
if (ctx.getMapView() != null) {
zoom = ctx.getMapView().getZoom();
}
final String httpUrl = "https://osmand.net/go?lat=" + (lat)
+ "&lon=" + (lon) + "&z=" + ctx.getMapView().getZoom();
+ "&lon=" + (lon) + "&z=" + zoom;
results.put("URL", httpUrl);
return results;
}

View file

@ -637,6 +637,10 @@ public class MenuBuilder {
collapsableView.getContenView().setVisibility(View.GONE);
iconViewCollapse.setImageDrawable(getCollapseIcon(true));
}
if (collapsableView.getContenView().getParent() != null) {
((ViewGroup) collapsableView.getContenView().getParent())
.removeView(collapsableView.getContenView());
}
baseView.addView(collapsableView.getContenView());
}