Search in sources :

Example 1 with NotesAdapter

use of com.gordonwong.materialsheetfab.sample.adapters.NotesAdapter in project material-sheet-fab by gowong.

the class NotesListFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(getLayoutResId(), container, false);
    // Setup list
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.notes_list);
    recyclerView.setLayoutManager(new StaggeredGridLayoutManager(getNumColumns(), StaggeredGridLayoutManager.VERTICAL));
    recyclerView.setAdapter(new NotesAdapter(getActivity(), getNumItems()));
    return view;
}
Also used : NotesAdapter(com.gordonwong.materialsheetfab.sample.adapters.NotesAdapter) RecyclerView(android.support.v7.widget.RecyclerView) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 RecyclerView (android.support.v7.widget.RecyclerView)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 View (android.view.View)1 NotesAdapter (com.gordonwong.materialsheetfab.sample.adapters.NotesAdapter)1