use of com.google.samples.apps.iosched.schedule.DividerDecoration in project iosched by google.
the class MyIOFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mLoadingSwitcher = (ViewSwitcher) view.findViewById(R.id.loading_switcher);
mLoadingView = (LottieAnimationView) view.findViewById(R.id.loading_anim);
mRecyclerView = (RecyclerView) view.findViewById(android.R.id.list);
mRecyclerView.addItemDecoration(new DividerDecoration(getContext()));
mAdapter = new MyIOAdapter(getContext(), this);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new StickyHeadersLinearLayoutManager<MyIOAdapter>(getContext()));
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
mScrolled = true;
recyclerView.removeOnScrollListener(this);
}
});
View header = view.findViewById(R.id.header_anim);
if (header instanceof ImageView) {
AnimatedVectorDrawable avd = (AnimatedVectorDrawable) ContextCompat.getDrawable(getContext(), R.drawable.avd_header_my_io);
((ImageView) header).setImageDrawable(avd);
avd.start();
}
}
Aggregations