Search in sources :

Example 1 with CanvasTheme

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);
}
Also used : LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) Gson(com.google.gson.Gson) CanvasTheme(com.instructure.canvasapi2.models.CanvasTheme)

Example 2 with CanvasTheme

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);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

Gson (com.google.gson.Gson)1 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)1 RestParams (com.instructure.canvasapi2.builders.RestParams)1 CanvasTheme (com.instructure.canvasapi2.models.CanvasTheme)1 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)1