Search in sources :

Example 1 with FooterMarginItemDecoration

use of org.wikipedia.views.FooterMarginItemDecoration in project apps-android-wikipedia by wikimedia.

the class EditTasksFragment method setUpRecyclerView.

private void setUpRecyclerView() {
    tasksRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
    final int topDecorationDp = 16;
    tasksRecyclerView.addItemDecoration(new HeaderMarginItemDecoration(topDecorationDp, 0));
    tasksRecyclerView.addItemDecoration(new FooterMarginItemDecoration(0, topDecorationDp));
    setUpTasks();
    RecyclerAdapter adapter = new RecyclerAdapter(tasks);
    tasksRecyclerView.setAdapter(adapter);
}
Also used : HeaderMarginItemDecoration(org.wikipedia.views.HeaderMarginItemDecoration) FooterMarginItemDecoration(org.wikipedia.views.FooterMarginItemDecoration) DefaultRecyclerAdapter(org.wikipedia.views.DefaultRecyclerAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 DefaultRecyclerAdapter (org.wikipedia.views.DefaultRecyclerAdapter)1 FooterMarginItemDecoration (org.wikipedia.views.FooterMarginItemDecoration)1 HeaderMarginItemDecoration (org.wikipedia.views.HeaderMarginItemDecoration)1