Fix sherpafy
This commit is contained in:
parent
193abb9e11
commit
aba6c6ef3c
15 changed files with 180 additions and 97 deletions
|
@ -37,9 +37,5 @@
|
|||
<TextView android:text="15" android:gravity="right" android:layout_weight="0.5" android:id="@+id/MaxSpeedup"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<CheckBox android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/AnnounceGPXWpt"
|
||||
android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
|
||||
android:text="@string/announce_gpx_waypoints"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginRight="3dp">
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/ProgressBar"
|
||||
android:layout_marginLeft="4dp"/>
|
||||
|
||||
<TextView android:id="@+id/header_text"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:drawable/list_selector_background"
|
||||
android:id="@+id/package_delivered_layout">
|
||||
|
||||
<ImageView android:id="@+id/waypoint_icon"
|
||||
|
@ -28,8 +29,6 @@
|
|||
android:layout_marginLeft="4dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textSize="18sp"/>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<string name="way_alarms">Obstacles</string>
|
||||
<string name="speak_favorites">Announce Favorites</string>
|
||||
<string name="speak_poi">Announce POI</string>
|
||||
<string name="announce_gpx_waypoints">Announce GPX waypoints</string>
|
||||
<string name="download_additional_maps">Download missing maps %1$s (%2$d MB)?</string>
|
||||
<string name="more">More...</string>
|
||||
<string name="rendering_value_browse_map_name">Browse map</string>
|
||||
|
@ -407,7 +408,6 @@
|
|||
<string name="osmodroid_refresh">Refresh channels</string>
|
||||
<string name="osmodroid_seek">Seek object</string>
|
||||
<string name="osmodroid_unseek">Unseek object</string>
|
||||
<string name="announce_gpx_waypoints">Announce GPX waypoints</string>
|
||||
<string name="speak_title">Announce…</string>
|
||||
<string name="speak_descr">Configure to announce street names, traffic warnings (forced stops, speed bumps), speed camera warnings, speed limits</string>
|
||||
<string name="speak_street_names">Announce street names (TTS)</string>
|
||||
|
@ -1954,5 +1954,4 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
<string name="av_camera_pic_size_descr">Select internal camera Picture Size</string>
|
||||
<string name="navigation_intent_invalid">Invalid format: %s</string>
|
||||
<string name="hide_all_waypoints">Remove all</string>
|
||||
<string name="announce_nearby_favorites">Announce nearby favorites</string>
|
||||
</resources>
|
||||
|
|
|
@ -158,4 +158,8 @@ public class OsmAndAppCustomization {
|
|||
public List<? extends LocationPoint> getWaypoints() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public boolean isWaypointGroupVisible(int waypointType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,6 @@ public class OsmAndLocationSimulation {
|
|||
((TextView)view.findViewById(R.id.MinSpeedup)).setText("1"); //$NON-NLS-1$
|
||||
((TextView)view.findViewById(R.id.MaxSpeedup)).setText("4"); //$NON-NLS-1$
|
||||
final SeekBar speedup = (SeekBar) view.findViewById(R.id.Speedup);
|
||||
final CheckBox ch = (CheckBox ) view.findViewById(R.id.AnnounceGPXWpt);
|
||||
speedup.setMax(3);
|
||||
builder.setView(view);
|
||||
builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
|
||||
|
@ -86,9 +85,6 @@ public class OsmAndLocationSimulation {
|
|||
@Override
|
||||
public boolean processResult(GPXUtilities.GPXFile[] result) {
|
||||
GPXRouteParamsBuilder builder = new GPXRouteParamsBuilder(result[0], app.getSettings());
|
||||
if(ch.isChecked()){
|
||||
builder.setAnnounceWaypoints(true);
|
||||
}
|
||||
startAnimationThread(app.getRoutingHelper(), ma, builder.getPoints(), true,
|
||||
speedup.getProgress() + 1);
|
||||
return true;
|
||||
|
|
|
@ -817,12 +817,14 @@ public class OsmandSettings {
|
|||
public final OsmandPreference<Boolean> GPX_ROUTE_CALC_OSMAND_PARTS = new BooleanPreference("gpx_routing_calculate_osmand_route", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> GPX_CALCULATE_RTEPT = new BooleanPreference("gpx_routing_calculate_rtept", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> GPX_ROUTE_CALC = new BooleanPreference("calc_gpx_route", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> GPX_SPEAK_WPT = new BooleanPreference("speak_gpx_wpt", true).makeGlobal().cache();
|
||||
|
||||
|
||||
|
||||
public final OsmandPreference<Boolean> ANNOUNCE_WPT = new BooleanPreference("announce_wpt", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_FAVORITES = new BooleanPreference("announce_nearby_favorites", true).makeProfile().cache();
|
||||
public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_POI = new BooleanPreference("announce_nearby_poi", true).makeProfile().cache();
|
||||
public final OsmandPreference<Boolean> SHOW_NEARBY_POI = new BooleanPreference("show_nearby_poi", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SHOW_NEARBY_FAVORIES = new BooleanPreference("show_nearby_favorites", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> ANNOUNCE_NEARBY_POI = new BooleanPreference("announce_nearby_poi", false).makeProfile().cache();
|
||||
public final OsmandPreference<Boolean> SHOW_WPT = new BooleanPreference("show_gpx_wpt", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SHOW_NEARBY_POI = new BooleanPreference("show_nearby_poi", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SHOW_NEARBY_FAVORIES = new BooleanPreference("show_nearby_favorites", false).makeGlobal().cache();
|
||||
|
||||
public final OsmandPreference<Boolean> AVOID_TOLL_ROADS = new BooleanPreference("avoid_toll_roads", false).makeProfile().cache();
|
||||
public final OsmandPreference<Boolean> AVOID_MOTORWAY = new BooleanPreference("avoid_motorway", false).makeProfile().cache();
|
||||
|
|
|
@ -563,7 +563,6 @@ public class MapActivityActions implements DialogProvider {
|
|||
settings.GPX_CALCULATE_RTEPT.set(false);
|
||||
}
|
||||
params.setCalculateOsmAndRouteParts(settings.GPX_ROUTE_CALC_OSMAND_PARTS.get());
|
||||
params.setAnnounceWaypoints(settings.GPX_SPEAK_WPT.get());
|
||||
params.setUseIntermediatePointsRTE(settings.GPX_CALCULATE_RTEPT.get());
|
||||
params.setCalculateOsmAndRoute(settings.GPX_ROUTE_CALC.get());
|
||||
List<Location> ps = params.getPoints();
|
||||
|
|
|
@ -240,10 +240,11 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
|||
showBooleanSettings(new String[] { getString(R.string.speak_street_names), getString(R.string.speak_traffic_warnings), getString(R.string.speak_cameras),
|
||||
getString(R.string.speak_speed_limit),
|
||||
getString(R.string.speak_favorites),
|
||||
getString(R.string.speak_poi)},
|
||||
getString(R.string.speak_poi),
|
||||
getString(R.string.announce_gpx_waypoints)},
|
||||
new OsmandPreference[] { settings.SPEAK_STREET_NAMES, settings.SPEAK_TRAFFIC_WARNINGS,
|
||||
settings.SPEAK_SPEED_CAMERA , settings.SPEAK_SPEED_LIMIT,
|
||||
settings.ANNOUNCE_NEARBY_FAVORITES, settings.ANNOUNCE_NEARBY_POI});
|
||||
settings.ANNOUNCE_NEARBY_FAVORITES, settings.ANNOUNCE_NEARBY_POI, settings.ANNOUNCE_WPT});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -129,9 +129,6 @@ public class FailSafeFuntions {
|
|||
final GPXRouteParamsBuilder gpxRoute;
|
||||
if (result != null) {
|
||||
gpxRoute = new GPXRouteParamsBuilder(result, settings);
|
||||
if (settings.GPX_SPEAK_WPT.get()) {
|
||||
gpxRoute.setAnnounceWaypoints(true);
|
||||
}
|
||||
if (settings.GPX_ROUTE_CALC_OSMAND_PARTS.get()) {
|
||||
gpxRoute.setCalculateOsmAndRouteParts(true);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import android.content.DialogInterface.OnClickListener;
|
|||
import android.graphics.Color;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.SystemClock;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -34,7 +33,10 @@ import android.widget.CompoundButton;
|
|||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
|
@ -119,7 +121,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
WaypointHelper wh = app.getWaypointHelper();
|
||||
final LocationPoint point = ps.getPoint();
|
||||
TextView text = (TextView) localView.findViewById(R.id.waypoint_text);
|
||||
text.setOnClickListener(new View.OnClickListener() {
|
||||
localView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(ctx instanceof MapActivity) {
|
||||
|
@ -190,28 +192,43 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
}.execute(reachedView);
|
||||
}
|
||||
|
||||
private static void enableType(OsmandApplication app, MapActivity ctx, int type) {
|
||||
// TODO Auto-generated method stub
|
||||
private static void enableType(final OsmandApplication app, final MapActivity ctx,
|
||||
final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
||||
final boolean enable) {
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
|
||||
protected void onPreExecute() {
|
||||
};
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
app.getWaypointHelper().enableWaypointType(type, enable);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void onPostExecute(Void result) {
|
||||
running[0] = -1;
|
||||
listAdapter.clear();
|
||||
listAdapter.addAll(getPoints(app.getWaypointHelper()));
|
||||
listAdapter.notifyDataSetChanged();
|
||||
};
|
||||
}.execute((Void) null);
|
||||
}
|
||||
|
||||
public static void showWaypointsDialog(final OsmandApplication app,
|
||||
final MapActivity ctx) {
|
||||
final WaypointHelper waypointHelper = app.getWaypointHelper();
|
||||
final List<Object> points = new ArrayList<Object>();
|
||||
for (int i = 0; i < WaypointHelper.MAX; i++) {
|
||||
List<LocationPointWrapper> tp = waypointHelper.getWaypoints(i);
|
||||
points.add(new Integer(i));
|
||||
if (tp != null && tp.size() > 0) {
|
||||
points.addAll(tp);
|
||||
}
|
||||
}
|
||||
final List<Object> points = getPoints(waypointHelper);
|
||||
final List<LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
||||
final ListView listView = new ListView(ctx);
|
||||
final int[] running = new int[]{-1};
|
||||
final ArrayAdapter<Object> listAdapter = new ArrayAdapter<Object>(ctx,
|
||||
R.layout.waypoint_reached, R.id.title, points) {
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
// User super class to create the View
|
||||
View v = convertView;
|
||||
final ArrayAdapter<Object> thisAdapter = this;
|
||||
boolean labelView = (getItem(position) instanceof Integer);
|
||||
boolean viewText = v != null && v.findViewById(R.id.info_close) == null;
|
||||
if (v == null || viewText != labelView) {
|
||||
|
@ -219,15 +236,20 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
}
|
||||
if (labelView) {
|
||||
final int type = (Integer) getItem(position);
|
||||
CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item);
|
||||
btn.setVisibility(type == WaypointHelper.TARGETS ? View.GONE : View.VISIBLE);
|
||||
btn.setOnClickListener(new View.OnClickListener() {
|
||||
final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item);
|
||||
btn.setVisibility(waypointHelper.isTypeConfigurable(type) ? View.VISIBLE : View.GONE);
|
||||
btn.setOnCheckedChangeListener(null);
|
||||
btn.setChecked(waypointHelper.isTypeEnabled(type));
|
||||
btn.setEnabled(running[0] != -1);
|
||||
v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE);
|
||||
btn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
enableType(app, ctx, type);
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
running[0] = position;
|
||||
thisAdapter.notifyDataSetInvalidated();
|
||||
enableType(app, ctx, running, thisAdapter, type, isChecked);
|
||||
}
|
||||
|
||||
});
|
||||
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
||||
tv.setText(getHeader(ctx, waypointHelper, type));
|
||||
|
@ -250,13 +272,13 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
return v;
|
||||
}
|
||||
};
|
||||
ListView listView = new ListView(ctx);
|
||||
|
||||
listView.setAdapter(listAdapter);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
if(listAdapter.getItem(i) instanceof LocationPointWrapper) {
|
||||
LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(i);
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
||||
if(listAdapter.getItem(item) instanceof LocationPointWrapper) {
|
||||
LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(item);
|
||||
showOnMap(app, ctx, ps.getPoint());
|
||||
}
|
||||
}
|
||||
|
@ -282,6 +304,20 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
dialog = builder.show();
|
||||
}
|
||||
|
||||
protected static List<Object> getPoints(final WaypointHelper waypointHelper) {
|
||||
final List<Object> points = new ArrayList<Object>();
|
||||
for (int i = 0; i < WaypointHelper.MAX; i++) {
|
||||
List<LocationPointWrapper> tp = waypointHelper.getWaypoints(i);
|
||||
if(waypointHelper.isTypeConfigurable(i)) {
|
||||
points.add(new Integer(i));
|
||||
if (tp != null && tp.size() > 0) {
|
||||
points.addAll(tp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
protected static String getHeader(final MapActivity ctx, final WaypointHelper waypointHelper, int i) {
|
||||
String str = ctx.getString(R.string.waypoints);
|
||||
switch (i) {
|
||||
|
|
|
@ -191,6 +191,51 @@ public class WaypointHelper {
|
|||
return mostImportant;
|
||||
}
|
||||
|
||||
public void enableWaypointType(int type, boolean enable) {
|
||||
if(type == ALARMS) {
|
||||
app.getSettings().SPEAK_TRAFFIC_WARNINGS.set(enable);
|
||||
} else if(type == POI) {
|
||||
app.getSettings().SHOW_NEARBY_POI.set(enable);
|
||||
} else if(type == FAVORITES) {
|
||||
app.getSettings().SHOW_NEARBY_FAVORIES.set(enable);
|
||||
} else if(type == WAYPOINTS) {
|
||||
app.getSettings().SHOW_WPT.set(enable);
|
||||
}
|
||||
recalculatePoints(route, type, locationPoints);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean isTypeConfigurable(int waypointType) {
|
||||
return waypointType != TARGETS;
|
||||
}
|
||||
|
||||
public boolean isTypeVisible(int waypointType) {
|
||||
boolean vis = app.getAppCustomization().isWaypointGroupVisible(waypointType);
|
||||
if(!vis) {
|
||||
return false;
|
||||
}
|
||||
if(waypointType == ALARMS) {
|
||||
return route != null && !route.getAlarmInfo().isEmpty();
|
||||
} else if(waypointType == WAYPOINTS) {
|
||||
return route != null && !route.getLocationPoints().isEmpty();
|
||||
}
|
||||
return vis;
|
||||
}
|
||||
|
||||
public boolean isTypeEnabled(int type) {
|
||||
if(type == ALARMS) {
|
||||
return showAlarms();
|
||||
} else if(type == POI) {
|
||||
return showPOI();
|
||||
} else if(type == FAVORITES) {
|
||||
return showFavorites();
|
||||
} else if(type == WAYPOINTS) {
|
||||
return showGPXWaypoints();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public AlarmInfo calculateMostImportantAlarm(RouteDataObject ro, Location loc,
|
||||
MetricsConstants mc, boolean showCameras) {
|
||||
|
@ -359,28 +404,46 @@ public class WaypointHelper {
|
|||
|
||||
|
||||
public void setNewRoute(RouteCalculationResult route) {
|
||||
ArrayList<List<LocationPointWrapper>> locationPoints = new ArrayList<List<LocationPointWrapper>>();
|
||||
if (route != null && !route.isEmpty()) {
|
||||
if (showFavorites()) {
|
||||
findLocationPoints(route, FAVORITES, getArray(locationPoints, FAVORITES), app.getFavorites()
|
||||
.getFavouritePoints(), announceFavorites());
|
||||
}
|
||||
calculateAlarms(route, getArray(locationPoints, ALARMS));
|
||||
if (showGPXWaypoints()) {
|
||||
findLocationPoints(route, WAYPOINTS, getArray(locationPoints, WAYPOINTS), app.getAppCustomization()
|
||||
.getWaypoints(), announceGPXWaypoints());
|
||||
findLocationPoints(route, WAYPOINTS, getArray(locationPoints, WAYPOINTS), route.getLocationPoints(),
|
||||
announceGPXWaypoints());
|
||||
}
|
||||
if(showPOI()) {
|
||||
calculatePoi(route, locationPoints);
|
||||
}
|
||||
}
|
||||
for (List<LocationPointWrapper> list : locationPoints) {
|
||||
sortList(list);
|
||||
}
|
||||
List<List<LocationPointWrapper>> locationPoints = new ArrayList<List<LocationPointWrapper>>();
|
||||
recalculatePoints(route, -1, locationPoints);
|
||||
setLocationPoints(locationPoints, route);
|
||||
}
|
||||
|
||||
|
||||
protected void recalculatePoints(RouteCalculationResult route, int type, List<List<LocationPointWrapper>> locationPoints) {
|
||||
boolean all = type == -1;
|
||||
if (route != null && !route.isEmpty()) {
|
||||
if ((type == FAVORITES || all)) {
|
||||
final List<LocationPointWrapper> array = clearAndGetArray(locationPoints, FAVORITES);
|
||||
if (showFavorites()) {
|
||||
findLocationPoints(route, FAVORITES, array, app.getFavorites().getFavouritePoints(),
|
||||
announceFavorites());
|
||||
sortList(array);
|
||||
}
|
||||
}
|
||||
if((type == ALARMS || all)) {
|
||||
final List<LocationPointWrapper> array = clearAndGetArray(locationPoints, ALARMS);
|
||||
calculateAlarms(route, array);
|
||||
sortList(array);
|
||||
}
|
||||
if ((type == WAYPOINTS || all)) {
|
||||
final List<LocationPointWrapper> array = clearAndGetArray(locationPoints, WAYPOINTS);
|
||||
if (showGPXWaypoints()) {
|
||||
findLocationPoints(route, WAYPOINTS, array, app.getAppCustomization().getWaypoints(),
|
||||
announceGPXWaypoints());
|
||||
findLocationPoints(route, WAYPOINTS, array, route.getLocationPoints(), announceGPXWaypoints());
|
||||
sortList(array);
|
||||
}
|
||||
}
|
||||
if((type == POI || all)) {
|
||||
final List<LocationPointWrapper> array = clearAndGetArray(locationPoints, POI);
|
||||
if(showPOI()) {
|
||||
calculatePoi(route, array);
|
||||
sortList(array);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float dist(LocationPoint l, List<Location> locations, int[] ind) {
|
||||
float dist = Float.POSITIVE_INFINITY;
|
||||
|
@ -400,7 +463,7 @@ public class WaypointHelper {
|
|||
return dist;
|
||||
}
|
||||
|
||||
protected synchronized void setLocationPoints(ArrayList<List<LocationPointWrapper>> locationPoints, RouteCalculationResult route) {
|
||||
protected synchronized void setLocationPoints(List<List<LocationPointWrapper>> locationPoints, RouteCalculationResult route) {
|
||||
this.locationPoints = locationPoints;
|
||||
this.locationPointsStates.clear();
|
||||
TIntArrayList list = new TIntArrayList(locationPoints.size());
|
||||
|
@ -425,7 +488,7 @@ public class WaypointHelper {
|
|||
}
|
||||
|
||||
|
||||
protected void calculatePoi(RouteCalculationResult route, ArrayList<List<LocationPointWrapper>> locationPoints) {
|
||||
protected void calculatePoi(RouteCalculationResult route, List<LocationPointWrapper> locationPoints) {
|
||||
PoiFilter pf = getPoiFilter();
|
||||
if (pf != null) {
|
||||
final List<Location> locs = route.getImmutableAllLocations();
|
||||
|
@ -442,7 +505,6 @@ public class WaypointHelper {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
List<LocationPointWrapper> array = getArray(locationPoints, POI);
|
||||
for (Amenity a : amenities) {
|
||||
AmenityRoutePoint rp = a.getRoutePoint();
|
||||
int i = locs.indexOf(rp.pointA);
|
||||
|
@ -450,7 +512,7 @@ public class WaypointHelper {
|
|||
LocationPointWrapper lwp = new LocationPointWrapper(route, POI, new AmenityLocationPoint(a),
|
||||
(float) rp.deviateDistance, i);
|
||||
lwp.setAnnounce(announcePOI());
|
||||
array.add(lwp);
|
||||
locationPoints.add(lwp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -479,11 +541,12 @@ public class WaypointHelper {
|
|||
}
|
||||
|
||||
|
||||
private List<LocationPointWrapper> getArray(ArrayList<List<LocationPointWrapper>> array,
|
||||
private List<LocationPointWrapper> clearAndGetArray(List<List<LocationPointWrapper>> array,
|
||||
int ind) {
|
||||
while(array.size() <= ind) {
|
||||
array.add(new ArrayList<WaypointHelper.LocationPointWrapper>());
|
||||
}
|
||||
array.get(ind).clear();
|
||||
return array.get(ind);
|
||||
}
|
||||
|
||||
|
@ -516,11 +579,11 @@ public class WaypointHelper {
|
|||
}
|
||||
|
||||
public boolean showGPXWaypoints() {
|
||||
return app.getSettings().GPX_SPEAK_WPT.get();
|
||||
return app.getSettings().SHOW_WPT.get();
|
||||
}
|
||||
|
||||
public boolean announceGPXWaypoints() {
|
||||
return app.getSettings().GPX_SPEAK_WPT.get();
|
||||
return app.getSettings().ANNOUNCE_WPT.get();
|
||||
}
|
||||
|
||||
public boolean showFavorites() {
|
||||
|
@ -645,9 +708,6 @@ public class WaypointHelper {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,12 +22,9 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.binary.BinaryMapIndexReader;
|
||||
import net.osmand.data.DataTileManager;
|
||||
import net.osmand.data.FavouritePoint;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.LocationPoint;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
|
@ -119,7 +116,6 @@ public class RouteProvider {
|
|||
boolean calculateOsmAndRoute = false;
|
||||
// parameters
|
||||
private final GPXFile file;
|
||||
private boolean announceWaypoints;
|
||||
private boolean reverse;
|
||||
private boolean leftSide;
|
||||
private boolean passWholeRoute;
|
||||
|
@ -131,10 +127,6 @@ public class RouteProvider {
|
|||
this.file = file;
|
||||
}
|
||||
|
||||
public boolean isAnnounceWaypoints() {
|
||||
return announceWaypoints;
|
||||
}
|
||||
|
||||
public boolean isReverse() {
|
||||
return reverse;
|
||||
}
|
||||
|
@ -181,11 +173,6 @@ public class RouteProvider {
|
|||
}
|
||||
|
||||
|
||||
public void setAnnounceWaypoints(boolean announceWaypoints) {
|
||||
this.announceWaypoints = announceWaypoints;
|
||||
|
||||
}
|
||||
|
||||
public void setReverse(boolean reverse) {
|
||||
this.reverse = reverse;
|
||||
}
|
||||
|
@ -244,9 +231,8 @@ public class RouteProvider {
|
|||
passWholeRoute = builder.passWholeRoute;
|
||||
calculateOsmAndRouteParts = builder.calculateOsmAndRouteParts;
|
||||
useIntermediatePointsRTE = builder.useIntermediatePointsRTE;
|
||||
boolean announceWaypoints = builder.announceWaypoints;
|
||||
builder.calculateOsmAndRoute = false; // Disabled temporary builder.calculateOsmAndRoute;
|
||||
if(announceWaypoints && !file.points.isEmpty()) {
|
||||
if(!file.points.isEmpty()) {
|
||||
wpt = new ArrayList<LocationPoint>(file.points );
|
||||
}
|
||||
if(file.isCloudmadeRouteFile() || OSMAND_ROUTER.equals(file.author)){
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.osmand.plus.activities.MapActivityLayers;
|
|||
import net.osmand.plus.api.FileSettingsAPIImpl;
|
||||
import net.osmand.plus.api.SettingsAPI;
|
||||
import net.osmand.plus.download.DownloadActivityType;
|
||||
import net.osmand.plus.helpers.WaypointHelper;
|
||||
import net.osmand.plus.sherpafy.TourInformation.StageFavorite;
|
||||
import net.osmand.plus.sherpafy.TourInformation.StageInformation;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
@ -503,4 +504,10 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
|
|||
public void createLayers(OsmandMapTileView mapView, MapActivity activity) {
|
||||
mapView.addLayer(new StageFavoritesLayer(this), 4.1f);
|
||||
}
|
||||
|
||||
public boolean isWaypointGroupVisible(int waypointType) {
|
||||
return waypointType == WaypointHelper.WAYPOINTS ||
|
||||
waypointType == WaypointHelper.TARGETS ||
|
||||
waypointType == WaypointHelper.POI;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,9 +193,6 @@ public class MapRoutePreferencesControl extends MapControls {
|
|||
settings.GPX_ROUTE_CALC_OSMAND_PARTS.set(selected);
|
||||
} else if (gpxParam.id == R.string.gpx_option_from_start_point) {
|
||||
rp.setPassWholeRoute(selected);
|
||||
} else if (gpxParam.id == R.string.announce_gpx_waypoints) {
|
||||
settings.GPX_SPEAK_WPT.set(selected);
|
||||
rp.setAnnounceWaypoints(selected);
|
||||
} else if (gpxParam.id == R.string.use_points_as_intermediates) {
|
||||
settings.GPX_CALCULATE_RTEPT.set(selected);
|
||||
rp.setUseIntermediatePointsRTE(selected);
|
||||
|
@ -219,8 +216,6 @@ public class MapRoutePreferencesControl extends MapControls {
|
|||
|
||||
private List<LocalRoutingParameter> getRoutingParameters(ApplicationMode am) {
|
||||
List<LocalRoutingParameter> list = new ArrayList<LocalRoutingParameter>();
|
||||
list.add(new OtherLocalRoutingParameter(R.string.announce_nearby_favorites,
|
||||
mapActivity.getString(R.string.announce_nearby_favorites), settings.ANNOUNCE_NEARBY_FAVORITES.get()));
|
||||
GPXRouteParamsBuilder rparams = mapActivity.getRoutingHelper().getCurrentGPXRoute();
|
||||
boolean osmandRouter = settings.ROUTER_SERVICE.get() == RouteService.OSMAND ;
|
||||
if(!osmandRouter) {
|
||||
|
@ -244,8 +239,8 @@ public class MapRoutePreferencesControl extends MapControls {
|
|||
list.add(new OtherLocalRoutingParameter(R.string.gpx_option_calculate_first_last_segment,
|
||||
getString(R.string.gpx_option_calculate_first_last_segment), rparams.isCalculateOsmAndRouteParts()));
|
||||
}
|
||||
list.add(new OtherLocalRoutingParameter(R.string.announce_gpx_waypoints,
|
||||
getString(R.string.announce_gpx_waypoints), rparams.isAnnounceWaypoints()));
|
||||
// list.add(new OtherLocalRoutingParameter(R.string.announce_gpx_waypoints,
|
||||
// getString(R.string.announce_gpx_waypoints), rparams.isAnnounceWaypoints()));
|
||||
// Temporary disabled
|
||||
// list.add(new GPXLocalRoutingParameter(R.string.calculate_osmand_route_gpx,
|
||||
// getString(R.string.calculate_osmand_route_gpx), rparams.isCalculateOsmAndRoute()));
|
||||
|
|
Loading…
Reference in a new issue