use of net.osmand.plus.search.listitems.QuickSearchMoreListItem.SearchMoreItemOnClickListener in project Osmand by osmandapp.
the class QuickSearchDialogFragment method addMoreButton.
private void addMoreButton(boolean searchMoreAvailable) {
if (!paused && !cancelPrev && mainSearchFragment != null && !isTextEmpty()) {
QuickSearchMoreListItem moreListItem = new QuickSearchMoreListItem(app, null, new SearchMoreItemOnClickListener() {
@Override
public void increaseRadiusOnClick() {
if (!interruptedSearch) {
SearchSettings settings = searchUICore.getSearchSettings();
searchUICore.updateSettings(settings.setRadiusLevel(settings.getRadiusLevel() + 1));
}
runCoreSearch(searchQuery, false, true);
}
@Override
public void onlineSearchOnClick() {
startOnlineSearch();
mainSearchFragment.getAdapter().clear();
updateTabbarVisibility(false);
runCoreSearch(searchQuery, false, true);
}
});
moreListItem.setInterruptedSearch(interruptedSearch);
moreListItem.setEmptySearch(isResultEmpty());
moreListItem.setOnlineSearch(isOnlineSearch());
moreListItem.setSearchMoreAvailable(searchMoreAvailable);
mainSearchFragment.addListItem(moreListItem);
}
}
Aggregations