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();
}
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;
}
Aggregations