Search in sources :

Example 1 with SearchHit

use of de.mfietz.fyydlin.SearchHit in project AntennaPod by AntennaPod.

the class FyydSearchFragment method processSearchResult.

void processSearchResult(FyydResponse response) {
    adapter.clear();
    if (!response.getData().isEmpty()) {
        adapter.clear();
        searchResults = new ArrayList<>();
        for (SearchHit searchHit : response.getData().values()) {
            Podcast podcast = Podcast.fromSearch(searchHit);
            searchResults.add(podcast);
        }
    } else {
        searchResults = emptyList();
    }
    for (Podcast podcast : searchResults) {
        adapter.add(podcast);
    }
    adapter.notifyDataSetInvalidated();
    gridView.setVisibility(!searchResults.isEmpty() ? View.VISIBLE : View.GONE);
    txtvEmpty.setVisibility(searchResults.isEmpty() ? View.VISIBLE : View.GONE);
}
Also used : SearchHit(de.mfietz.fyydlin.SearchHit) Podcast(de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast)

Aggregations

Podcast (de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast)1 SearchHit (de.mfietz.fyydlin.SearchHit)1