Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-11-30 22:25:10 +01:00
commit db2c5938d6
3 changed files with 9 additions and 7 deletions

View file

@ -133,14 +133,12 @@ public abstract class MenuController extends BaseMenuController {
}
public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
addMyLocationToPlainItems(pointDescription, latLon);
addMyLocationToPlainItems(latLon);
}
protected void addMyLocationToPlainItems(PointDescription pointDescription, LatLon latLon) {
if (pointDescription != null) {
addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationName(getMapActivity(),
latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""), false);
}
protected void addMyLocationToPlainItems(LatLon latLon) {
addPlainMenuItem(R.drawable.ic_action_get_my_location, PointDescription.getLocationName(getMapActivity(),
latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""), false);
}
public PointDescription getPointDescription() {

View file

@ -12,6 +12,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.data.Amenity;
import net.osmand.data.PointDescription;
import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes;
import net.osmand.osm.PoiType;
@ -281,6 +282,10 @@ public class AmenityMenuBuilder extends MenuBuilder {
for (AmenityInfoRow info : descriptions) {
buildAmenityRow(view, info);
}
buildRow(view, R.drawable.ic_action_get_my_location, PointDescription.getLocationName(app,
amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), true)
.replaceAll("\n", ""), 0, false, 0);
}
public void buildAmenityRow(View view, AmenityInfoRow info) {

View file

@ -99,6 +99,5 @@ public class AmenityMenuController extends MenuController {
}
addPlainMenuItem(resId, typeStr, false);
}
addMyLocationToPlainItems(pointDescription, amenity.getLocation());
}
}