use of com.itculturalfestival.smartcampus.utils.FullyGridLayoutManager in project SmartCampus by Vegen.
the class NewsFragment method setupUI.
@Override
protected void setupUI() {
Bundle bundle = getArguments();
newsType = bundle.getInt("newsType", Constant.NEWS_TYPE_FLASH);
showContentView();
homeNewsAdapter = new HomeNewsAdapter();
homeNewsAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
GridLayoutManager layoutManage = new FullyGridLayoutManager(getContext(), 2);
recyclerView.setLayoutManager(layoutManage);
recyclerView.setAdapter(homeNewsAdapter);
recyclerView.addItemDecoration(new GridItemDecoration());
View emptyView = View.inflate(getContext(), R.layout.app_view_empty, null);
homeNewsAdapter.setEmptyView(emptyView);
View footerView = LayoutInflater.from(getActivity()).inflate(R.layout.app_footer_home_news, (ViewGroup) root, false);
homeNewsAdapter.setFooterView(footerView);
tvFooter = footerView.findViewById(R.id.tv_footer);
if (tvFooter != null) {
tvFooter.setOnClickListener(v -> {
MoreNewsActivity.start(getContext(), newsType, nextUrl);
});
}
}
Aggregations