use of net.osmand.search.core.SearchSettings in project Osmand by osmandapp.
the class QuickSearchDialogFragment method replaceQueryWithText.
public void replaceQueryWithText(String txt) {
searchQuery = txt;
searchEditText.setText(txt);
searchEditText.setSelection(txt.length());
SearchWord lastWord = searchUICore.getPhrase().getLastSelectedWord();
boolean buttonToolbarVisible = lastWord == null || searchType == QuickSearchType.REGULAR || ((searchType == QuickSearchType.START_POINT || searchType == QuickSearchType.DESTINATION || searchType == QuickSearchType.INTERMEDIATE) && ObjectType.isAddress(lastWord.getType()));
buttonToolbarView.setVisibility(buttonToolbarVisible ? View.VISIBLE : View.GONE);
updateToolbarButton();
SearchSettings settings = searchUICore.getSearchSettings();
if (settings.getRadiusLevel() != 1) {
searchUICore.updateSettings(settings.setRadiusLevel(1));
}
runCoreSearch(txt, false, false);
}
use of net.osmand.search.core.SearchSettings in project Osmand by osmandapp.
the class QuickSearchDialogFragment method startCitySearch.
private void startCitySearch() {
SearchSettings settings = searchUICore.getSearchSettings().setEmptyQueryAllowed(true).setSortByName(true).setSearchTypes(ObjectType.CITY, ObjectType.VILLAGE).setRadiusLevel(1);
searchUICore.updateSettings(settings);
}
use of net.osmand.search.core.SearchSettings in project Osmand by osmandapp.
the class QuickSearchDialogFragment method runSearch.
private void runSearch(String text) {
showProgressBar();
SearchSettings settings = searchUICore.getSearchSettings();
if (settings.getRadiusLevel() != 1) {
searchUICore.updateSettings(settings.setRadiusLevel(1));
}
runCoreSearch(text, true, false);
}
use of net.osmand.search.core.SearchSettings in project Osmand by osmandapp.
the class QuickSearchDialogFragment method showFilter.
public void showFilter(@NonNull String filterId) {
PoiUIFilter filter = app.getPoiFilters().getFilterById(filterId);
boolean isCustomFilter = filterId.equals(app.getPoiFilters().getCustomPOIFilter().getFilterId());
if (isCustomFilter) {
fabVisible = true;
poiFilterApplied = true;
updateFab();
}
SearchResult sr = new SearchResult(searchUICore.getPhrase());
sr.localeName = filter.getName();
sr.object = filter;
sr.priority = 0;
sr.objectType = ObjectType.POI_TYPE;
searchUICore.selectSearchResult(sr);
String txt = filter.getName() + " ";
searchQuery = txt;
searchEditText.setText(txt);
searchEditText.setSelection(txt.length());
updateToolbarButton();
SearchSettings settings = searchUICore.getSearchSettings();
if (settings.getRadiusLevel() != 1) {
searchUICore.updateSettings(settings.setRadiusLevel(1));
}
runCoreSearch(txt, false, false);
}
Aggregations