Search - introduce top visible types (2)
This commit is contained in:
parent
b2ef894e67
commit
04a20a1d0d
2 changed files with 6 additions and 1 deletions
|
@ -731,7 +731,8 @@ public class SearchUICore {
|
|||
|
||||
@Override
|
||||
public int compare(SearchResult o1, SearchResult o2) {
|
||||
if (o1.getFoundWordCount() != o2.getFoundWordCount()) {
|
||||
if (!ObjectType.isTopVisible(o1.objectType) && !ObjectType.isTopVisible(o2.objectType)
|
||||
&& o1.getFoundWordCount() != o2.getFoundWordCount()) {
|
||||
return -Algorithms.compare(o1.getFoundWordCount(), o2.getFoundWordCount());
|
||||
}
|
||||
if (!sortByName) {
|
||||
|
|
|
@ -34,6 +34,10 @@ public enum ObjectType {
|
|||
return t == CITY || t == VILLAGE || t == POSTCODE || t == STREET || t == HOUSE || t == STREET_INTERSECTION;
|
||||
}
|
||||
|
||||
public static boolean isTopVisible(ObjectType t) {
|
||||
return t == POI_TYPE || t == FAVORITE || t == FAVORITE_GROUP || t == WPT || t == LOCATION || t == PARTIAL_LOCATION;
|
||||
}
|
||||
|
||||
public static ObjectType getExclusiveSearchType(ObjectType t) {
|
||||
if (t == FAVORITE_GROUP) {
|
||||
return FAVORITE;
|
||||
|
|
Loading…
Reference in a new issue