Search in sources :

Example 1 with ShareAdapter

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

the class ShareActivity method load.

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

        @Override
        protected List<Share> doInBackground() throws Throwable {
            MusicService musicService = MusicServiceFactory.getMusicService(ShareActivity.this);
            boolean refresh = getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_REFRESH, false);
            return musicService.getShares(refresh, ShareActivity.this, this);
        }

        @Override
        protected void done(List<Share> result) {
            sharesListView.setAdapter(shareAdapter = new ShareAdapter(ShareActivity.this, result));
            emptyTextView.setVisibility(result.isEmpty() ? View.VISIBLE : View.GONE);
        }
    };
    task.execute();
}
Also used : TabActivityBackgroundTask(org.moire.ultrasonic.util.TabActivityBackgroundTask) MusicService(org.moire.ultrasonic.service.MusicService) List(java.util.List) ShareAdapter(org.moire.ultrasonic.view.ShareAdapter) Share(org.moire.ultrasonic.domain.Share)

Aggregations

List (java.util.List)1 Share (org.moire.ultrasonic.domain.Share)1 MusicService (org.moire.ultrasonic.service.MusicService)1 TabActivityBackgroundTask (org.moire.ultrasonic.util.TabActivityBackgroundTask)1 ShareAdapter (org.moire.ultrasonic.view.ShareAdapter)1