add ObjectType.GPX_TRACK
This commit is contained in:
parent
d942a4f683
commit
0d39173b8b
7 changed files with 10 additions and 9 deletions
|
@ -8,7 +8,7 @@ public enum ObjectType {
|
|||
// LOCATION
|
||||
LOCATION(true), PARTIAL_LOCATION(false),
|
||||
// UI OBJECTS
|
||||
FAVORITE(true), FAVORITE_GROUP(false), WPT(true), RECENT_OBJ(true),
|
||||
FAVORITE(true), FAVORITE_GROUP(false), WPT(true), RECENT_OBJ(true), GPX_TRACK(false),
|
||||
|
||||
// ONLINE SEARCH
|
||||
ONLINE_SEARCH(true),
|
||||
|
|
|
@ -305,8 +305,6 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
|
|||
iconId = R.drawable.ic_type_video;
|
||||
} else if (pd.isPhotoNote()) {
|
||||
iconId = R.drawable.ic_type_img;
|
||||
} else if (pd.isGpxFile()) {
|
||||
iconId = R.drawable.ic_action_polygom_dark;
|
||||
} else {
|
||||
iconId = R.drawable.ic_action_street_name;
|
||||
}
|
||||
|
|
|
@ -513,8 +513,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
List<HistoryEntry> historyEntries = new ArrayList<HistoryEntry>();
|
||||
List<QuickSearchListItem> selectedItems = historySearchFragment.getListAdapter().getSelectedItems();
|
||||
for (QuickSearchListItem searchListItem : selectedItems) {
|
||||
SearchResult sr = searchListItem.getSearchResult();
|
||||
Object object = sr.object;
|
||||
Object object = searchListItem.getSearchResult().object;;
|
||||
if (object instanceof HistoryEntry) {
|
||||
historyEntries.add((HistoryEntry) object);
|
||||
}
|
||||
|
|
|
@ -464,7 +464,7 @@ public class QuickSearchHelper implements ResourceListener {
|
|||
if (gpxInfo != null) {
|
||||
sr.localeName = gpxInfo.getFileName();
|
||||
sr.object = point;
|
||||
sr.objectType = ObjectType.RECENT_OBJ;
|
||||
sr.objectType = ObjectType.GPX_TRACK;
|
||||
sr.relatedObject = gpxInfo;
|
||||
publish = true;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import net.osmand.plus.search.listitems.QuickSearchListItemType;
|
|||
import net.osmand.plus.search.listitems.QuickSearchMoreListItem;
|
||||
import net.osmand.plus.search.listitems.QuickSearchSelectAllListItem;
|
||||
import net.osmand.search.SearchUICore;
|
||||
import net.osmand.search.core.ObjectType;
|
||||
import net.osmand.search.core.SearchPhrase;
|
||||
import net.osmand.search.core.SearchResult;
|
||||
import net.osmand.search.core.SearchWord;
|
||||
|
@ -401,7 +402,7 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
|
|||
@Nullable View convertView,
|
||||
@NonNull QuickSearchListItem listItem) {
|
||||
SearchResult sr = listItem.getSearchResult();
|
||||
if (sr != null && sr.relatedObject instanceof GPXInfo) {
|
||||
if (sr != null && sr.objectType == ObjectType.GPX_TRACK) {
|
||||
return bindGpxTrack(position, convertView, listItem, (GPXInfo) sr.relatedObject);
|
||||
} else {
|
||||
return bindSearchResult(position, convertView, listItem);
|
||||
|
|
|
@ -100,7 +100,8 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
|| sr.objectType == ObjectType.FAVORITE
|
||||
|| sr.objectType == ObjectType.RECENT_OBJ
|
||||
|| sr.objectType == ObjectType.WPT
|
||||
|| sr.objectType == ObjectType.STREET_INTERSECTION) {
|
||||
|| sr.objectType == ObjectType.STREET_INTERSECTION
|
||||
|| sr.objectType == ObjectType.GPX_TRACK) {
|
||||
|
||||
showResult(sr);
|
||||
} else {
|
||||
|
@ -170,7 +171,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
|
||||
public void showResult(SearchResult searchResult) {
|
||||
showResult = false;
|
||||
if (searchResult.relatedObject instanceof GPXInfo) {
|
||||
if (searchResult.objectType == ObjectType.GPX_TRACK) {
|
||||
showTrackMenuFragment((GPXInfo) searchResult.relatedObject);
|
||||
} else if (searchResult.location != null) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
|
|
|
@ -359,6 +359,8 @@ public class QuickSearchListItem {
|
|||
} else {
|
||||
return icon;
|
||||
}
|
||||
case GPX_TRACK:
|
||||
return getIcon(app, R.drawable.ic_action_polygom_dark);
|
||||
case LOCATION:
|
||||
return getIcon(app, R.drawable.ic_action_world_globe);
|
||||
case FAVORITE:
|
||||
|
|
Loading…
Reference in a new issue