|
@@ -12,6 +12,7 @@ import com.bigkoo.pickerview.builder.TimePickerBuilder;
|
|
|
import com.bigkoo.pickerview.listener.CustomListener;
|
|
|
import com.bigkoo.pickerview.view.TimePickerView;
|
|
|
import com.chad.library.adapter.base.listener.OnLoadMoreListener;
|
|
|
+import com.cooleshow.base.constanst.Constanst;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
@@ -47,6 +48,7 @@ public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCom
|
|
|
private ReceivedCommentListAdapter mListAdapter;
|
|
|
private View mEmptyView;
|
|
|
private TextView mTvEmptyTip;
|
|
|
+ private boolean hasNext = true;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -85,27 +87,14 @@ public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCom
|
|
|
@Override
|
|
|
public void onLoadMore() {
|
|
|
//上拉加载
|
|
|
- currentPage++;
|
|
|
- queryComment(false);
|
|
|
+ if (hasNext) {
|
|
|
+ currentPage++;
|
|
|
+ queryComment(false);
|
|
|
+ } else {
|
|
|
+ mListAdapter.getLoadMoreModule().loadMoreEnd();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
- TextWatcher textWatcher = new TextWatcher() {
|
|
|
- @Override
|
|
|
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void afterTextChanged(Editable s) {
|
|
|
-
|
|
|
- }
|
|
|
- };
|
|
|
- viewBinding.etTargetName.addTextChangedListener(textWatcher);
|
|
|
}
|
|
|
|
|
|
private void reBuildFilter(Date date, String targetName) {
|
|
@@ -122,6 +111,10 @@ public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCom
|
|
|
queryComment(true);
|
|
|
}
|
|
|
|
|
|
+ private void checkHasNext(int dataSize) {
|
|
|
+ hasNext = dataSize >= Constanst.DEFAULT_DATA_SIZE;
|
|
|
+ }
|
|
|
+
|
|
|
private void queryComment(boolean isShowLoading) {
|
|
|
presenter.queryReceivedComment(isShowLoading, currentFilterDate, currentStudentName, currentPage);
|
|
|
}
|
|
@@ -209,6 +202,7 @@ public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCom
|
|
|
mListAdapter.getData().clear();
|
|
|
mListAdapter.notifyDataSetChanged();
|
|
|
if (commentListBean.rows != null && commentListBean.rows.size() > 0) {
|
|
|
+ checkHasNext(commentListBean.rows.size());
|
|
|
mListAdapter.setNewInstance(commentListBean.rows);
|
|
|
} else {
|
|
|
showEmptyView();
|
|
@@ -219,6 +213,7 @@ public class ReceivedCommentActivity extends BaseMVPActivity<ActivityReceivedCom
|
|
|
if (mListAdapter != null) {
|
|
|
if (commentListBean.rows != null && commentListBean.rows.size() > 0) {
|
|
|
mListAdapter.getLoadMoreModule().loadMoreComplete();
|
|
|
+ checkHasNext(commentListBean.rows.size());
|
|
|
mListAdapter.addData(commentListBean.rows);
|
|
|
} else {
|
|
|
mListAdapter.getLoadMoreModule().loadMoreEnd();
|