Add address extension to gpx
This commit is contained in:
parent
19419d7d55
commit
c823231d7e
3 changed files with 8 additions and 7 deletions
|
@ -17,6 +17,7 @@ public class FavouritePoint implements Serializable, LocationPoint {
|
|||
private static final long serialVersionUID = 729654300829771466L;
|
||||
|
||||
private static final String HIDDEN = "hidden";
|
||||
private static final String ADDRESS_EXTENSION = "address";
|
||||
|
||||
|
||||
|
||||
|
@ -294,6 +295,7 @@ public class FavouritePoint implements Serializable, LocationPoint {
|
|||
}
|
||||
fp.setColor(pt.getColor(0));
|
||||
fp.setVisible(!pt.getExtensionsToRead().containsKey(HIDDEN));
|
||||
fp.setAddress(pt.getExtensionsToRead().get(ADDRESS_EXTENSION));
|
||||
return fp;
|
||||
}
|
||||
|
||||
|
@ -304,6 +306,9 @@ public class FavouritePoint implements Serializable, LocationPoint {
|
|||
if (!isVisible()) {
|
||||
pt.getExtensionsToWrite().put(HIDDEN, "true");
|
||||
}
|
||||
if (isAddressSpecified()) {
|
||||
pt.getExtensionsToWrite().put(ADDRESS_EXTENSION, getAddress());
|
||||
}
|
||||
if (getColor() != 0) {
|
||||
pt.setColor(getColor());
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ import net.osmand.plus.FavouritesDbHelper.FavoritesListener;
|
|||
import net.osmand.plus.MapMarkersHelper;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||
|
@ -53,7 +52,6 @@ import net.osmand.plus.helpers.AndroidUiHelper;
|
|||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||
import net.osmand.plus.myplaces.FavoritesFragmentStateHolder;
|
||||
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
|
@ -953,9 +951,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
|
|||
name.setTextColor(getResources().getColor(visible ? enabledColor : disabledColor));
|
||||
distanceText.setText(distance);
|
||||
if (model.isAddressSpecified()) {
|
||||
String distanceWithAddress = String.format(getString(R.string.distance_and_address), distance.trim(),
|
||||
model.getDescription() != null ? model.getDescription() : "");
|
||||
distanceText.setText(distanceWithAddress);
|
||||
distanceText.setText(String.format(getString(R.string.distance_and_address), distance.trim(), model.getAddress()));
|
||||
}
|
||||
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(),
|
||||
visible ? model.getColor() : getResources().getColor(disabledIconColor), false, model));
|
||||
|
|
|
@ -32,8 +32,8 @@ public class HomeWorkCard extends BaseCard {
|
|||
|
||||
TextView homeDescr = view.findViewById(R.id.home_button_descr);
|
||||
final TextView workDescr = view.findViewById(R.id.work_button_descr);
|
||||
homeDescr.setText(homePoint != null ? homePoint.getDescription() : mapActivity.getString(R.string.shared_string_add));
|
||||
workDescr.setText(workPoint != null ? workPoint.getDescription() : mapActivity.getString(R.string.shared_string_add));
|
||||
homeDescr.setText(homePoint != null ? homePoint.getAddress() : mapActivity.getString(R.string.shared_string_add));
|
||||
workDescr.setText(workPoint != null ? workPoint.getAddress() : mapActivity.getString(R.string.shared_string_add));
|
||||
|
||||
View homeButton = view.findViewById(R.id.home_button);
|
||||
homeButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
Loading…
Reference in a new issue