use of com.instructure.speedgrader.interfaces.RubricAdapterToFragmentCallback in project instructure-android by instructure.
the class RubricFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
if (savedInstanceState != null) {
getBundleDataWithCache(savedInstanceState);
}
this.currentAttempt = this.mSubmission.getAttempt();
mRecyclerAdapter = new RubricRecyclerAdapter(getContext(), getCanvasContext(), mAssignment, mSubmission, mSubmissionListener, new RubricAdapterToFragmentCallback() {
@Override
public void onFreeFormRowClicked(RubricCriterionRating rating, int position) {
}
@Override
public void onRowClicked(RubricCriterionRating rubricCriterionRating) {
}
@Override
public void onRowClicked(RubricCriterionRating rubricCriterionRating, int position) {
if (mAssignment.isFreeFormCriterionComments()) {
return;
}
mRecyclerAdapter.updateRubricAssessment(rubricCriterionRating);
}
@Override
public void onCommentRowClicked(RubricCriterionRating rating, int position) {
commentDialog = new RubricCommentDialog();
commentDialog.setArguments(RubricCommentDialog.createBundle(mRecyclerAdapter.getGroup((long) rating.getCriterionId().hashCode()), rating, position, mAssignment.isFreeFormCriterionComments()));
commentDialog.setTargetFragment(RubricFragment.this, 123);
commentDialog.show(getChildFragmentManager(), EditAssignmentDialog.TAG);
}
@Override
public void onRefreshFinished() {
setRefreshing(false);
}
});
configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
PandaRecyclerView pandaRecyclerView = (PandaRecyclerView) mRootView.findViewById(R.id.listView);
pandaRecyclerView.addItemDecoration(new RubricDecorator(getContext()));
return mRootView;
}
Aggregations