Search in sources :

Example 1 with PodcastsChannelsAdapter

use of org.moire.ultrasonic.view.PodcastsChannelsAdapter in project ultrasonic by ultrasonic.

the class PodcastsActivity method load.

private void load() {
    BackgroundTask<List<PodcastsChannel>> task = new TabActivityBackgroundTask<List<PodcastsChannel>>(this, true) {

        @Override
        protected List<PodcastsChannel> doInBackground() throws Throwable {
            MusicService musicService = MusicServiceFactory.getMusicService(PodcastsActivity.this);
            List<PodcastsChannel> channels = musicService.getPodcastsChannels(false, PodcastsActivity.this, this);
            /*	 TODO c'est quoi ce nettoyage de cache ?
				if (!Util.isOffline(PodcastsActivity.this))
					new CacheCleaner(PodcastsActivity.this, getDownloadService()).cleanPlaylists(playlists);
            */
            return channels;
        }

        @Override
        protected void done(List<PodcastsChannel> result) {
            channelItemsListView.setAdapter(new PodcastsChannelsAdapter(currentActivity, result));
            emptyTextView.setVisibility(result.isEmpty() ? View.VISIBLE : View.GONE);
        }
    };
    task.execute();
}
Also used : TabActivityBackgroundTask(org.moire.ultrasonic.util.TabActivityBackgroundTask) PodcastsChannelsAdapter(org.moire.ultrasonic.view.PodcastsChannelsAdapter) PodcastsChannel(org.moire.ultrasonic.domain.PodcastsChannel) MusicService(org.moire.ultrasonic.service.MusicService) List(java.util.List)

Aggregations

List (java.util.List)1 PodcastsChannel (org.moire.ultrasonic.domain.PodcastsChannel)1 MusicService (org.moire.ultrasonic.service.MusicService)1 TabActivityBackgroundTask (org.moire.ultrasonic.util.TabActivityBackgroundTask)1 PodcastsChannelsAdapter (org.moire.ultrasonic.view.PodcastsChannelsAdapter)1