@Override protected boolean handleResult( com.m.ui.fragment.ARefreshFragment.RefreshMode mode, List<StatusComment> datas) { // 如果是重置或者刷新数据,加载数据大于分页大小,则清空之前的数据 if (mode == RefreshMode.refresh) // 目前微博加载分页大小是默认大小 if (datas.size() >= AppSettings.getCommentCount()) { setAdapterItems(new ArrayList<StatusComment>()); } return super.handleResult(mode, datas); }
@Override protected StatusComments workInBackground( RefreshMode mode, String previousPage, String nextPage, Void... params) throws TaskException { String sinceId = null; String maxId = null; String filterByAuthor = null; if (mode == RefreshMode.refresh && !TextUtils.isEmpty(previousPage)) sinceId = previousPage; if (mode == RefreshMode.update && !TextUtils.isEmpty(nextPage)) maxId = nextPage; if ("103".equals(mGroupBean.getGroup())) filterByAuthor = "0"; else filterByAuthor = "1"; return SinaSDK.getInstance(AppContext.getToken(), getTaskCacheMode(this)) .commentsMentions( sinceId, maxId, filterByAuthor, String.valueOf(AppSettings.getCommentCount())); }