use of org.videolan.medialibrary.media.SearchAggregate in project vlc-android by videolan.
the class SearchFragment method loadRows.
private void loadRows(String query) {
final SearchAggregate searchAggregate = VLCApplication.getMLInstance().search(query);
CardPresenter cp = new CardPresenter(mActivity);
final ArrayObjectAdapter videoAdapter = new ArrayObjectAdapter(cp);
videoAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getOthers()));
final ArrayObjectAdapter episodesAdapter = new ArrayObjectAdapter(cp);
episodesAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getEpisodes()));
final ArrayObjectAdapter moviesAdapter = new ArrayObjectAdapter(cp);
moviesAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getMovies()));
final ArrayObjectAdapter songsAdapter = new ArrayObjectAdapter(cp);
songsAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getTracks()));
final ArrayObjectAdapter artistsAdapter = new ArrayObjectAdapter(cp);
artistsAdapter.addAll(0, Arrays.asList(searchAggregate.getArtists()));
final ArrayObjectAdapter albumsAdapter = new ArrayObjectAdapter(cp);
albumsAdapter.addAll(0, Arrays.asList(searchAggregate.getAlbums()));
final ArrayObjectAdapter genresAdapter = new ArrayObjectAdapter(cp);
genresAdapter.addAll(0, Arrays.asList(searchAggregate.getGenres()));
mHandler.post(new Runnable() {
@Override
public void run() {
if (videoAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.videos)), videoAdapter));
if (episodesAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.episodes)), episodesAdapter));
if (moviesAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.movies)), moviesAdapter));
if (songsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.songs)), songsAdapter));
if (artistsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.artists)), artistsAdapter));
if (albumsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.albums)), albumsAdapter));
if (genresAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.genres)), genresAdapter));
}
});
}
use of org.videolan.medialibrary.media.SearchAggregate in project vlc-android by videolan.
the class SearchActivity method clear.
private void clear() {
mBinding.searchEditText.removeTextChangedListener(this);
mBinding.searchEditText.setText("");
mBinding.searchEditText.addTextChangedListener(this);
mBinding.setSearchAggregate(new SearchAggregate());
}
use of org.videolan.medialibrary.media.SearchAggregate in project vlc-android by GeoffreyMetais.
the class SearchActivity method clear.
private void clear() {
mBinding.searchEditText.removeTextChangedListener(this);
mBinding.searchEditText.setText("");
mBinding.searchEditText.addTextChangedListener(this);
mBinding.setSearchAggregate(new SearchAggregate());
}
use of org.videolan.medialibrary.media.SearchAggregate in project vlc-android by GeoffreyMetais.
the class SearchFragment method loadRows.
private void loadRows(String query) {
final SearchAggregate searchAggregate = VLCApplication.getMLInstance().search(query);
CardPresenter cp = new CardPresenter(mActivity);
final ArrayObjectAdapter videoAdapter = new ArrayObjectAdapter(cp);
videoAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getOthers()));
final ArrayObjectAdapter episodesAdapter = new ArrayObjectAdapter(cp);
episodesAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getEpisodes()));
final ArrayObjectAdapter moviesAdapter = new ArrayObjectAdapter(cp);
moviesAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getMovies()));
final ArrayObjectAdapter songsAdapter = new ArrayObjectAdapter(cp);
songsAdapter.addAll(0, Arrays.asList(searchAggregate.getMediaSearchAggregate().getTracks()));
final ArrayObjectAdapter artistsAdapter = new ArrayObjectAdapter(cp);
artistsAdapter.addAll(0, Arrays.asList(searchAggregate.getArtists()));
final ArrayObjectAdapter albumsAdapter = new ArrayObjectAdapter(cp);
albumsAdapter.addAll(0, Arrays.asList(searchAggregate.getAlbums()));
final ArrayObjectAdapter genresAdapter = new ArrayObjectAdapter(cp);
genresAdapter.addAll(0, Arrays.asList(searchAggregate.getGenres()));
mHandler.post(new Runnable() {
@Override
public void run() {
if (videoAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.videos)), videoAdapter));
if (episodesAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.episodes)), episodesAdapter));
if (moviesAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.movies)), moviesAdapter));
if (songsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.songs)), songsAdapter));
if (artistsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.artists)), artistsAdapter));
if (albumsAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.albums)), albumsAdapter));
if (genresAdapter.size() > 0)
mRowsAdapter.add(new ListRow(new HeaderItem(0, getResources().getString(R.string.genres)), genresAdapter));
}
});
}
Aggregations