Search in sources :

Example 81 with CanvasContext

use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.

the class PeopleListPresenter method setCanvasContextList.

public void setCanvasContextList(ArrayList<CanvasContext> canvasContextList) {
    mCanvasContextList.clear();
    mGroupUserCallback.reset();
    clearData();
    for (CanvasContext canvasContext : canvasContextList) {
        if (CanvasContext.Type.isGroup(canvasContext)) {
            // make api call to get group members
            getGroupUsers(canvasContext);
        }
        // add it to the list so we can search for sections and remember which contexts we have selected if the user re-opens the dialog
        mCanvasContextList.add(canvasContext);
    }
    // we've made api calls to get the groups, now filter the rest
    filterCanvasContexts();
}
Also used : CanvasContext(com.instructure.canvasapi2.models.CanvasContext)

Example 82 with CanvasContext

use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.

the class CanvasContextSpinnerAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final CanvasContextViewHolder viewHolder;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.canvas_context_spinner_adapter_item, parent, false);
        viewHolder = new CanvasContextViewHolder();
        viewHolder.title = (TextView) convertView.findViewById(R.id.title);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (CanvasContextViewHolder) convertView.getTag();
    }
    CanvasContext item = mData.get(position);
    if (item != null) {
        viewHolder.title.setText(item.getName());
    } else {
        viewHolder.title.setText("");
    }
    return convertView;
}
Also used : CanvasContext(com.instructure.canvasapi2.models.CanvasContext)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)60 RestParams (com.instructure.canvasapi2.builders.RestParams)55 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)19 StatusCallback (com.instructure.canvasapi2.StatusCallback)8 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)7 List (java.util.List)7 ApiType (com.instructure.canvasapi2.utils.ApiType)6 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)6 DiscussionTopicHeader (com.instructure.canvasapi2.models.DiscussionTopicHeader)5 FileFolder (com.instructure.canvasapi2.models.FileFolder)5 ArrayList (java.util.ArrayList)5 NotNull (org.jetbrains.annotations.NotNull)5 NonNull (android.support.annotation.NonNull)4 View (android.view.View)4 TextView (android.widget.TextView)4 UpdateFileFolder (com.instructure.canvasapi2.models.UpdateFileFolder)4 Bundle (android.os.Bundle)3 ImageView (android.widget.ImageView)3 BindView (butterknife.BindView)3 Course (com.instructure.canvasapi2.models.Course)3