Search in sources :

Example 26 with QueryContainerBuilder

use of com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder in project anitrend-app by AniTrend.

the class CharacterFavouriteFragment method makeRequest.

@Override
public void makeRequest() {
    QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(isPager).putVariable(KeyUtil.arg_id, userId).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage());
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.USER_CHARACTER_FAVOURITES_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 27 with QueryContainerBuilder

use of com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder in project anitrend-app by AniTrend.

the class StudioActivity method makeRequest.

@Override
protected void makeRequest() {
    QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(false).putVariable(KeyUtil.arg_id, id);
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.STUDIO_BASE_REQ, getApplicationContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 28 with QueryContainerBuilder

use of com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder in project anitrend-app by AniTrend.

the class MediaTrendListFragment method makeRequest.

@Override
public void makeRequest() {
    Bundle bundle = getViewModel().getParams();
    QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(isPager).putVariable(KeyUtil.arg_sort, getPresenter().getApplicationPref().getMediaTrendSort()).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage());
    bundle.putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_TREND_REQ, getContext());
}
Also used : Bundle(android.os.Bundle) QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 29 with QueryContainerBuilder

use of com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder in project anitrend-app by AniTrend.

the class WatchListFragment method makeRequest.

/**
 * All new or updated network requests should be handled in this method
 */
@Override
public void makeRequest() {
    if (externalLinks != null) {
        boolean feed = targetLink != null && targetLink.startsWith(BuildConfig.FEEDS_LINK);
        Bundle bundle = getViewModel().getParams();
        bundle.putString(KeyUtil.arg_search, targetLink);
        bundle.putBoolean(KeyUtil.arg_feed, feed);
        getViewModel().requestData(getRequestMode(feed), getContext());
    } else {
        QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(false).putVariable(KeyUtil.arg_id, mediaId).putVariable(KeyUtil.arg_type, mediaType);
        getPresenter().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
        getPresenter().requestData(KeyUtil.MEDIA_EPISODES_REQ, getContext(), this);
    }
}
Also used : Bundle(android.os.Bundle) QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 30 with QueryContainerBuilder

use of com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder in project anitrend-app by AniTrend.

the class MediaSearchFragment method makeRequest.

/**
 * All new or updated network requests should be handled in this method
 */
@Override
public void makeRequest() {
    QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(isPager).putVariable(KeyUtil.arg_search, searchQuery).putVariable(KeyUtil.arg_mediaType, mediaType).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage()).putVariable(KeyUtil.arg_sort, KeyUtil.SEARCH_MATCH);
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_SEARCH_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Aggregations

QueryContainerBuilder (com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)37 Bundle (android.os.Bundle)4 SuppressLint (android.annotation.SuppressLint)1