Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-07-22 17:26:37 +02:00
commit 454503dc2a
2 changed files with 14 additions and 3 deletions

View file

@ -509,6 +509,10 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
@Override @Override
public boolean publish(SearchResult object) { public boolean publish(SearchResult object) {
if (mainSearchFragment == null) {
return false;
}
switch (object.objectType) { switch (object.objectType) {
case SEARCH_API_FINISHED: case SEARCH_API_FINISHED:
final SearchCoreAPI searchApi = (SearchCoreAPI) object.object; final SearchCoreAPI searchApi = (SearchCoreAPI) object.object;
@ -581,7 +585,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
@Override @Override
public boolean isCancelled() { public boolean isCancelled() {
return false; return mainSearchFragment == null;
} }
}); });
} }

View file

@ -8,6 +8,7 @@ import net.osmand.data.Amenity;
import net.osmand.data.City; import net.osmand.data.City;
import net.osmand.data.City.CityType; import net.osmand.data.City.CityType;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.data.Street; import net.osmand.data.Street;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
@ -180,7 +181,13 @@ public class QuickSearchListItem {
} }
return typeStr; return typeStr;
case LOCATION: case LOCATION:
break; LatLon latLon = (LatLon) searchResult.object;
String country = app.getRegions().getCountryName(latLon);
if (!Algorithms.isEmpty(country)) {
return country;
} else {
return "";
}
case FAVORITE: case FAVORITE:
FavouritePoint fav = (FavouritePoint) searchResult.object; FavouritePoint fav = (FavouritePoint) searchResult.object;
return fav.getCategory().length() == 0 ? return fav.getCategory().length() == 0 ?
@ -275,7 +282,7 @@ public class QuickSearchListItem {
return null; return null;
} }
case LOCATION: case LOCATION:
return app.getIconsCache().getIcon(R.drawable.ic_action_coordinates_latitude, return app.getIconsCache().getIcon(R.drawable.ic_action_world_globe,
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark); app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
case FAVORITE: case FAVORITE:
FavouritePoint fav = (FavouritePoint) searchResult.object; FavouritePoint fav = (FavouritePoint) searchResult.object;