Removed .sqlitedb extensions in Configure Map menu.

This commit is contained in:
madwasp79 2019-01-08 15:46:37 +02:00
parent e3fcfe295a
commit 900e07dc12
3 changed files with 16 additions and 0 deletions

View file

@ -3,6 +3,7 @@ package net.osmand.aidl.tiles;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.util.Log;
public class ASqliteDbFile implements Parcelable {

View file

@ -2,6 +2,7 @@ package net.osmand.plus.dialogs;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
@ -60,10 +61,15 @@ public class RasterMapMenu {
} else {
throw new RuntimeException("Unexpected raster map type");
}
final OsmandSettings.CommonPreference<Boolean> hidePolygonsPref =
mapActivity.getMyApplication().getSettings().getCustomRenderBooleanProperty("noPolygons");
String mapTypeDescr = mapTypePreference.get();
if (mapTypeDescr!=null && mapTypeDescr.contains(".sqlitedb")) {
mapTypeDescr = mapTypeDescr.replaceFirst(".sqlitedb", "");
}
final boolean selected = mapTypeDescr != null;
final int toggleActionStringId = selected ? R.string.shared_string_enabled
: R.string.shared_string_disabled;
@ -124,6 +130,7 @@ public class RasterMapMenu {
return false;
}
};
mapTypeDescr = selected ? mapTypeDescr : mapActivity.getString(R.string.shared_string_none);
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(toggleActionStringId, mapActivity)

View file

@ -275,6 +275,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
ContextMenuItem item = adapter.getItem(pos);
String overlayMapDescr = settings.MAP_OVERLAY.get();
boolean hasOverlayDescription = overlayMapDescr != null;
overlayMapDescr = hasOverlayDescription ? overlayMapDescr
: mapActivity.getString(R.string.shared_string_none);
@ -294,6 +295,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
ContextMenuItem item = adapter.getItem(pos);
String underlayMapDescr = settings.MAP_UNDERLAY.get();
boolean hasUnderlayDescription = underlayMapDescr != null;
underlayMapDescr = hasUnderlayDescription ? underlayMapDescr
: mapActivity.getString(R.string.shared_string_none);
@ -325,6 +327,9 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
settings.MAP_UNDERLAY_PREVIOUS.set(null);
}
String overlayMapDescr = settings.MAP_OVERLAY.get();
if (overlayMapDescr!=null && overlayMapDescr.contains(".sqlitedb")) {
overlayMapDescr = overlayMapDescr.replaceFirst(".sqlitedb", "");
}
boolean hasOverlayDescription = overlayMapDescr != null;
overlayMapDescr = hasOverlayDescription ? overlayMapDescr : mapActivity.getString(R.string.shared_string_none);
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_overlay, mapActivity)
@ -338,6 +343,9 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
.setPosition(14)
.createItem());
String underlayMapDescr = settings.MAP_UNDERLAY.get();
if (underlayMapDescr!=null && underlayMapDescr.contains(".sqlitedb")) {
underlayMapDescr = underlayMapDescr.replaceFirst(".sqlitedb", "");
}
boolean hasUnderlayDescription = underlayMapDescr != null;
underlayMapDescr = hasUnderlayDescription ? underlayMapDescr : mapActivity.getString(R.string.shared_string_none);
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_underlay, mapActivity)