use of com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration in project BBS-Android by bdpqchen.
the class LatestPostFragment method initFragment.
@Override
protected void initFragment() {
latestPostAdapter = new LatestPostAdapter(getActivity());
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
recyclerview.setLayoutManager(linearLayoutManager);
mPresenter.refreshAnnounce();
recyclerview.setAdapter(latestPostAdapter);
recyclerview.addItemDecoration(new RecyclerViewItemDecoration(5));
layoutSwipeRefresh.setColorSchemeColors(getResources().getIntArray(R.array.swipeRefreshColors));
layoutSwipeRefresh.setOnRefreshListener(() -> {
mPresenter.refreshAnnounce();
layoutSwipeRefresh.setRefreshing(false);
});
}
use of com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration in project BBS-Android by bdpqchen.
the class MessageActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSlideBackLayout.lock(!PrefUtil.isSlideBackMode());
mAdapter = new MessageAdapter(this);
rvMessageList.setAdapter(mAdapter);
rvMessageList.setLayoutManager(new LinearLayoutManager(this));
rvMessageList.addItemDecoration(new RecyclerViewItemDecoration(10));
mPresenter.getMessageList(0);
setRefreshing(true);
mSrlMessage.setOnRefreshListener(() -> {
mPresenter.getMessageList(0);
mRefreshing = true;
});
}
use of com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration in project BBS-Android by bdpqchen.
the class BoardsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
mForumId = getIntent().getIntExtra(INTENT_FORUM_ID, 0);
mForumTitle = getIntent().getStringExtra(INTENT_FORUM_TITLE);
super.onCreate(savedInstanceState);
mContext = this;
mAdapter = new BoardsAdapter(mContext);
mLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
mRvBoardList.addItemDecoration(new RecyclerViewItemDecoration(16));
mRvBoardList.setLayoutManager(mLayoutManager);
mRvBoardList.setAdapter(mAdapter);
mSrlBoardList.setColorSchemeColors(getResources().getIntArray(R.array.swipeRefreshColors));
mSrlBoardList.setOnRefreshListener(() -> {
mRefreshing = true;
mPresenter.getBoardList(mForumId);
});
mFab.setOnClickListener(v -> {
Intent intent = new Intent(this, CreateThreadActivity.class);
intent.putStringArrayListExtra(INTENT_BOARD_NAMES, getBoardNames());
intent.putIntegerArrayListExtra(INTENT_BOARD_IDS, getBoardIds());
startActivity(intent);
});
mBoardIds.add(0);
mBoardNames.add(".....");
mPresenter.getBoardList(mForumId);
}
use of com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration in project BBS-Android by bdpqchen.
the class MyReleaseFragment method initFragment.
@Override
protected void initFragment() {
myRecyclerAdapter = new MyRecyclerAdapter(getActivity(), data);
layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
rv.setHasFixedSize(true);
rv.setLayoutManager(layoutManager);
rv.setAdapter(myRecyclerAdapter);
srl.setOnRefreshListener(this);
srl.setColorSchemeColors(getResources().getIntArray(R.array.swipeRefreshColors));
eros = new EndlessRecyclerOnScrollListener(layoutManager) {
@Override
public void onLoadMore() {
mPresenter.getMyReleaseList();
}
};
rv.addOnScrollListener(eros);
mPresenter.initMyReleaseList();
rv.addItemDecoration(new RecyclerViewItemDecoration(5));
}
Aggregations