diff --git a/OsmAnd/res/drawable/img_legend_slope.xml b/OsmAnd/res/drawable/img_legend_slope.xml
new file mode 100644
index 0000000000..e3a8566e45
--- /dev/null
+++ b/OsmAnd/res/drawable/img_legend_slope.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml
index baca708d0e..9921ff27d2 100644
--- a/OsmAnd/res/layout/fragment_import.xml
+++ b/OsmAnd/res/layout/fragment_import.xml
@@ -128,6 +128,16 @@
+
+
diff --git a/OsmAnd/res/layout/fragment_import_complete.xml b/OsmAnd/res/layout/fragment_import_complete.xml
new file mode 100644
index 0000000000..b0af290996
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_import_complete.xml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/fragment_import_duplicates.xml b/OsmAnd/res/layout/fragment_import_duplicates.xml
index dc1fdf7d8f..d5f25eb5af 100644
--- a/OsmAnd/res/layout/fragment_import_duplicates.xml
+++ b/OsmAnd/res/layout/fragment_import_duplicates.xml
@@ -3,6 +3,7 @@
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ xmlns:tools="http://schemas.android.com/tools"
android:background="?attr/activity_background_basic">
+ tools:title="@string/import_duplicates_title">
+
+
diff --git a/OsmAnd/res/layout/list_item_import.xml b/OsmAnd/res/layout/list_item_import.xml
index 25042fd505..9f489889b7 100644
--- a/OsmAnd/res/layout/list_item_import.xml
+++ b/OsmAnd/res/layout/list_item_import.xml
@@ -7,49 +7,57 @@
android:minHeight="@dimen/setting_list_item_small_height"
android:orientation="vertical">
-
-
-
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ android:layout_height="match_parent"
+ android:background="?attr/selectableItemBackground"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
-
+
+
+ android:orientation="vertical"
+ android:paddingTop="@dimen/content_padding_small"
+ android:paddingBottom="@dimen/content_padding_small">
-
+
+
+
+
+
-
+
Restore all profile settings?
Saving new profile
Could not back up profile.
+ Importing data from %1$s
+ Importing
+ OsmAnd check %1$s for duplicates with existing items in the application.\n\nIt may take some time.
+ Items added
+ Import complete
+ All data from the %1$s is imported, you can use buttons below to open needed part of the application to manage it.
Import rendering file
Custom profile
Angle: %s°
diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
index fde2f7f9b0..82e4df2762 100644
--- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
+++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java
@@ -126,9 +126,9 @@ public class SQLiteTileSource implements ITileSource {
db = ctx.getSQLiteAPI().getOrCreateDatabase(
ctx.getAppPath(TILES_INDEX_DIR).getAbsolutePath() + "/" + name + SQLITE_EXT, true);
- db.execSQL("CREATE TABLE tiles (x int, y int, z int, s int, image blob, time long, PRIMARY KEY (x,y,z,s))");
- db.execSQL("CREATE INDEX IND on tiles (x,y,z,s)");
- db.execSQL("CREATE TABLE info(tilenumbering,minzoom,maxzoom)");
+ db.execSQL("CREATE TABLE IF NOT EXISTS tiles (x int, y int, z int, s int, image blob, time long, PRIMARY KEY (x,y,z,s))");
+ db.execSQL("CREATE INDEX IF NOT EXISTS IND on tiles (x,y,z,s)");
+ db.execSQL("CREATE TABLE IF NOT EXISTS info(tilenumbering,minzoom,maxzoom)");
db.execSQL("INSERT INTO info (tilenumbering,minzoom,maxzoom) VALUES ('simple','" + minZoom + "','" + maxZoom + "');");
addInfoColumn(URL, urlTemplate);
diff --git a/OsmAnd/src/net/osmand/plus/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/SettingsHelper.java
index 09aef61a38..41321c54e5 100644
--- a/OsmAnd/src/net/osmand/plus/SettingsHelper.java
+++ b/OsmAnd/src/net/osmand/plus/SettingsHelper.java
@@ -1,13 +1,11 @@
package net.osmand.plus;
import android.annotation.SuppressLint;
-import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
@@ -96,16 +94,20 @@ public class SettingsHelper {
private static final int BUFFER = 1024;
private OsmandApplication app;
- private Activity activity;
- private boolean importing;
- private boolean importSuspended;
- private boolean collectOnly;
private ImportAsyncTask importTask;
private Map exportAsyncTasks = new HashMap<>();
public interface SettingsImportListener {
- void onSettingsImportFinished(boolean succeed, boolean empty, @NonNull List items);
+ void onSettingsImportFinished(boolean succeed, @NonNull List items);
+ }
+
+ public interface SettingsCollectListener {
+ void onSettingsCollectFinished(boolean succeed, boolean empty, @NonNull List items);
+ }
+
+ public interface CheckDuplicatesListener {
+ void onDuplicatesChecked(@NonNull List