use of io.github.hidroh.materialistic.widget.ThreadPreviewRecyclerViewAdapter in project materialistic by hidroh.
the class ThreadPreviewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Item item = getIntent().getParcelableExtra(EXTRA_ITEM);
if (item == null) {
finish();
return;
}
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_thread_preview);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
//noinspection ConstantConditions
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_HOME_AS_UP);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new SnappyLinearLayoutManager(this, false));
recyclerView.addItemDecoration(new CommentItemDecoration(this));
recyclerView.setAdapter(new ThreadPreviewRecyclerViewAdapter(mItemManager, item));
mKeyDelegate.setScrollable(new KeyDelegate.RecyclerViewHelper(recyclerView, KeyDelegate.RecyclerViewHelper.SCROLL_ITEM), null);
}
Aggregations