use of com.zype.android.webapi.model.playlist.Playlist in project zype-android by zype.
the class PlaylistActivity method handleRetrievePlaylist.
@Subscribe
public void handleRetrievePlaylist(PlaylistEvent event) {
Logger.d("Activity handlePlaylistEvent size=" + event.getEventData().getModelData().getResponse().size());
Playlist data = event.getEventData().getModelData();
if (data.getResponse().size() > 0) {
if (mPlaylistList == null) {
mPlaylistList = new ArrayList<>();
}
mPlaylistList.addAll(data.getResponse());
// with platform in case some palylists were deleted
if (event.getEventData().getModelData().getPagination().getCurrent() == 1) {
DataHelper.deletePlaylistsByParentId(this.getContentResolver(), parentId);
}
int i = DataHelper.insertPlaylists(this.getContentResolver(), data.getResponse());
Logger.d("added " + i + " playlists");
} else {
mTvEmpty.setText(R.string.videos_empty);
}
}
use of com.zype.android.webapi.model.playlist.Playlist in project zype-android by zype.
the class PlaylistFragment method handleRetrievePlaylist.
@Subscribe
public void handleRetrievePlaylist(PlaylistEvent event) {
Logger.d("handlePlaylistEvent size=" + event.getEventData().getModelData().getResponse().size());
Playlist data = event.getEventData().getModelData();
if (data.getResponse().size() > 0) {
if (mPlaylistList == null) {
mPlaylistList = new ArrayList<>();
}
mPlaylistList.addAll(data.getResponse());
// with platform in case some palylists were deleted
if (event.getEventData().getModelData().getPagination().getCurrent() == 1) {
DataHelper.deletePlaylistsByParentId(getActivity().getContentResolver(), parentId);
}
int i = DataHelper.insertPlaylists(getActivity().getContentResolver(), data.getResponse());
Logger.d("added " + i + " playlists");
} else {
mTvEmpty.setText(R.string.videos_empty);
}
}