use of com.instructure.canvasapi2.models.CanvasColor in project instructure-android by instructure.
the class UserManager method getColors.
public static void getColors(@NonNull StatusCallback<CanvasColor> callback, boolean forceNetwork) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withForceReadFromCache(!forceNetwork).withForceReadFromNetwork(forceNetwork).build();
if (isTesting() || mTesting) {
UserManager_Test.getColors(adapter, callback, params);
} else {
UserAPI.getColors(adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasColor in project instructure-android by instructure.
the class UserManager_Test method getColors.
public static void getColors(@NonNull RestBuilder adapter, @NonNull StatusCallback<CanvasColor> callback, @NonNull RestParams params) {
adapter.setStatusCallback(callback);
Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
CanvasColor canvasColor = new CanvasColor();
retrofit2.Response<CanvasColor> response1 = retrofit2.Response.success(canvasColor, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Aggregations