Small edit

This commit is contained in:
cepprice 2021-02-02 18:41:11 +05:00
parent ac11686646
commit 31d31f1023

View file

@ -89,6 +89,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
public static final int IMPORT_FAVOURITES_ID = 7; public static final int IMPORT_FAVOURITES_ID = 7;
public static final String GROUP_EXPANDED_POSTFIX = "_group_expanded"; public static final String GROUP_EXPANDED_POSTFIX = "_group_expanded";
private static final int MAX_POINTS_IN_DESCRIPTION = 100;
private FavouritesAdapter favouritesAdapter; private FavouritesAdapter favouritesAdapter;
private FavouritesDbHelper helper; private FavouritesDbHelper helper;
@ -611,23 +613,28 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
StringBuilder html = new StringBuilder(); StringBuilder html = new StringBuilder();
html.append("<h1>My Favorites</h1>"); html.append("<h1>My Favorites</h1>");
int MAX_AMOUNT_OF_POINTS = 100;
int addedPoints = 0; int addedPoints = 0;
for (FavoriteGroup group : groups) { for (FavoriteGroup group : groups) {
html.append("<h3>" + group.getDisplayName(app) + "</h3>"); html.append("<h3>").append(group.getDisplayName(app)).append("</h3>");
for (FavouritePoint fp : group.getPoints()) { for (FavouritePoint fp : group.getPoints()) {
if (addedPoints >= MAX_AMOUNT_OF_POINTS) { if (addedPoints >= MAX_POINTS_IN_DESCRIPTION) {
break; break;
} }
float lat = (float) fp.getLatitude(); float lat = (float) fp.getLatitude();
float lon = (float) fp.getLongitude(); float lon = (float) fp.getLongitude();
String url = "geo:" + lat + "," + lon + "?m=" + fp.getName(); String url = "geo:" + lat + "," + lon + "?m=" + fp.getName();
html.append("<p>" + fp.getDisplayName(app) + " - <a href=\"" + url + "\">geo:" html.append("<p>")
+ lat + "," + lon + "</a><br></p>"); .append(fp.getDisplayName(app))
.append(" - <a href=\"")
.append(url)
.append("\">geo:")
.append(lat).append(",").append(lon)
.append("</a><br></p>");
addedPoints++; addedPoints++;
} }
if (addedPoints >= MAX_AMOUNT_OF_POINTS) {
if (addedPoints >= MAX_POINTS_IN_DESCRIPTION) {
html.append("<p>...</p>"); html.append("<p>...</p>");
break; break;
} }