use of com.rideread.rideread.common.util.TitleBuilder 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();
}
use of com.rideread.rideread.common.util.TitleBuilder in project ride-read-android by Ride-Read.
the class CollectActivity method initView.
@Override
public void initView() {
new TitleBuilder(this).setTitleText("ζηζΆθ").IsBack(true).setLeftOnClickListener(v -> finish()).build();
mCollectList = new ArrayList<>();
mSwipeRefreshLayout.setOnRefreshListener(() -> {
mPages = 0;
loadCollects();
});
mRecycleView.setHasFixedSize(true);
mAdapter = new CollectAdapter(this, mCollectList);
mRecycleView.setAdapter(mAdapter);
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) {
loadCollects();
}
}
}
});
loadCollects();
}
Aggregations