Search in sources :

Example 1 with TodoListRecyclerAdapter

use of com.instructure.candroid.adapter.TodoListRecyclerAdapter in project instructure-android by instructure.

the class ToDoListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mRootView = getLayoutInflater().inflate(R.layout.fragment_list_todo, container, false);
    mToolbar = mRootView.findViewById(R.id.toolbar);
    mAdapterToFragmentCallback = new NotificationAdapterToFragmentCallback<ToDo>() {

        @Override
        public void onRowClicked(ToDo todo, int position, boolean isOpenDetail) {
            mRecyclerAdapter.setSelectedPosition(position);
            onRowClick(todo);
        }

        @Override
        public void onRefreshFinished() {
            setRefreshing(false);
            mEditOptions.setVisibility(View.GONE);
        }

        @Override
        public void onShowEditView(boolean isVisible) {
            mEditOptions.setVisibility(isVisible ? View.VISIBLE : View.GONE);
        }

        @Override
        public void onShowErrorCrouton(int message) {
        // do nothing
        }
    };
    mRecyclerAdapter = new TodoListRecyclerAdapter(getContext(), getCanvasContext(), mAdapterToFragmentCallback);
    configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
    PandaRecyclerView pandaRecyclerView = mRootView.findViewById(R.id.listView);
    pandaRecyclerView.setSelectionEnabled(false);
    configureViews(mRootView);
    return mRootView;
}
Also used : ToDo(com.instructure.canvasapi2.models.ToDo) PandaRecyclerView(com.instructure.pandarecycler.PandaRecyclerView) TodoListRecyclerAdapter(com.instructure.candroid.adapter.TodoListRecyclerAdapter)

Aggregations

TodoListRecyclerAdapter (com.instructure.candroid.adapter.TodoListRecyclerAdapter)1 ToDo (com.instructure.canvasapi2.models.ToDo)1 PandaRecyclerView (com.instructure.pandarecycler.PandaRecyclerView)1