Search in sources :

Example 1 with ZobjectTopPlaylistResponse

use of com.zype.fire.api.Model.ZobjectTopPlaylistResponse in project zype-firebuilder by zype.

the class ZypeApi method getZobjectTopPlayLists.

public ZobjectTopPlaylistResponse getZobjectTopPlayLists() {
    try {
        HashMap<String, String> params = new HashMap<>();
        params.put(APP_KEY, ZypeSettings.APP_KEY);
        Response response = apiImpl.getZobjectsForTopPlaylist(params).execute();
        if (response.isSuccessful()) {
            return (ZobjectTopPlaylistResponse) response.body();
        } else {
            return null;
        }
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}
Also used : Response(retrofit2.Response) VideoFavoritesResponse(com.zype.fire.api.Model.VideoFavoritesResponse) ChannelResponse(com.zype.fire.api.Model.ChannelResponse) DevicePinResponse(com.zype.fire.api.Model.DevicePinResponse) VideosResponse(com.zype.fire.api.Model.VideosResponse) AppResponse(com.zype.fire.api.Model.AppResponse) VideoResponse(com.zype.fire.api.Model.VideoResponse) VideoEntitlementsResponse(com.zype.fire.api.Model.VideoEntitlementsResponse) PlaylistsResponse(com.zype.fire.api.Model.PlaylistsResponse) ProgramResponse(com.zype.fire.api.Model.ProgramResponse) AccessTokenResponse(com.zype.fire.api.Model.AccessTokenResponse) ZobjectContentResponse(com.zype.fire.api.Model.ZobjectContentResponse) PlanResponse(com.zype.fire.api.Model.PlanResponse) PlaylistResponse(com.zype.fire.api.Model.PlaylistResponse) AccessTokenInfoResponse(com.zype.fire.api.Model.AccessTokenInfoResponse) ZobjectTopPlaylistResponse(com.zype.fire.api.Model.ZobjectTopPlaylistResponse) ConsumerResponse(com.zype.fire.api.Model.ConsumerResponse) HashMap(java.util.HashMap) IOException(java.io.IOException) ZobjectTopPlaylistResponse(com.zype.fire.api.Model.ZobjectTopPlaylistResponse)

Example 2 with ZobjectTopPlaylistResponse

use of com.zype.fire.api.Model.ZobjectTopPlaylistResponse in project zype-firebuilder by zype.

the class HeroSlider method loadContent.

public Observable<Boolean> loadContent() {
    return Observable.just(true).subscribeOn(Schedulers.io()).observeOn(Schedulers.io()).flatMap(s -> {
        ZobjectTopPlaylistResponse response = ZypeApi.getInstance().getZobjectTopPlayLists();
        if (response != null) {
            sliders.clear();
            sliders.addAll(response.zobjectContents);
            Collections.sort(sliders, (z1, z2) -> z1.priority < z2.priority ? -1 : 1);
        }
        return Observable.just(true);
    });
}
Also used : ZobjectTopPlaylistResponse(com.zype.fire.api.Model.ZobjectTopPlaylistResponse)

Example 3 with ZobjectTopPlaylistResponse

use of com.zype.fire.api.Model.ZobjectTopPlaylistResponse in project zype-firebuilder by zype.

the class ZypeApi method getZobjectAutoPlayHeroLists.

public ZobjectTopPlaylistResponse getZobjectAutoPlayHeroLists() {
    try {
        HashMap<String, String> params = new HashMap<>();
        params.put(APP_KEY, ZypeSettings.APP_KEY);
        Response response = apiImpl.getZobjectsForAutoPlayHero(params).execute();
        if (response.isSuccessful()) {
            return (ZobjectTopPlaylistResponse) response.body();
        } else {
            return null;
        }
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}
Also used : Response(retrofit2.Response) VideoFavoritesResponse(com.zype.fire.api.Model.VideoFavoritesResponse) ChannelResponse(com.zype.fire.api.Model.ChannelResponse) DevicePinResponse(com.zype.fire.api.Model.DevicePinResponse) VideosResponse(com.zype.fire.api.Model.VideosResponse) AppResponse(com.zype.fire.api.Model.AppResponse) VideoResponse(com.zype.fire.api.Model.VideoResponse) VideoEntitlementsResponse(com.zype.fire.api.Model.VideoEntitlementsResponse) PlaylistsResponse(com.zype.fire.api.Model.PlaylistsResponse) ProgramResponse(com.zype.fire.api.Model.ProgramResponse) AccessTokenResponse(com.zype.fire.api.Model.AccessTokenResponse) ZobjectContentResponse(com.zype.fire.api.Model.ZobjectContentResponse) PlanResponse(com.zype.fire.api.Model.PlanResponse) PlaylistResponse(com.zype.fire.api.Model.PlaylistResponse) AccessTokenInfoResponse(com.zype.fire.api.Model.AccessTokenInfoResponse) ZobjectTopPlaylistResponse(com.zype.fire.api.Model.ZobjectTopPlaylistResponse) ConsumerResponse(com.zype.fire.api.Model.ConsumerResponse) HashMap(java.util.HashMap) IOException(java.io.IOException) ZobjectTopPlaylistResponse(com.zype.fire.api.Model.ZobjectTopPlaylistResponse)

Aggregations

ZobjectTopPlaylistResponse (com.zype.fire.api.Model.ZobjectTopPlaylistResponse)3 AccessTokenInfoResponse (com.zype.fire.api.Model.AccessTokenInfoResponse)2 AccessTokenResponse (com.zype.fire.api.Model.AccessTokenResponse)2 AppResponse (com.zype.fire.api.Model.AppResponse)2 ChannelResponse (com.zype.fire.api.Model.ChannelResponse)2 ConsumerResponse (com.zype.fire.api.Model.ConsumerResponse)2 DevicePinResponse (com.zype.fire.api.Model.DevicePinResponse)2 PlanResponse (com.zype.fire.api.Model.PlanResponse)2 PlaylistResponse (com.zype.fire.api.Model.PlaylistResponse)2 PlaylistsResponse (com.zype.fire.api.Model.PlaylistsResponse)2 ProgramResponse (com.zype.fire.api.Model.ProgramResponse)2 VideoEntitlementsResponse (com.zype.fire.api.Model.VideoEntitlementsResponse)2 VideoFavoritesResponse (com.zype.fire.api.Model.VideoFavoritesResponse)2 VideoResponse (com.zype.fire.api.Model.VideoResponse)2 VideosResponse (com.zype.fire.api.Model.VideosResponse)2 ZobjectContentResponse (com.zype.fire.api.Model.ZobjectContentResponse)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 Response (retrofit2.Response)2