Merge branch 'r3.0' of ssh://github.com/osmandapp/Osmand into FixPoiEdits
This commit is contained in:
commit
62a895a4a5
22 changed files with 181 additions and 94 deletions
|
@ -237,6 +237,7 @@ public class RouteDataObject {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getName(String lang){
|
public String getName(String lang){
|
||||||
return getName(lang, false);
|
return getName(lang, false);
|
||||||
}
|
}
|
||||||
|
@ -685,6 +686,18 @@ public class RouteDataObject {
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRoadDeleted() {
|
||||||
|
int[] pt = getTypes();
|
||||||
|
int sz = pt.length;
|
||||||
|
for (int i = 0; i < sz; i++) {
|
||||||
|
RouteTypeRule r = region.quickGetEncodingRule(pt[i]);
|
||||||
|
if ("osmand_change".equals(r.getTag()) && "delete".equals(r.getValue())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isStopApplicable(boolean direction, int intId, int startPointInd, int endPointInd) {
|
public boolean isStopApplicable(boolean direction, int intId, int startPointInd, int endPointInd) {
|
||||||
int[] pt = getPointTypes(intId);
|
int[] pt = getPointTypes(intId);
|
||||||
int sz = pt.length;
|
int sz = pt.length;
|
||||||
|
|
|
@ -743,9 +743,9 @@ public class RouteResultPreparation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(straightActiveLen == target.activeLen) {
|
if(straightActiveBegin != -1 && straightActiveLen <= target.activeLen) {
|
||||||
active.activeStartIndex = straightActiveBegin;
|
active.activeStartIndex = straightActiveBegin;
|
||||||
active.activeEndIndex = straightActiveBegin + target.activeLen - 1;
|
active.activeEndIndex = straightActiveBegin + straightActiveLen - 1;
|
||||||
changed = true;
|
changed = true;
|
||||||
} else {
|
} else {
|
||||||
// cause the next-turn goes forward exclude left most and right most lane
|
// cause the next-turn goes forward exclude left most and right most lane
|
||||||
|
|
|
@ -71,6 +71,9 @@ public class RouteSegmentResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attachRoute(int roadIndex, RouteSegmentResult r){
|
public void attachRoute(int roadIndex, RouteSegmentResult r){
|
||||||
|
if(r.getObject().isRoadDeleted()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
int st = Math.abs(roadIndex - startPointIndex);
|
int st = Math.abs(roadIndex - startPointIndex);
|
||||||
if(attachedRoutes[st] == null) {
|
if(attachedRoutes[st] == null) {
|
||||||
attachedRoutes[st] = new ArrayList<RouteSegmentResult>();
|
attachedRoutes[st] = new ArrayList<RouteSegmentResult>();
|
||||||
|
|
|
@ -416,9 +416,11 @@ public class TurnType {
|
||||||
public static int convertType(String lane) {
|
public static int convertType(String lane) {
|
||||||
int turn;
|
int turn;
|
||||||
// merge should be recognized as continue route (but it could displayed differently)
|
// merge should be recognized as continue route (but it could displayed differently)
|
||||||
if (lane.equals("none") || lane.equals("through")
|
if(lane.equals("merge_to_left")) {
|
||||||
|| lane.equals("merge_to_left")
|
turn = TurnType.C;
|
||||||
|| lane.equals("merge_to_right")) {
|
} else if(lane.equals("merge_to_right")) {
|
||||||
|
turn = TurnType.C;
|
||||||
|
} else if (lane.equals("none") || lane.equals("through")) {
|
||||||
turn = TurnType.C;
|
turn = TurnType.C;
|
||||||
} else if (lane.equals("slight_right")) {
|
} else if (lane.equals("slight_right")) {
|
||||||
turn = TurnType.TSLR;
|
turn = TurnType.TSLR;
|
||||||
|
|
|
@ -595,8 +595,8 @@
|
||||||
},
|
},
|
||||||
"expectedResults": {
|
"expectedResults": {
|
||||||
"222244": "TL|TL|+C,TR",
|
"222244": "TL|TL|+C,TR",
|
||||||
"222243": "TL|TL|+C|C|TSLR",
|
"222243": "TL|TL|+C|+C|TSLR",
|
||||||
"222164": "TL|TL|+C|C"
|
"222164": "TL|TL|+C|+C"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.util.Log;
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
@ -67,7 +67,6 @@ import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import btools.routingapp.BRouterServiceConnection;
|
import btools.routingapp.BRouterServiceConnection;
|
||||||
|
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
||||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
|
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
|
||||||
|
@ -178,6 +177,8 @@ public class AppInitializer implements IProgress {
|
||||||
startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
|
startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
|
||||||
appVersionChanged = true;
|
appVersionChanged = true;
|
||||||
}
|
}
|
||||||
|
app.getSettings().SHOW_TRAVEL_UPDATE_CARD.set(true);
|
||||||
|
app.getSettings().SHOW_TRAVEL_NEEDED_MAPS_CARD.set(true);
|
||||||
initSettings = true;
|
initSettings = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +353,8 @@ public class AppInitializer implements IProgress {
|
||||||
Integer in = (Integer) f.get(null);
|
Integer in = (Integer) f.get(null);
|
||||||
return app.getString(in);
|
return app.getString(in);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
|
LOG.info("No translation: " + keyName);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1231,7 +1231,9 @@ public class GPXUtilities {
|
||||||
public static String writeGpxFile(File fout, GPXFile file, OsmandApplication ctx) {
|
public static String writeGpxFile(File fout, GPXFile file, OsmandApplication ctx) {
|
||||||
Writer output = null;
|
Writer output = null;
|
||||||
try {
|
try {
|
||||||
|
if(fout.getParentFile() != null) {
|
||||||
fout.getParentFile().mkdirs();
|
fout.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$
|
output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$
|
||||||
String msg = writeGpx(output, file, ctx);
|
String msg = writeGpx(output, file, ctx);
|
||||||
if(Algorithms.isEmpty(file.path)) {
|
if(Algorithms.isEmpty(file.path)) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import net.osmand.GeoidAltitudeCorrection;
|
import net.osmand.GeoidAltitudeCorrection;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
@ -70,12 +71,12 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
private static final int GPS_DIST_REQUEST = 0;
|
private static final int GPS_DIST_REQUEST = 0;
|
||||||
private static final int NOT_SWITCH_TO_NETWORK_WHEN_GPS_LOST_MS = 12000;
|
private static final int NOT_SWITCH_TO_NETWORK_WHEN_GPS_LOST_MS = 12000;
|
||||||
|
|
||||||
private static final long STALE_LOCATION_TIMEOUT = 1000 * 60 * 5; // 5 minutes
|
private static final long LOCATION_TIMEOUT_TO_BE_STALE = 1000 * 60 * 2; // 2 minutes
|
||||||
private static final long STALE_LOCATION_TIMEOUT_FOR_UI = 1000 * 60 * 15; // 15 minutes
|
private static final long STALE_LOCATION_TIMEOUT_TO_BE_GONE = 1000 * 60 * 20; // 20 minutes
|
||||||
|
|
||||||
private static final int REQUESTS_BEFORE_CHECK_LOCATION = 100;
|
private static final int REQUESTS_BEFORE_CHECK_LOCATION = 100;
|
||||||
private int locationRequestsCounter;
|
private AtomicInteger locationRequestsCounter = new AtomicInteger();
|
||||||
private int staleLocationRequestsCounter;
|
private AtomicInteger staleLocationRequestsCounter = new AtomicInteger();
|
||||||
|
|
||||||
private net.osmand.Location cachedLocation;
|
private net.osmand.Location cachedLocation;
|
||||||
|
|
||||||
|
@ -690,7 +691,8 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
|
|
||||||
private void scheduleCheckIfGpsLost(final net.osmand.Location location) {
|
private void scheduleCheckIfGpsLost(final net.osmand.Location location) {
|
||||||
final RoutingHelper routingHelper = app.getRoutingHelper();
|
final RoutingHelper routingHelper = app.getRoutingHelper();
|
||||||
if (location != null) {
|
if (location != null && routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0
|
||||||
|
&& simulatePosition == null) {
|
||||||
final long fixTime = location.getTime();
|
final long fixTime = location.getTime();
|
||||||
app.runMessageInUIThreadAndCancelPrevious(LOST_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(LOST_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
|
||||||
|
@ -702,13 +704,13 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gpsSignalLost = true;
|
gpsSignalLost = true;
|
||||||
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0) {
|
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0
|
||||||
|
&& simulatePosition == null) {
|
||||||
routingHelper.getVoiceRouter().gpsLocationLost();
|
routingHelper.getVoiceRouter().gpsLocationLost();
|
||||||
}
|
|
||||||
setLocation(null);
|
setLocation(null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, LOST_LOCATION_CHECK_DELAY);
|
}, LOST_LOCATION_CHECK_DELAY);
|
||||||
if (routingHelper.isFollowingMode() && routingHelper.getLeftDistance() > 0 && simulatePosition == null) {
|
|
||||||
app.runMessageInUIThreadAndCancelPrevious(START_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(START_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -728,7 +730,6 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
}, START_LOCATION_SIMULATION_DELAY);
|
}, START_LOCATION_SIMULATION_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void simulatePosition() {
|
public void simulatePosition() {
|
||||||
app.runMessageInUIThreadAndCancelPrevious(RUN_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
app.runMessageInUIThreadAndCancelPrevious(RUN_SIMULATE_LOCATION_MSG_ID, new Runnable() {
|
||||||
|
@ -869,15 +870,14 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public net.osmand.Location getLastKnownLocation() {
|
public net.osmand.Location getLastKnownLocation() {
|
||||||
net.osmand.Location location = this.location;
|
net.osmand.Location loc = this.location;
|
||||||
if (location != null && locationRequestsCounter == 0
|
if (loc != null) {
|
||||||
&& System.currentTimeMillis() - location.getTime() > STALE_LOCATION_TIMEOUT) {
|
int counter = locationRequestsCounter.incrementAndGet();
|
||||||
|
if (counter >= REQUESTS_BEFORE_CHECK_LOCATION && locationRequestsCounter.compareAndSet(counter, 0)) {
|
||||||
|
if (System.currentTimeMillis() - loc.getTime() > LOCATION_TIMEOUT_TO_BE_STALE) {
|
||||||
location = null;
|
location = null;
|
||||||
}
|
}
|
||||||
if (locationRequestsCounter == REQUESTS_BEFORE_CHECK_LOCATION) {
|
}
|
||||||
locationRequestsCounter = 0;
|
|
||||||
} else {
|
|
||||||
locationRequestsCounter++;
|
|
||||||
}
|
}
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
@ -885,19 +885,17 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
@Nullable
|
@Nullable
|
||||||
public net.osmand.Location getLastStaleKnownLocation() {
|
public net.osmand.Location getLastStaleKnownLocation() {
|
||||||
net.osmand.Location newLoc = getLastKnownLocation();
|
net.osmand.Location newLoc = getLastKnownLocation();
|
||||||
if (newLoc == null) {
|
if (newLoc == null && cachedLocation != null) {
|
||||||
if (staleLocationRequestsCounter == 0 && cachedLocation != null
|
int counter = staleLocationRequestsCounter.incrementAndGet();
|
||||||
&& System.currentTimeMillis() - cachedLocation.getTime() > STALE_LOCATION_TIMEOUT_FOR_UI) {
|
if (counter >= REQUESTS_BEFORE_CHECK_LOCATION && staleLocationRequestsCounter.compareAndSet(counter, 0)) {
|
||||||
|
net.osmand.Location cached = cachedLocation;
|
||||||
|
if (cached != null && System.currentTimeMillis() - cached.getTime() > STALE_LOCATION_TIMEOUT_TO_BE_GONE) {
|
||||||
cachedLocation = null;
|
cachedLocation = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cachedLocation = newLoc;
|
cachedLocation = newLoc;
|
||||||
}
|
}
|
||||||
if (staleLocationRequestsCounter == REQUESTS_BEFORE_CHECK_LOCATION) {
|
|
||||||
staleLocationRequestsCounter = 0;
|
|
||||||
} else {
|
|
||||||
staleLocationRequestsCounter++;
|
|
||||||
}
|
|
||||||
return cachedLocation;
|
return cachedLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3006,6 +3006,9 @@ public class OsmandSettings {
|
||||||
|
|
||||||
public final OsmandPreference<String> SELECTED_TRAVEL_BOOK = new StringPreference("selected_travel_book", "").makeGlobal();
|
public final OsmandPreference<String> SELECTED_TRAVEL_BOOK = new StringPreference("selected_travel_book", "").makeGlobal();
|
||||||
|
|
||||||
|
public final OsmandPreference<Boolean> SHOW_TRAVEL_UPDATE_CARD = new BooleanPreference("show_travel_update_card", true).makeGlobal();
|
||||||
|
public final OsmandPreference<Boolean> SHOW_TRAVEL_NEEDED_MAPS_CARD = new BooleanPreference("show_travel_needed_maps_card", true).makeGlobal();
|
||||||
|
|
||||||
public final ListStringPreference TRANSPORT_DEFAULT_SETTINGS =
|
public final ListStringPreference TRANSPORT_DEFAULT_SETTINGS =
|
||||||
(ListStringPreference) new ListStringPreference("transport_default_settings", "transportStops", ",").makeProfile();
|
(ListStringPreference) new ListStringPreference("transport_default_settings", "transportStops", ",").makeProfile();
|
||||||
|
|
||||||
|
|
|
@ -440,6 +440,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
||||||
if (pbExtView.getVisibility() == View.VISIBLE) {
|
if (pbExtView.getVisibility() == View.VISIBLE) {
|
||||||
pbExtView.setVisibility(View.GONE);
|
pbExtView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
if (MapRouteInfoMenu.isVisible()) {
|
||||||
|
pb.setVisibility(View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (pb.getVisibility() == View.GONE) {
|
if (pb.getVisibility() == View.GONE) {
|
||||||
pb.setVisibility(View.VISIBLE);
|
pb.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,7 @@ public class OsmandActionBarActivity extends OsmandInAppPurchaseActivity {
|
||||||
|
|
||||||
//should be called after set content view
|
//should be called after set content view
|
||||||
protected void setupHomeButton(){
|
protected void setupHomeButton(){
|
||||||
Drawable back = ((OsmandApplication)getApplication()).getIconsCache().getIcon(R.drawable.ic_arrow_back);
|
Drawable back = ((OsmandApplication)getApplication()).getIconsCache().getIcon(R.drawable.ic_arrow_back, R.color.color_white);
|
||||||
back.setColorFilter(ContextCompat.getColor(this, R.color.color_white), PorterDuff.Mode.MULTIPLY);
|
|
||||||
final ActionBar supportActionBar = getSupportActionBar();
|
final ActionBar supportActionBar = getSupportActionBar();
|
||||||
if (supportActionBar != null) {
|
if (supportActionBar != null) {
|
||||||
supportActionBar.setHomeButtonEnabled(true);
|
supportActionBar.setHomeButtonEnabled(true);
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
package net.osmand.plus.api;
|
package net.osmand.plus.api;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
|
|
||||||
public class SQLiteAPIImpl implements SQLiteAPI {
|
public class SQLiteAPIImpl implements SQLiteAPI {
|
||||||
|
|
||||||
private OsmandApplication app;
|
private OsmandApplication app;
|
||||||
|
private static final Log LOG = PlatformUtil.getLog(SQLiteAPIImpl.class);
|
||||||
|
|
||||||
public SQLiteAPIImpl(OsmandApplication app) {
|
public SQLiteAPIImpl(OsmandApplication app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
|
@ -18,9 +22,13 @@ public class SQLiteAPIImpl implements SQLiteAPI {
|
||||||
@SuppressLint("InlinedApi")
|
@SuppressLint("InlinedApi")
|
||||||
@Override
|
@Override
|
||||||
public SQLiteConnection getOrCreateDatabase(String name, boolean readOnly) {
|
public SQLiteConnection getOrCreateDatabase(String name, boolean readOnly) {
|
||||||
android.database.sqlite.SQLiteDatabase db = app.openOrCreateDatabase(name,
|
android.database.sqlite.SQLiteDatabase db = null;
|
||||||
Context.MODE_PRIVATE |
|
try {
|
||||||
(readOnly ? 0 : Context.MODE_ENABLE_WRITE_AHEAD_LOGGING), null);
|
db = app.openOrCreateDatabase(name, Context.MODE_PRIVATE
|
||||||
|
| (readOnly ? 0 : Context.MODE_ENABLE_WRITE_AHEAD_LOGGING), null);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
LOG.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
if(db == null) {
|
if(db == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||||
import android.support.v7.view.ContextThemeWrapper;
|
import android.support.v7.view.ContextThemeWrapper;
|
||||||
import android.text.ClipboardManager;
|
import android.text.ClipboardManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
@ -752,7 +753,10 @@ public class MenuBuilder {
|
||||||
public Drawable getRowIcon(Context ctx, String fileName) {
|
public Drawable getRowIcon(Context ctx, String fileName) {
|
||||||
Drawable d = RenderingIcons.getBigIcon(ctx, fileName);
|
Drawable d = RenderingIcons.getBigIcon(ctx, fileName);
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
d.setColorFilter(app.getResources().getColor(light ? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark), PorterDuff.Mode.SRC_IN);
|
d = DrawableCompat.wrap(d);
|
||||||
|
d.mutate();
|
||||||
|
d.setColorFilter(app.getResources().getColor(light
|
||||||
|
? R.color.ctx_menu_bottom_view_icon_light : R.color.ctx_menu_bottom_view_icon_dark), PorterDuff.Mode.SRC_IN);
|
||||||
return d;
|
return d;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import net.osmand.data.Amenity;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
import net.osmand.osm.AbstractPoiType;
|
import net.osmand.osm.AbstractPoiType;
|
||||||
import net.osmand.osm.MapPoiTypes;
|
import net.osmand.osm.MapPoiTypes;
|
||||||
|
import net.osmand.osm.PoiCategory;
|
||||||
import net.osmand.osm.PoiType;
|
import net.osmand.osm.PoiType;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandPlugin;
|
import net.osmand.plus.OsmandPlugin;
|
||||||
|
@ -49,6 +50,7 @@ import java.util.Calendar;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -344,6 +346,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
|
|
||||||
Map<String, List<PoiType>> poiAdditionalCategories = new HashMap<>();
|
Map<String, List<PoiType>> poiAdditionalCategories = new HashMap<>();
|
||||||
AmenityInfoRow cuisineRow = null;
|
AmenityInfoRow cuisineRow = null;
|
||||||
|
List<PoiType> collectedPoiTypes = new ArrayList<>();
|
||||||
|
|
||||||
for (Map.Entry<String, String> e : amenity.getAdditionalInfo().entrySet()) {
|
for (Map.Entry<String, String> e : amenity.getAdditionalInfo().entrySet()) {
|
||||||
int iconId = 0;
|
int iconId = 0;
|
||||||
|
@ -362,14 +365,15 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
boolean isWiki = false;
|
boolean isWiki = false;
|
||||||
boolean isText = false;
|
boolean isText = false;
|
||||||
boolean isDescription = false;
|
boolean isDescription = false;
|
||||||
boolean needLinks = !("population".equals(key)
|
boolean needLinks = !("population".equals(key) || "height".equals(key));
|
||||||
|| "height".equals(key));
|
|
||||||
boolean isPhoneNumber = false;
|
boolean isPhoneNumber = false;
|
||||||
boolean isUrl = false;
|
boolean isUrl = false;
|
||||||
boolean isCuisine = false;
|
boolean isCuisine = false;
|
||||||
int poiTypeOrder = 0;
|
int poiTypeOrder = 0;
|
||||||
String poiTypeKeyName = "";
|
String poiTypeKeyName = "";
|
||||||
|
|
||||||
|
PoiType poiType = amenity.getType().getPoiTypeByKeyName(key);
|
||||||
|
|
||||||
AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(key);
|
AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(key);
|
||||||
if (pt == null && !Algorithms.isEmpty(vl) && vl.length() < 50) {
|
if (pt == null && !Algorithms.isEmpty(vl) && vl.length() < 50) {
|
||||||
pt = poiTypes.getAnyPoiAdditionalTypeByKey(key + "_" + vl);
|
pt = poiTypes.getAnyPoiAdditionalTypeByKey(key + "_" + vl);
|
||||||
|
@ -501,6 +505,8 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
if (icon == null && isText && iconId == 0) {
|
if (icon == null && isText && iconId == 0) {
|
||||||
iconId = R.drawable.ic_action_note_dark;
|
iconId = R.drawable.ic_action_note_dark;
|
||||||
}
|
}
|
||||||
|
} else if (poiType != null) {
|
||||||
|
collectedPoiTypes.add(poiType);
|
||||||
} else {
|
} else {
|
||||||
textPrefix = Algorithms.capitalizeFirstLetterAndLowercase(e.getKey());
|
textPrefix = Algorithms.capitalizeFirstLetterAndLowercase(e.getKey());
|
||||||
vl = amenity.unzipContent(e.getValue());
|
vl = amenity.unzipContent(e.getValue());
|
||||||
|
@ -524,12 +530,10 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
}
|
}
|
||||||
if (isDescription) {
|
if (isDescription) {
|
||||||
descriptions.add(row);
|
descriptions.add(row);
|
||||||
} else {
|
} else if (isCuisine) {
|
||||||
if (!isCuisine) {
|
|
||||||
infoRows.add(row);
|
|
||||||
} else {
|
|
||||||
cuisineRow = row;
|
cuisineRow = row;
|
||||||
}
|
} else if (poiType == null) {
|
||||||
|
infoRows.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,12 +572,27 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
sb.append(pt.getTranslation());
|
sb.append(pt.getTranslation());
|
||||||
}
|
}
|
||||||
boolean cuisineOrDish = categoryName.equals(Amenity.CUISINE) || categoryName.equals(Amenity.DISH);
|
boolean cuisineOrDish = categoryName.equals(Amenity.CUISINE) || categoryName.equals(Amenity.DISH);
|
||||||
CollapsableView collapsableView = getPoiAdditionalCollapsableView(view.getContext(), true, categoryTypes, cuisineOrDish ? cuisineRow : null);
|
CollapsableView collapsableView = getPoiTypeCollapsableView(view.getContext(), true, categoryTypes, true, cuisineOrDish ? cuisineRow : null);
|
||||||
infoRows.add(new AmenityInfoRow(poiAdditionalCategoryName, icon, pType.getPoiAdditionalCategoryTranslation(), sb.toString(), true, collapsableView,
|
infoRows.add(new AmenityInfoRow(poiAdditionalCategoryName, icon, pType.getPoiAdditionalCategoryTranslation(), sb.toString(), true, collapsableView,
|
||||||
0, false, false, false, pType.getOrder(), pType.getKeyName(), false, false, false, 1));
|
0, false, false, false, pType.getOrder(), pType.getKeyName(), false, false, false, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (collectedPoiTypes.size() > 0) {
|
||||||
|
CollapsableView collapsableView = getPoiTypeCollapsableView(view.getContext(), true, collectedPoiTypes, false, null);
|
||||||
|
PoiCategory poiCategory = amenity.getType();
|
||||||
|
Drawable icon = getRowIcon(view.getContext(), poiCategory.getIconKeyName());
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (PoiType pt : collectedPoiTypes) {
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
sb.append(" • ");
|
||||||
|
}
|
||||||
|
sb.append(pt.getTranslation());
|
||||||
|
}
|
||||||
|
infoRows.add(new AmenityInfoRow(poiCategory.getKeyName(), icon, poiCategory.getTranslation(), sb.toString(), true, collapsableView,
|
||||||
|
0, false, false, false, 40, poiCategory.getKeyName(), false, false, false, 1));
|
||||||
|
}
|
||||||
|
|
||||||
Collections.sort(infoRows, new Comparator<AmenityInfoRow>() {
|
Collections.sort(infoRows, new Comparator<AmenityInfoRow>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(AmenityInfoRow row1, AmenityInfoRow row2) {
|
public int compare(AmenityInfoRow row1, AmenityInfoRow row2) {
|
||||||
|
@ -664,9 +683,9 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CollapsableView getPoiAdditionalCollapsableView(
|
private CollapsableView getPoiTypeCollapsableView(final Context context, boolean collapsed,
|
||||||
final Context context, boolean collapsed,
|
@NonNull final List<PoiType> categoryTypes,
|
||||||
@NonNull final List<PoiType> categoryTypes, AmenityInfoRow textCuisineRow) {
|
final boolean poiAdditional, AmenityInfoRow textRow) {
|
||||||
|
|
||||||
final List<TextViewEx> buttons = new ArrayList<>();
|
final List<TextViewEx> buttons = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -684,9 +703,15 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
PoiUIFilter filter = app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + amenity.getType().getKeyName());
|
PoiUIFilter filter = app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + amenity.getType().getKeyName());
|
||||||
if (filter != null) {
|
if (filter != null) {
|
||||||
filter.clearFilter();
|
filter.clearFilter();
|
||||||
|
if (poiAdditional) {
|
||||||
filter.setTypeToAccept(amenity.getType(), true);
|
filter.setTypeToAccept(amenity.getType(), true);
|
||||||
filter.updateTypesToAccept(pt);
|
filter.updateTypesToAccept(pt);
|
||||||
filter.setFilterByName(pt.getKeyName().replace('_', ':').toLowerCase());
|
filter.setFilterByName(pt.getKeyName().replace('_', ':').toLowerCase());
|
||||||
|
} else {
|
||||||
|
LinkedHashSet<String> accept = new LinkedHashSet<>();
|
||||||
|
accept.add(pt.getKeyName());
|
||||||
|
filter.selectSubTypesToAccept(amenity.getType(), accept);
|
||||||
|
}
|
||||||
getMapActivity().showQuickSearch(filter);
|
getMapActivity().showQuickSearch(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -699,9 +724,9 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
view.addView(button);
|
view.addView(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textCuisineRow != null) {
|
if (textRow != null) {
|
||||||
TextViewEx button = buildButtonInCollapsableView(context, true, false, false);
|
TextViewEx button = buildButtonInCollapsableView(context, true, false, false);
|
||||||
String name = textCuisineRow.textPrefix + ": " + textCuisineRow.text.toLowerCase();
|
String name = textRow.textPrefix + ": " + textRow.text.toLowerCase();
|
||||||
button.setText(name);
|
button.setText(name);
|
||||||
view.addView(button);
|
view.addView(button);
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,6 +183,9 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
|
||||||
} else {
|
} else {
|
||||||
helper.editFavouriteName(favorite, name, category, description);
|
helper.editFavouriteName(favorite, name, category, description);
|
||||||
}
|
}
|
||||||
|
if(getMapActivity() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
getMapActivity().refreshMap();
|
getMapActivity().refreshMap();
|
||||||
if (needDismiss) {
|
if (needDismiss) {
|
||||||
dismiss(false);
|
dismiss(false);
|
||||||
|
|
|
@ -109,8 +109,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
|
||||||
|
|
||||||
private void setUpToolbar(View view) {
|
private void setUpToolbar(View view) {
|
||||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.custom_toolbar);
|
Toolbar toolbar = (Toolbar) view.findViewById(R.id.custom_toolbar);
|
||||||
Drawable back = getMyApplication().getIconsCache().getIcon(R.drawable.ic_arrow_back);
|
Drawable back = getMyApplication().getIconsCache().getIcon(R.drawable.ic_arrow_back, R.color.color_white);
|
||||||
back.setColorFilter(ContextCompat.getColor(getContext(), R.color.color_white), PorterDuff.Mode.MULTIPLY);
|
|
||||||
toolbar.setNavigationIcon(back);
|
toolbar.setNavigationIcon(back);
|
||||||
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
||||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -94,6 +94,9 @@ public class IncrementalChangesManager {
|
||||||
RegionUpdate monthRu = regionUpdateFiles.monthUpdates.get(month);
|
RegionUpdate monthRu = regionUpdateFiles.monthUpdates.get(month);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
RegionUpdate ru = it.next();
|
RegionUpdate ru = it.next();
|
||||||
|
if(ru == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (ru.obfCreated < dateCreated ||
|
if (ru.obfCreated < dateCreated ||
|
||||||
(monthRu != null && ru.obfCreated < monthRu.obfCreated)) {
|
(monthRu != null && ru.obfCreated < monthRu.obfCreated)) {
|
||||||
log.info("Delete overlapping day update " + ru.file.getName());
|
log.info("Delete overlapping day update " + ru.file.getName());
|
||||||
|
@ -161,10 +164,12 @@ public class IncrementalChangesManager {
|
||||||
if(date.endsWith("00")) {
|
if(date.endsWith("00")) {
|
||||||
monthUpdates.put(monthYear, ru);
|
monthUpdates.put(monthYear, ru);
|
||||||
} else {
|
} else {
|
||||||
if (!dayUpdates.containsKey(monthYear)) {
|
List<RegionUpdate> list = dayUpdates.get(monthYear);
|
||||||
dayUpdates.put(monthYear, new ArrayList<IncrementalChangesManager.RegionUpdate>());
|
if (list == null) {
|
||||||
|
list = new ArrayList<IncrementalChangesManager.RegionUpdate>();
|
||||||
}
|
}
|
||||||
dayUpdates.get(monthYear).add(ru);
|
list.add(ru);
|
||||||
|
dayUpdates.put(monthYear, list);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,6 +313,9 @@ public abstract class OsmandMapLayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void layerOnPreExecute() {
|
||||||
|
}
|
||||||
|
|
||||||
public void layerOnPostExecute() {
|
public void layerOnPostExecute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,6 +353,7 @@ public abstract class OsmandMapLayer {
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
currentTask = this;
|
currentTask = this;
|
||||||
|
layerOnPreExecute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -373,7 +373,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
if (mainLayer != null) {
|
if (mainLayer != null) {
|
||||||
animatedDraggingThread.stopAnimating();
|
animatedDraggingThread.stopAnimating();
|
||||||
currentViewport.setZoomAndAnimation(zoom, 0, 0);
|
currentViewport.setZoomAndAnimation(zoom, 0, 0);
|
||||||
currentViewport.setRotate(zoom > LOWEST_ZOOM_TO_ROTATE ? rotate : 0);
|
if (zoom <= LOWEST_ZOOM_TO_ROTATE) {
|
||||||
|
rotate = 0;
|
||||||
|
}
|
||||||
|
currentViewport.setRotate(rotate);
|
||||||
refreshMap();
|
refreshMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,7 +386,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
animatedDraggingThread.stopAnimating();
|
animatedDraggingThread.stopAnimating();
|
||||||
currentViewport.setZoomAndAnimation(zoom, 0);
|
currentViewport.setZoomAndAnimation(zoom, 0);
|
||||||
currentViewport.setMapDensity(mapDensity);
|
currentViewport.setMapDensity(mapDensity);
|
||||||
currentViewport.setRotate(zoom > LOWEST_ZOOM_TO_ROTATE ? rotate : 0);
|
if (zoom <= LOWEST_ZOOM_TO_ROTATE) {
|
||||||
|
rotate = 0;
|
||||||
|
}
|
||||||
|
currentViewport.setRotate(rotate);
|
||||||
refreshMap();
|
refreshMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -899,7 +905,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
protected void zoomToAnimate(int zoom, double zoomToAnimate, boolean notify) {
|
protected void zoomToAnimate(int zoom, double zoomToAnimate, boolean notify) {
|
||||||
if (mainLayer != null && getMaxZoom() >= zoom && getMinZoom() <= zoom) {
|
if (mainLayer != null && getMaxZoom() >= zoom && getMinZoom() <= zoom) {
|
||||||
currentViewport.setZoomAndAnimation(zoom, zoomToAnimate);
|
currentViewport.setZoomAndAnimation(zoom, zoomToAnimate);
|
||||||
currentViewport.setRotate(zoom > LOWEST_ZOOM_TO_ROTATE ? rotate : 0);
|
if (zoom <= LOWEST_ZOOM_TO_ROTATE) {
|
||||||
|
rotate = 0;
|
||||||
|
}
|
||||||
|
currentViewport.setRotate(rotate);
|
||||||
refreshMap();
|
refreshMap();
|
||||||
if (notify && locationListener != null) {
|
if (notify && locationListener != null) {
|
||||||
locationListener.locationChanged(getLatitude(), getLongitude(), this);
|
locationListener.locationChanged(getLatitude(), getLongitude(), this);
|
||||||
|
|
|
@ -94,16 +94,20 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
return super.isInterrupted();
|
return super.isInterrupted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void layerOnPreExecute() {
|
||||||
|
calculatedFilters = new TreeSet<>(filters);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void layerOnPostExecute() {
|
public void layerOnPostExecute() {
|
||||||
filters = calculatedFilters;
|
|
||||||
activity.getMapView().refreshMap();
|
activity.getMapView().refreshMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Amenity> calculateResult(RotatedTileBox tileBox) {
|
protected List<Amenity> calculateResult(RotatedTileBox tileBox) {
|
||||||
QuadRect latLonBounds = tileBox.getLatLonBounds();
|
QuadRect latLonBounds = tileBox.getLatLonBounds();
|
||||||
calculatedFilters = filters;
|
|
||||||
if (calculatedFilters.isEmpty() || latLonBounds == null) {
|
if (calculatedFilters.isEmpty() || latLonBounds == null) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -764,7 +764,6 @@ public class RouteInfoWidgetsFactory {
|
||||||
private int dist;
|
private int dist;
|
||||||
private LanesDrawable lanesDrawable;
|
private LanesDrawable lanesDrawable;
|
||||||
private View centerInfo;
|
private View centerInfo;
|
||||||
private View progress;
|
|
||||||
private int shadowRadius;
|
private int shadowRadius;
|
||||||
|
|
||||||
public LanesControl(final MapActivity map, final OsmandMapTileView view) {
|
public LanesControl(final MapActivity map, final OsmandMapTileView view) {
|
||||||
|
@ -772,7 +771,6 @@ public class RouteInfoWidgetsFactory {
|
||||||
lanesText = (TextView) map.findViewById(R.id.map_lanes_dist_text);
|
lanesText = (TextView) map.findViewById(R.id.map_lanes_dist_text);
|
||||||
lanesShadowText = (TextView) map.findViewById(R.id.map_lanes_dist_text_shadow);
|
lanesShadowText = (TextView) map.findViewById(R.id.map_lanes_dist_text_shadow);
|
||||||
centerInfo = (View) map.findViewById(R.id.map_center_info);
|
centerInfo = (View) map.findViewById(R.id.map_center_info);
|
||||||
progress = (View) map.findViewById(R.id.map_horizontal_progress);
|
|
||||||
lanesDrawable = new LanesDrawable(map, map.getMapView().getScaleCoefficient());
|
lanesDrawable = new LanesDrawable(map, map.getMapView().getScaleCoefficient());
|
||||||
lanesView.setImageDrawable(lanesDrawable);
|
lanesView.setImageDrawable(lanesDrawable);
|
||||||
trackingUtilities = map.getMapViewTrackingUtilities();
|
trackingUtilities = map.getMapViewTrackingUtilities();
|
||||||
|
@ -859,7 +857,7 @@ public class RouteInfoWidgetsFactory {
|
||||||
updateVisibility(lanesShadowText, visible && shadowRadius > 0);
|
updateVisibility(lanesShadowText, visible && shadowRadius > 0);
|
||||||
updateVisibility(lanesText, visible);
|
updateVisibility(lanesText, visible);
|
||||||
updateVisibility(lanesView, visible);
|
updateVisibility(lanesView, visible);
|
||||||
updateVisibility(centerInfo, visible || progress.getVisibility() == View.VISIBLE);
|
updateVisibility(centerInfo, visible);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv
|
||||||
boolean outdated = mainIndexItem != null && mainIndexItem.isOutdated();
|
boolean outdated = mainIndexItem != null && mainIndexItem.isOutdated();
|
||||||
File selectedTravelBook = app.getTravelDbHelper().getSelectedTravelBook();
|
File selectedTravelBook = app.getTravelDbHelper().getSelectedTravelBook();
|
||||||
|
|
||||||
if (selectedTravelBook == null || outdated) {
|
if (selectedTravelBook == null || (outdated && app.getSettings().SHOW_TRAVEL_UPDATE_CARD.get())) {
|
||||||
boolean showOtherMaps = false;
|
boolean showOtherMaps = false;
|
||||||
if (selectedTravelBook == null) {
|
if (selectedTravelBook == null) {
|
||||||
List<IndexItem> items = downloadThread.getIndexes().getWikivoyageItems();
|
List<IndexItem> items = downloadThread.getIndexes().getWikivoyageItems();
|
||||||
|
@ -238,6 +238,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv
|
||||||
downloadThread.cancelDownload(mainIndexItem);
|
downloadThread.cancelDownload(mainIndexItem);
|
||||||
adapter.updateDownloadUpdateCard(false);
|
adapter.updateDownloadUpdateCard(false);
|
||||||
} else if (!downloadUpdateCard.isDownload()) {
|
} else if (!downloadUpdateCard.isDownload()) {
|
||||||
|
app.getSettings().SHOW_TRAVEL_UPDATE_CARD.set(false);
|
||||||
removeDownloadUpdateCard();
|
removeDownloadUpdateCard();
|
||||||
} else if (downloadUpdateCard.isShowOtherMapsBtn()) {
|
} else if (downloadUpdateCard.isShowOtherMapsBtn()) {
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
|
@ -258,7 +259,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv
|
||||||
|
|
||||||
private void addNeededMapsCard() {
|
private void addNeededMapsCard() {
|
||||||
final OsmandApplication app = getMyApplication();
|
final OsmandApplication app = getMyApplication();
|
||||||
if (app != null && !neededIndexItems.isEmpty() && adapter != null) {
|
if (app != null && !neededIndexItems.isEmpty() && adapter != null && app.getSettings().SHOW_TRAVEL_NEEDED_MAPS_CARD.get()) {
|
||||||
neededMapsCard = new TravelNeededMapsCard(app, nightMode, neededIndexItems);
|
neededMapsCard = new TravelNeededMapsCard(app, nightMode, neededIndexItems);
|
||||||
neededMapsCard.setListener(new TravelNeededMapsCard.CardListener() {
|
neededMapsCard.setListener(new TravelNeededMapsCard.CardListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -277,6 +278,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv
|
||||||
adapter.updateNeededMapsCard(false);
|
adapter.updateNeededMapsCard(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
app.getSettings().SHOW_TRAVEL_NEEDED_MAPS_CARD.set(false);
|
||||||
removeNeededMapsCard();
|
removeNeededMapsCard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue