use of com.jakewharton.u2020.ui.misc.DividerItemDecoration in project u2020 by JakeWharton.
the class TrendingView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
ButterKnife.bind(this);
AnimationDrawable ellipsis = (AnimationDrawable) ContextCompat.getDrawable(getContext(), R.drawable.dancing_ellipsis);
loadingMessageView.setCompoundDrawablesWithIntrinsicBounds(null, null, ellipsis, null);
ellipsis.start();
toolbarView.setNavigationIcon(R.drawable.menu_icon);
toolbarView.setNavigationOnClickListener(v -> drawerLayout.openDrawer(GravityCompat.START));
timespanView.setAdapter(timespanAdapter);
timespanView.setSelection(TrendingTimespan.WEEK.ordinal());
swipeRefreshView.setColorSchemeResources(R.color.accent);
swipeRefreshView.setOnRefreshListener(this);
trendingAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
animatorView.setDisplayedChildId(//
trendingAdapter.getItemCount() == 0 ? //
R.id.trending_empty : R.id.trending_swipe_refresh);
swipeRefreshView.setRefreshing(false);
}
});
trendingView.setLayoutManager(new LinearLayoutManager(getContext()));
trendingView.addItemDecoration(new DividerItemDecoration(getContext(), VERTICAL_LIST, dividerPaddingStart, safeIsRtl()));
trendingView.setAdapter(trendingAdapter);
}
Aggregations