use of com.instructure.canvasapi2.models.Favorite in project instructure-android by instructure.
the class HelpActivity method setupListeners.
private void setupListeners() {
mSearchGuides.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Search guides
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(Const.CANVAS_USER_GUIDES));
startActivity(intent);
}
});
mReportProblem.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ZendeskDialogStyled dialog = new ZendeskDialogStyled();
// set the cached user so the dialog can use the cached user's email address
User user = new User();
user.setPrimaryEmail(mEmailAddress);
ApiPrefs.setUser(user);
dialog.setArguments(ZendeskDialogStyled.createBundle(false, true));
dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
}
});
mRequestFeature.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// let the user open their favorite mail client
Intent intent = populateMailIntent(getString(R.string.featureSubject), getString(R.string.understandRequest), false);
startActivity(Intent.createChooser(intent, getString(R.string.sendMail)));
}
});
mShowLove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Utils.goToAppStore(AppType.PARENT, HelpActivity.this);
}
});
mOpenSource.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(HelpActivity.this, OssLicensesMenuActivity.class));
}
});
}
use of com.instructure.canvasapi2.models.Favorite in project instructure-android by instructure.
the class CourseManager_Test method removeCourseFromFavorites.
public static void removeCourseFromFavorites(long courseId, StatusCallback<Favorite> callback) {
// TODO:
Response response = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("favorite" + " " + courseId).protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "favorite".getBytes())).addHeader("content-type", "application/json").build();
Favorite favorite = new Favorite();
retrofit2.Response<Favorite> response1 = retrofit2.Response.success(favorite, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Favorite in project instructure-android by instructure.
the class CourseManager method addCourseToFavorites.
public static void addCourseToFavorites(long courseId, StatusCallback<Favorite> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseManager_Test.addCourseToFavorites(courseId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseAPI.addCourseToFavorites(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Favorite in project instructure-android by instructure.
the class CourseManager method removeCourseFromFavorites.
public static void removeCourseFromFavorites(long courseId, StatusCallback<Favorite> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseManager_Test.removeCourseFromFavorites(courseId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseAPI.removeCourseFromFavorites(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Favorite in project instructure-android by instructure.
the class GroupManager method addGroupToFavorites.
public static void addGroupToFavorites(long groupId, StatusCallback<Favorite> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).build();
final RestBuilder adapter = new RestBuilder(callback);
GroupAPI.addGroupToFavorites(adapter, callback, params, groupId);
}
}
Aggregations