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());
}
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());
}
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());
}
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());
}
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();
}
Aggregations