/** {@inheritDoc} */ @Override public void remove(final int which) { mSong = mAdapter.getItem(which); mAdapter.remove(mSong); mAdapter.notifyDataSetChanged(); MusicUtils.removeTrack(mSong.mSongId); // Build the cache mAdapter.buildCache(); }
/** {@inheritDoc} */ @Override public void drop(final int from, final int to) { mSong = mAdapter.getItem(from); mAdapter.remove(mSong); mAdapter.insert(mSong, to); mAdapter.notifyDataSetChanged(); MusicUtils.moveQueueItem(from, to); // Build the cache mAdapter.buildCache(); }
/** {@inheritDoc} */ @Override public void onLoadFinished(final Loader<List<Song>> loader, final List<Song> data) { // Check for any errors if (data.isEmpty()) { return; } // Start fresh mAdapter.unload(); // Add the data to the adpater for (final Song song : data) { mAdapter.add(song); } // Build the cache mAdapter.buildCache(); }