Search in sources :

Example 1 with VideoList

use of com.zype.android.webapi.model.video.VideoList in project zype-android by zype.

the class FavoritesFragment method handleRetrieveVideo.

@Subscribe
public void handleRetrieveVideo(VideoListEvent event) {
    Logger.d("handleRetrieveVideo(): size=" + event.getEventData().getModelData().getVideoData().size());
    VideoList data = event.getEventData().getModelData();
    if (data.getVideoData().size() > 0) {
        for (VideoData item : data.getVideoData()) {
            if (!TextUtils.isEmpty(DataHelper.getFavoriteId(getActivity().getContentResolver(), item.getId()))) {
                List<VideoData> videos = new ArrayList<>();
                videos.add(item);
                DataHelper.insertVideos(getActivity().getContentResolver(), videos);
                DataHelper.setFavoriteVideo(getActivity().getContentResolver(), item.getId(), true);
            }
        }
    }
}
Also used : VideoList(com.zype.android.webapi.model.video.VideoList) VideoData(com.zype.android.webapi.model.video.VideoData) ConsumerFavoriteVideoData(com.zype.android.webapi.model.consumers.ConsumerFavoriteVideoData) ArrayList(java.util.ArrayList) Subscribe(com.squareup.otto.Subscribe)

Aggregations

Subscribe (com.squareup.otto.Subscribe)1 ConsumerFavoriteVideoData (com.zype.android.webapi.model.consumers.ConsumerFavoriteVideoData)1 VideoData (com.zype.android.webapi.model.video.VideoData)1 VideoList (com.zype.android.webapi.model.video.VideoList)1 ArrayList (java.util.ArrayList)1