don't show duplicates fragment for history search items
This commit is contained in:
parent
02da17f726
commit
ce498d7e04
4 changed files with 12 additions and 6 deletions
|
@ -68,6 +68,10 @@ public abstract class CollectionSettingsItem<T> extends SettingsItem {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean shouldShowDuplicates() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public abstract boolean isDuplicate(@NonNull T item);
|
public abstract boolean isDuplicate(@NonNull T item);
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|
|
@ -143,6 +143,11 @@ public class SearchHistorySettingsItem extends CollectionSettingsItem<HistoryEnt
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldShowDuplicates() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldReadOnCollecting() {
|
public boolean shouldReadOnCollecting() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -428,8 +428,9 @@ public class SettingsHelper {
|
||||||
duplicateItems.add(((ProfileSettingsItem) item).getModeBean());
|
duplicateItems.add(((ProfileSettingsItem) item).getModeBean());
|
||||||
}
|
}
|
||||||
} else if (item instanceof CollectionSettingsItem<?>) {
|
} else if (item instanceof CollectionSettingsItem<?>) {
|
||||||
List<?> duplicates = ((CollectionSettingsItem<?>) item).processDuplicateItems();
|
CollectionSettingsItem settingsItem = (CollectionSettingsItem) item;
|
||||||
if (!duplicates.isEmpty()) {
|
List<?> duplicates = settingsItem.processDuplicateItems();
|
||||||
|
if (!duplicates.isEmpty() && settingsItem.shouldShowDuplicates()) {
|
||||||
duplicateItems.addAll(duplicates);
|
duplicateItems.addAll(duplicates);
|
||||||
}
|
}
|
||||||
} else if (item instanceof FileSettingsItem) {
|
} else if (item instanceof FileSettingsItem) {
|
||||||
|
|
|
@ -321,10 +321,6 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment {
|
||||||
duplicates.add(getString(R.string.markers_history));
|
duplicates.add(getString(R.string.markers_history));
|
||||||
duplicates.addAll(markersHistoryGroups);
|
duplicates.addAll(markersHistoryGroups);
|
||||||
}
|
}
|
||||||
if (!historyEntries.isEmpty()) {
|
|
||||||
duplicates.add(getString(R.string.shared_string_search_history));
|
|
||||||
duplicates.addAll(historyEntries);
|
|
||||||
}
|
|
||||||
return duplicates;
|
return duplicates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue