use of com.meisolsson.githubsdk.model.request.CommentRequest in project PocketHub by pockethub.
the class CreateCommentActivity method createComment.
@Override
protected void createComment(String comment) {
CommentRequest commentRequest = CommentRequest.builder().body(comment).build();
ServiceGenerator.createService(this, IssueCommentService.class).createIssueComment(repositoryId.owner().login(), repositoryId.name(), issueNumber, commentRequest).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(this.<GitHubComment>bindToLifecycle()).subscribe(new ObserverAdapter<GitHubComment>() {
@Override
public void onSuccess(GitHubComment githubComment) {
finish(githubComment);
}
});
}
use of com.meisolsson.githubsdk.model.request.CommentRequest in project PocketHub by pockethub.
the class EditCommentActivity method editComment.
/**
* Edit comment.
*
* @param commentText
*/
protected void editComment(String commentText) {
CommentRequest commentRequest = CommentRequest.builder().body(commentText).build();
ServiceGenerator.createService(this, IssueCommentService.class).editIssueComment(repositoryId.owner().login(), repositoryId.name(), comment.id(), commentRequest).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(this.<GitHubComment>bindToLifecycle()).subscribe(new ProgressObserverAdapter<GitHubComment>(this, R.string.editing_comment) {
@Override
public void onSuccess(GitHubComment edited) {
super.onSuccess(edited);
dismissProgress();
finish(edited);
}
@Override
public void onError(Throwable e) {
super.onError(e);
Log.d(TAG, "Exception editing comment on issue", e);
ToastUtils.show(EditCommentActivity.this, e.getMessage());
}
}.start());
}
use of com.meisolsson.githubsdk.model.request.CommentRequest in project PocketHub by pockethub.
the class CreateCommentActivity method createComment.
@Override
protected void createComment(final String comment) {
CommentRequest commentRequest = CommentRequest.builder().body(comment).build();
ServiceGenerator.createService(this, GistCommentService.class).createGistComment(gist.id(), commentRequest).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(this.<GitHubComment>bindToLifecycle()).subscribe(new ObserverAdapter<GitHubComment>() {
@Override
public void onSuccess(GitHubComment githubComment) {
finish(githubComment);
}
@Override
public void onError(Throwable error) {
Log.e(TAG, "Exception creating comment on gist", error);
ToastUtils.show(CreateCommentActivity.this, error.getMessage());
}
});
}
use of com.meisolsson.githubsdk.model.request.CommentRequest in project PocketHub by pockethub.
the class EditCommentActivity method createComment.
@Override
protected void createComment(String comment) {
CommentRequest commentRequest = CommentRequest.builder().body(comment).build();
editComment(commentRequest);
}
Aggregations