diff --git a/OsmAnd/res/drawable/ic_action_close.xml b/OsmAnd/res/drawable/ic_action_close.xml new file mode 100644 index 0000000000..c2db7dae77 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_close.xml @@ -0,0 +1,10 @@ + + + diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 7798772acd..3ef19df160 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3297,11 +3297,7 @@ المسار: المسافة%s ، وقت جهاز التوجيه%s \nالحساب:%.1f ثانية ،%d طرق ،%d تجانب) الأوكيتانية - احصل على خصم بمقدار %d %@ at %d%% . - %1$s للأول %2$s - %1$s للأول %2$s ثم %1$s - %1$s • وفر %2$s تطبيق فقط على \"%1$s\" إعدادات التوجيه في ملف التعريف المحدد \"%1$s\". حد العرض diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java index ca626b0563..fde2f7f9b0 100644 --- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java +++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java @@ -107,9 +107,9 @@ public class SQLiteTileSource implements ITileSource { this.inversiveZoom = inversiveZoom; } - public SQLiteTileSource(SQLiteTileSource tileSource, int suffixNum, OsmandApplication ctx) { + public SQLiteTileSource(SQLiteTileSource tileSource, String name, OsmandApplication ctx) { this.ctx = ctx; - this.name = tileSource.getName() + "_" + suffixNum; + this.name = name; this.urlTemplate = tileSource.getUrlTemplate(); this.maxZoom = tileSource.getMaximumZoomSupported(); this.minZoom = tileSource.getMinimumZoomSupported(); diff --git a/OsmAnd/src/net/osmand/plus/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/SettingsHelper.java index eb5d5bf434..bc299d6e10 100644 --- a/OsmAnd/src/net/osmand/plus/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/SettingsHelper.java @@ -264,10 +264,10 @@ public class SettingsHelper { @NonNull public abstract List excludeDuplicateItems(); - public abstract boolean isDuplicate(T item); + public abstract boolean isDuplicate(@NonNull T item); @NonNull - public abstract T renameItem(T item); + public abstract T renameItem(@NonNull T item); } public abstract static class SettingsItemReader { @@ -858,13 +858,13 @@ public class SettingsHelper { } @Override - public boolean isDuplicate(QuickAction item) { + public boolean isDuplicate(@NonNull QuickAction item) { return !actionRegistry.isNameUnique(item, app); } @NonNull @Override - public QuickAction renameItem(QuickAction item) { + public QuickAction renameItem(@NonNull QuickAction item) { return actionRegistry.generateUniqueName(item, app); } @@ -902,7 +902,7 @@ public class SettingsHelper { newActions.addAll(duplicateItems); } newActions.addAll(items); - app.getQuickActionRegistry().updateQuickActions(newActions); + actionRegistry.updateQuickActions(newActions); } } @@ -1048,7 +1048,7 @@ public class SettingsHelper { } @Override - public boolean isDuplicate(PoiUIFilter item) { + public boolean isDuplicate(@NonNull PoiUIFilter item) { String savedName = item.getName(); for (PoiUIFilter filter : existingItems) { if (filter.getName().equals(savedName)) { @@ -1076,11 +1076,13 @@ public class SettingsHelper { @NonNull @Override - public PoiUIFilter renameItem(PoiUIFilter item) { + public PoiUIFilter renameItem(@NonNull PoiUIFilter item) { int number = 0; while (true) { number++; - PoiUIFilter renamedItem = new PoiUIFilter(item, number, app); + PoiUIFilter renamedItem = new PoiUIFilter(item, + item.getName() + "_" + number, + item.getFilterId() + "_" + number); if (!isDuplicate(renamedItem)) { return renamedItem; } @@ -1273,13 +1275,16 @@ public class SettingsHelper { @NonNull @Override - public ITileSource renameItem(ITileSource item) { + public ITileSource renameItem(@NonNull ITileSource item) { int number = 0; while (true) { number++; if (item instanceof SQLiteTileSource) { SQLiteTileSource oldItem = (SQLiteTileSource) item; - SQLiteTileSource renamedItem = new SQLiteTileSource(oldItem, number, app); + SQLiteTileSource renamedItem = new SQLiteTileSource( + oldItem, + oldItem.getName() + "_" + number, + app); if (!isDuplicate(renamedItem)) { return renamedItem; } @@ -1294,7 +1299,7 @@ public class SettingsHelper { } @Override - public boolean isDuplicate(ITileSource item) { + public boolean isDuplicate(@NonNull ITileSource item) { for (String name : existingItemsNames) { if (name.equals(item.getName())) { return true; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java index f7d697444b..bfb253eca0 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java @@ -9,6 +9,7 @@ import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.plus.AppInitializer; import net.osmand.plus.OsmandApplication; @@ -36,7 +37,9 @@ public class WhatsNewDialogFragment extends DialogFragment { public void onClick(DialogInterface dialog, int which) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(AppInitializer.LATEST_CHANGES_URL)); - startActivity(i); + if (AndroidUtils.isIntentSafe(osmandApplication, i)) { + startActivity(i); + } dismiss(); } }); diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java index 30d643b57c..ac604910a5 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java @@ -125,14 +125,16 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable name = app.getPoiFilters().getFiltersName(filtersToMerge); } - public PoiUIFilter(PoiUIFilter filter, int suffixNum, OsmandApplication app) { - this.app = app; - name = filter.getName() + "_" + suffixNum; - filterId = filter.getFilterId() + "_" + suffixNum; + public PoiUIFilter(PoiUIFilter filter, String name, String filterId) { + this.app = filter.app; + this.name = name; + this.filterId = filterId; isStandardFilter = false; - poiTypes = app.getPoiTypes(); + poiTypes = filter.poiTypes; acceptedTypes = filter.getAcceptedTypes(); poiAdditionals = filter.getPoiAdditionals(); + filterByName = filter.filterByName; + savedFilterByName = filter.savedFilterByName; } public boolean isDeleted() {