Search in sources :

Example 11 with ScheduleItem

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

the class TodoListRecyclerAdapterTest method testAreContentsTheSame_DifferentTitleFromSchedule.

@Test
public void testAreContentsTheSame_DifferentTitleFromSchedule() {
    ToDo item = new ToDo();
    ScheduleItem scheduleItem = new ScheduleItem();
    scheduleItem.setTitle("item");
    item.setScheduleItem(scheduleItem);
    ToDo item1 = new ToDo();
    ScheduleItem scheduleItem1 = new ScheduleItem();
    scheduleItem1.setTitle("item1");
    item1.setScheduleItem(scheduleItem1);
    assertFalse(mAdapter.createItemCallback().areContentsTheSame(item, item1));
}
Also used : ToDo(com.instructure.canvasapi2.models.ToDo) ScheduleItem(com.instructure.canvasapi2.models.ScheduleItem) Test(org.junit.Test)

Example 12 with ScheduleItem

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

the class TodoListRecyclerAdapterTest method testAreContentsTheSame_SameTitleFromSchedule.

@Test
public void testAreContentsTheSame_SameTitleFromSchedule() {
    ToDo item = new ToDo();
    ScheduleItem scheduleItem = new ScheduleItem();
    scheduleItem.setTitle("item");
    item.setScheduleItem(scheduleItem);
    assertTrue(mAdapter.createItemCallback().areContentsTheSame(item, item));
}
Also used : ToDo(com.instructure.canvasapi2.models.ToDo) ScheduleItem(com.instructure.canvasapi2.models.ScheduleItem) Test(org.junit.Test)

Example 13 with ScheduleItem

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

the class CalendarEventManager method getCalendarEvents.

public static void getCalendarEvents(CalendarEventAPI.CalendarEventType type, RestParams params, String startDate, String endDate, List<String> canvasContexts, StatusCallback<List<ScheduleItem>> callback) {
    if (isTesting() || mTesting) {
        CalendarEventManager_Test.getCalendarEvents(callback);
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        CalendarEventAPI.getCalendarEvents(true, type, startDate, endDate, canvasContexts, adapter, callback, params);
    }
}
Also used : RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 14 with ScheduleItem

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

the class CalendarEventManager method getCalendarEventAirwolf.

public static void getCalendarEventAirwolf(String airwolfDomain, String parentId, String studentId, String eventId, StatusCallback<ScheduleItem> callback) {
    RestBuilder adapter = new RestBuilder(callback);
    RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(false).withDomain(airwolfDomain).withAPIVersion("").build();
    CalendarEventAPI.getCalendarEventAirwolf(parentId, studentId, eventId, adapter, callback, params);
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 15 with ScheduleItem

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

the class CalendarEventManager method createCalendarEvent.

public static void createCalendarEvent(@NonNull String contextCode, @NonNull String title, @NonNull String description, @NonNull String startDate, @NonNull String endDate, @NonNull String location, @NonNull StatusCallback<ScheduleItem> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().build();
        CalendarEventAPI.createCalendarEvent(contextCode, title, description, startDate, endDate, location, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

ScheduleItem (com.instructure.canvasapi2.models.ScheduleItem)29 Test (org.junit.Test)19 Date (java.util.Date)13 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)9 RestParams (com.instructure.canvasapi2.builders.RestParams)8 Assignment (com.instructure.canvasapi2.models.Assignment)7 ArrayList (java.util.ArrayList)5 View (android.view.View)3 Course (com.instructure.canvasapi2.models.Course)3 List (java.util.List)3 Drawable (android.graphics.drawable.Drawable)2 NonNull (android.support.annotation.NonNull)2 Gson (com.google.gson.Gson)2 GsonBuilder (com.google.gson.GsonBuilder)2 ToDo (com.instructure.canvasapi2.models.ToDo)2 Navigation (com.instructure.interactions.Navigation)2 DateTime (hirondelle.date4j.DateTime)2 Bundle (android.os.Bundle)1 TextView (android.widget.TextView)1 SyllabusRecyclerAdapter (com.instructure.candroid.adapter.SyllabusRecyclerAdapter)1