This commit is contained in:
Alexey Kulish 2017-04-26 12:57:19 +03:00
parent 5b26bdb27e
commit df1ad2c636
4 changed files with 8 additions and 16 deletions

View file

@ -29,7 +29,6 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.OsmAndListFragment;
import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
import net.osmand.plus.search.QuickSearchDialogFragment.QuickSearchType;
import net.osmand.plus.search.listitems.QuickSearchBottomShadowListItem;
import net.osmand.plus.search.listitems.QuickSearchButtonListItem;
import net.osmand.plus.search.listitems.QuickSearchListItem;
@ -236,8 +235,8 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
pointDescription.setIconName("ic_action_building");
break;
case LOCATION:
LatLon latLon = (LatLon) object;
pointDescription = new PointDescription(latLon.getLatitude(), latLon.getLongitude());
pointDescription = new PointDescription(
searchResult.location.getLatitude(), searchResult.location.getLongitude());
pointDescription.setIconName("ic_action_world_globe");
break;
case STREET_INTERSECTION:

View file

@ -30,7 +30,6 @@ import net.osmand.plus.render.RenderingIcons;
import net.osmand.search.core.CustomSearchPoiFilter;
import net.osmand.search.core.SearchResult;
import net.osmand.util.Algorithms;
import net.osmand.util.GeoPointParserUtil.GeoParsedPoint;
import java.io.File;
@ -206,13 +205,7 @@ public class QuickSearchListItem {
}
return typeStr;
case LOCATION:
LatLon latLon = null;
if (searchResult.object instanceof LatLon) {
latLon = (LatLon) searchResult.object;
} else if (searchResult.object instanceof GeoParsedPoint) {
GeoParsedPoint geoParsedPoint = (GeoParsedPoint) searchResult.object;
latLon = new LatLon(geoParsedPoint.getLatitude(), geoParsedPoint.getLongitude());
}
LatLon latLon = searchResult.location;
if (latLon != null && searchResult.localeRelatedObjectName == null) {
String locationCountry = app.getRegions().getCountryName(latLon);
searchResult.localeRelatedObjectName = locationCountry == null ? "" : locationCountry;

View file

@ -179,8 +179,8 @@ public abstract class QuickSearchListFragment extends ListFragment {
pointDescription.setIconName("ic_action_building");
break;
case LOCATION:
LatLon latLon = (LatLon) object;
pointDescription = new PointDescription(latLon.getLatitude(), latLon.getLongitude());
pointDescription = new PointDescription(
searchResult.location.getLatitude(), searchResult.location.getLongitude());
pointDescription.setIconName("ic_action_world_globe");
break;
case STREET_INTERSECTION:

View file

@ -76,8 +76,8 @@ public class QuickSearchListItem {
}
break;
case LOCATION:
LatLon latLon = (LatLon) searchResult.object;
return PointDescription.getLocationNamePlain(app, latLon.getLatitude(), latLon.getLongitude());
return PointDescription.getLocationNamePlain(
app, searchResult.location.getLatitude(), searchResult.location.getLongitude());
}
return searchResult.localeName;
}
@ -180,7 +180,7 @@ public class QuickSearchListItem {
}
return typeStr;
case LOCATION:
LatLon latLon = (LatLon) searchResult.object;
LatLon latLon = searchResult.location;
if (searchResult.localeRelatedObjectName == null) {
String locationCountry = app.getRegions().getCountryName(latLon);
searchResult.localeRelatedObjectName = locationCountry == null ? "" : locationCountry;