| | |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.text.TextUtils; |
| | | import android.view.MotionEvent; |
| | | import android.view.View; |
| | | import android.widget.TextView; |
| | | |
| | |
| | | |
| | | } |
| | | }); |
| | | |
| | | viewBinding.messageNascentRecyclerview.addOnScrollListener(new RecyclerView.OnScrollListener() { |
| | | @Override |
| | | public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { |
| | | super.onScrolled(recyclerView, dx, dy); |
| | | |
| | | // if (dy <= 0) { |
| | | // //等于0是顶部 |
| | | // return; |
| | | // } |
| | | // LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); |
| | | // assert layoutManager != null; |
| | | // // 只有垂直布局才会触发上拉事件 |
| | | // if (!layoutManager.canScrollVertically()) { |
| | | // return; |
| | | // } |
| | | // |
| | | // int totalItemCount = layoutManager.getItemCount(); |
| | | // int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition(); |
| | | // |
| | | // if (!isLoadingMore && totalItemCount <= (lastVisibleItemPosition + visibleThreshold)) { |
| | | // loadNextPage(); |
| | | //// loadNextPage(); |
| | | // } |
| | | } |
| | | }); |
| | |
| | | if (list != null && list.size() != 0) { |
| | | mList.addAll(list); |
| | | updateListData(); |
| | | } else { |
| | | nullDataUpdateUi(); |
| | | } |
| | | } |
| | | }); |
| | |
| | | textView.setVisibility(View.VISIBLE); |
| | | textView.setText(unreadCount); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |