Search in sources :

Example 16 with QueryContainerBuilder

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

the class MediaStaffRoleFragment 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_id, id).putVariable(KeyUtil.arg_page, getPresenter().getCurrentPage());
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.STAFF_ROLES_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 17 with QueryContainerBuilder

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

the class AiringListFragment 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_page, getPresenter().getCurrentPage());
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.MEDIA_LIST_BROWSE_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 18 with QueryContainerBuilder

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

the class UserSearchFragment 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_page, getPresenter().getCurrentPage()).putVariable(KeyUtil.arg_sort, KeyUtil.SEARCH_MATCH);
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.USER_SEARCH_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 19 with QueryContainerBuilder

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

the class CharacterSearchFragment 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_page, getPresenter().getCurrentPage()).putVariable(KeyUtil.arg_sort, KeyUtil.SEARCH_MATCH);
    getViewModel().getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
    getViewModel().requestData(KeyUtil.CHARACTER_SEARCH_REQ, getContext());
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder)

Example 20 with QueryContainerBuilder

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

the class ComposerWidget method startRequestData.

// TODO: 2018/03/25 Check how parameters are being passed
@SuppressLint("SwitchIntDef")
public void startRequestData() {
    if (binding.widgetFlipper.getDisplayedChild() == WidgetPresenter.CONTENT_STATE) {
        binding.widgetFlipper.showNext();
        QueryContainerBuilder queryContainer = GraphUtil.getDefaultQuery(false);
        switch(requestType) {
            case KeyUtil.MUT_SAVE_TEXT_FEED:
                if (feedList != null) {
                    feedList.setValue(binding.comment.getFormattedText());
                    queryContainer.putVariable(KeyUtil.arg_id, feedList.getId());
                }
                queryContainer.putVariable(KeyUtil.arg_text, binding.comment.getFormattedText());
                break;
            case KeyUtil.MUT_SAVE_FEED_REPLY:
                if (feedReply != null) {
                    feedReply.setText(binding.comment.getFormattedText());
                    queryContainer.putVariable(KeyUtil.arg_activityId, feedReply.getId());
                }
                queryContainer.putVariable(KeyUtil.arg_text, binding.comment.getFormattedText());
                break;
            case KeyUtil.MUT_SAVE_MESSAGE_FEED:
                if (feedList != null) {
                    feedList.setValue(binding.comment.getFormattedText());
                    queryContainer.putVariable(KeyUtil.arg_id, feedList.getId());
                }
                queryContainer.putVariable(KeyUtil.arg_recipientId, recipient.getId());
                queryContainer.putVariable(KeyUtil.arg_message, binding.comment.getFormattedText());
                break;
        }
        presenter.getParams().putParcelable(KeyUtil.arg_graph_params, queryContainer);
        presenter.requestData(requestType, getContext(), this);
    } else
        NotifyUtil.makeText(getContext(), R.string.busy_please_wait, Toast.LENGTH_SHORT).show();
}
Also used : QueryContainerBuilder(com.mxt.anitrend.model.entity.container.request.QueryContainerBuilder) SuppressLint(android.annotation.SuppressLint)

Aggregations

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