diff --git a/OsmAnd/res/layout/fragment_import.xml b/OsmAnd/res/layout/fragment_import.xml
index 71810a5fd9..adb5757830 100644
--- a/OsmAnd/res/layout/fragment_import.xml
+++ b/OsmAnd/res/layout/fragment_import.xml
@@ -1,5 +1,5 @@
-
@@ -40,7 +39,6 @@
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@+id/toolbar_layout"
android:background="?attr/bg_color"
android:paddingStart="@dimen/content_padding"
android:paddingTop="@dimen/list_header_settings_top_margin"
@@ -55,15 +53,13 @@
android:id="@+id/description_divider"
layout="@layout/card_bottom_divider"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/description" />
+ android:layout_height="wrap_content"/>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_import_duplicates.xml b/OsmAnd/res/layout/fragment_import_duplicates.xml
index a60ea21119..16f45a773f 100644
--- a/OsmAnd/res/layout/fragment_import_duplicates.xml
+++ b/OsmAnd/res/layout/fragment_import_duplicates.xml
@@ -47,14 +47,17 @@
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium" />
-
+
+ android:layout_weight="1" />
savedActions = factory.parseActiveActionsList(getSettings().QUICK_ACTION_LIST.get());
+ for (QuickAction action : savedActions) {
+ if (action.getName(app).equals(quickAction.getName(app))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
public void apply() {
if (!quickActions.isEmpty() || !duplicates.isEmpty()) {
@@ -822,7 +844,7 @@ public class SettingsHelper {
}
} else {
for (QuickAction action : duplicates) {
- action.setName(COPY_PREFIX + action.getName(app));
+ renameAction(action);
}
}
newActions.addAll(duplicates);
@@ -979,7 +1001,6 @@ public class SettingsHelper {
for (PoiUIFilter duplicate : duplicates) {
if (!shouldReplace) {
renamePoiFilter(duplicate);
-// duplicate.setName(COPY_PREFIX + duplicate.getName());
}
poiUIFilters.add(duplicate);
}
@@ -992,6 +1013,7 @@ public class SettingsHelper {
private void renamePoiFilter(PoiUIFilter poiUIFilter) {
poiUIFilter.setName(COPY_PREFIX + poiUIFilter.getName());
+ poiUIFilter.setFilterId(poiUIFilter.getFilterId() + COPY_SUFFIX);
if (duplicateExists(poiUIFilter)) {
renamePoiFilter(poiUIFilter);
}
diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
index facbc5a6ed..6e024e290a 100644
--- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
+++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
@@ -726,6 +726,10 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable
return filterId;
}
+ public void setFilterId(String filterId) {
+ this.filterId = filterId;
+ }
+
public Map getPoiAdditionals() {
return poiAdditionals;
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/DuplicatesSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/DuplicatesSettingsAdapter.java
index 704863fa49..764b3d43f0 100644
--- a/OsmAnd/src/net/osmand/plus/settings/DuplicatesSettingsAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/settings/DuplicatesSettingsAdapter.java
@@ -97,7 +97,7 @@ public class DuplicatesSettingsAdapter extends RecyclerView.Adapter settingsItems;
private File file;
private boolean allSelected;
private boolean nightMode;
public static void showInstance(@NonNull FragmentManager fm, @NonNull List settingsItems, @NonNull File file) {
ImportSettingsFragment fragment = new ImportSettingsFragment();
fragment.setSettingsItems(settingsItems);
fragment.setFile(file);
// fragment.setTargetFragment();
// fragment.getTargetFragment()
fragment.show(fm, TAG);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
app = getMyApplication();
nightMode = !getSettings().isLightContent();
if (settingsItems == null) {
settingsItems = app.getSettingsHelper().getSettingsItems();
}
if (file == null) {
file = app.getSettingsHelper().getSettingsFile();
}
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
inflater = UiUtilities.getInflater(app, nightMode);
View root = inflater.inflate(R.layout.fragment_import, container, false);
setupToolbar((Toolbar) root.findViewById(R.id.toolbar));
TextViewEx continueBtn = root.findViewById(R.id.continue_button);
selectBtn = root.findViewById(R.id.select_button);
expandableList = root.findViewById(R.id.list);
continueBtn.setOnClickListener(this);
selectBtn.setOnClickListener(this);
return root;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
adapter = new ExportImportSettingsAdapter(getMyApplication(), getSettingsToOperate(), nightMode, true);
expandableList.setAdapter(adapter);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.select_button: {
allSelected = !allSelected;
selectBtn.setText(allSelected ? R.string.shared_string_deselect_all : R.string.shared_string_select_all);
adapter.selectAll(allSelected);
break;
}
case R.id.continue_button: {
if (adapter.getDataToOperate().isEmpty()) {
app.showShortToastMessage(getString(R.string.shared_sting_nothing_selected));
} else {
importItems();
}
break;
}
}
}
private void importItems() {
List settingsItems = getSettingsItemsFromData(adapter.getDataToOperate());
List