Search in sources :

Example 11 with SearchResultCollection

use of net.osmand.search.SearchUICore.SearchResultCollection in project Osmand by osmandapp.

the class QuickSearchDialogFragment method reloadCategories.

public void reloadCategories() {
    try {
        SearchResultCollection res = searchUICore.shallowSearch(SearchAmenityTypesAPI.class, "", null);
        if (res != null) {
            List<QuickSearchListItem> rows = new ArrayList<>();
            for (SearchResult sr : res.getCurrentSearchResults()) {
                rows.add(new QuickSearchListItem(app, sr));
            }
            categoriesSearchFragment.updateListAdapter(rows, false);
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ArrayList(java.util.ArrayList) SearchResultCollection(net.osmand.search.SearchUICore.SearchResultCollection) SearchResult(net.osmand.search.core.SearchResult) IOException(java.io.IOException)

Aggregations

SearchResultCollection (net.osmand.search.SearchUICore.SearchResultCollection)11 SearchResult (net.osmand.search.core.SearchResult)9 ArrayList (java.util.ArrayList)8 LatLon (net.osmand.data.LatLon)7 SearchPhrase (net.osmand.search.core.SearchPhrase)6 SearchSettings (net.osmand.search.core.SearchSettings)6 IOException (java.io.IOException)3 QuickSearchListItem (net.osmand.plus.search.listitems.QuickSearchListItem)3 Test (org.junit.Test)3 SpannableString (android.text.SpannableString)2 View (android.view.View)2 OnClickListener (android.view.View.OnClickListener)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 Point (java.awt.Point)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 List (java.util.List)2