use of com.rideread.rideread.common.adapter.ThumbsUpUserAdapter in project ride-read-android by Ride-Read.
the class ThumbsUpUserActivity method initView.
@Override
public void initView() {
mMid = getIntent().getIntExtra(MOMENT_ID, 0);
new TitleBuilder(this).setTitleText(R.string.thumbs_up_user).IsBack(true).setRightImage(R.drawable.icon_search).build();
mUserList = new ArrayList<>();
mSwipeRefreshLayout.setOnRefreshListener(() -> {
mPages = 0;
loadUsers();
});
mRecycleView.setHasFixedSize(true);
mUserAdapter = new ThumbsUpUserAdapter(this, mUserList);
mRecycleView.setAdapter(mUserAdapter);
mLayoutManager = new LinearLayoutManager(this);
mRecycleView.setLayoutManager(mLayoutManager);
mRecycleView.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int lastVisibleItem = mLayoutManager.findLastVisibleItemPosition();
int totalItemCount = mLayoutManager.getItemCount();
if (lastVisibleItem >= totalItemCount - 1 && dy > 0) {
if (!isLoadingMore) {
loadUsers();
}
}
}
});
loadUsers();
}
Aggregations