use of com.instructure.canvasapi2.models.CanvasTheme in project instructure-android by instructure.
the class ThemeManager_Test method getTheme.
public static void getTheme(final StatusCallback<CanvasTheme> callback) {
CanvasTheme theme = new Gson().fromJson(json, CanvasTheme.class);
retrofit2.Response<CanvasTheme> response = retrofit2.Response.success(theme);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.CanvasTheme in project instructure-android by instructure.
the class ThemeManager method getTheme.
public static void getTheme(final StatusCallback<CanvasTheme> callback, boolean forceNetwork) {
if (mTesting || isTesting()) {
ThemeManager_Test.getTheme(callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromCache(!forceNetwork).withForceReadFromNetwork(forceNetwork).build();
ThemeAPI.getTheme(adapter, callback, params);
}
}
Aggregations