use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class CanvasContextSpinnerAdapter method getDropDownView.
@Override
public View getDropDownView(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);
viewHolder.indicator = (ImageView) convertView.findViewById(R.id.icon);
convertView.setTag(viewHolder);
} else {
viewHolder = (CanvasContextViewHolder) convertView.getTag();
}
CanvasContext item = mData.get(position);
if (item != null) {
viewHolder.title.setText(item.getName());
if (item.getId() == GROUP_SEPARATOR || item.getId() == COURSE_SEPARATOR) {
viewHolder.title.setTypeface(null, Typeface.BOLD);
viewHolder.indicator.setVisibility(View.GONE);
} else {
viewHolder.title.setTypeface(null, Typeface.NORMAL);
viewHolder.indicator.setVisibility(View.VISIBLE);
viewHolder.indicator.setBackground(BaseBinder.createIndicatorBackground(ColorKeeper.getOrGenerateColor(item)));
}
}
return convertView;
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class AssignmentManager method getFirstPageAssignments.
public static void getFirstPageAssignments(CanvasContext canvasContext, final boolean forceNetwork, StatusCallback<List<Assignment>> callback) {
if (isTesting() || mTesting) {
} else {
final RestBuilder adapter = new RestBuilder(callback);
AssignmentAPI.getFirstPageAssignments(canvasContext.getId(), forceNetwork, adapter, callback);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class DiscussionManager method replyToDiscussionEntry.
public static void replyToDiscussionEntry(CanvasContext canvasContext, long topicId, long entryId, String message, File attachment, String mimeType, StatusCallback<DiscussionEntry> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().build();
DiscussionAPI.replyToDiscussionEntryWithAttachment(adapter, canvasContext, topicId, entryId, message, attachment, mimeType, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class DiscussionManager method getFullDiscussionTopic.
public static void getFullDiscussionTopic(CanvasContext canvasContext, long topicId, boolean forceNetwork, StatusCallback<DiscussionTopic> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
DiscussionAPI.getFullDiscussionTopic(adapter, canvasContext, topicId, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class DiscussionManager method getFilteredDiscussionTopic.
public static void getFilteredDiscussionTopic(final boolean forceNetwork, @NonNull CanvasContext canvasContext, @NonNull String searchTerm, StatusCallback<List<DiscussionTopicHeader>> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
DiscussionAPI.getFilteredDiscussionTopic(canvasContext, searchTerm, callback, adapter, params);
}
}
Aggregations