Search in sources :

Example 1 with SubmissionsAdapter

use of com.instructure.speedgrader.adapters.SubmissionsAdapter in project instructure-android by instructure.

the class RubricHeaderViewHolder method populateSubmissions.

private void populateSubmissions(ArrayList<Submission> submissionList) {
    // Canvas API sometimes returns fake submissions. Filter these out.
    SubmissionsAdapter submissionAdapter = new SubmissionsAdapter(mContext, R.layout.rubric_spinner_item, submissionList);
    submissionSpinner.setAdapter(submissionAdapter);
    setSpinnerSelectionByAttempt(currentAttempt);
}
Also used : SubmissionsAdapter(com.instructure.speedgrader.adapters.SubmissionsAdapter)

Example 2 with SubmissionsAdapter

use of com.instructure.speedgrader.adapters.SubmissionsAdapter in project instructure-android by instructure.

the class RubricHeaderViewHolder method getVersionSelectListener.

private AdapterView.OnItemSelectedListener getVersionSelectListener() {
    return new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            Submission submission = ((SubmissionsAdapter) submissionSpinner.getAdapter()).getItem(position);
            if (mSubmission.getAttempt() != submission.getAttempt()) {
                mSubmission = submission;
                currentAttempt = submission.getAttempt();
                mSubmissionListener.onSubmissionSelected(submission);
                populateAttachments(submission.getAttachments());
            }
        }

        @Override
        public void onNothingSelected(AdapterView<?> parent) {
        }
    };
}
Also used : Submission(com.instructure.canvasapi.model.Submission) SubmissionsAdapter(com.instructure.speedgrader.adapters.SubmissionsAdapter) AdapterView(android.widget.AdapterView) HelveticaTextView(com.instructure.speedgrader.views.HelveticaTextView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

SubmissionsAdapter (com.instructure.speedgrader.adapters.SubmissionsAdapter)2 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 TextView (android.widget.TextView)1 Submission (com.instructure.canvasapi.model.Submission)1 HelveticaTextView (com.instructure.speedgrader.views.HelveticaTextView)1