use of com.meisolsson.githubsdk.model.IssueState in project PocketHub by pockethub.
the class EditStateTask method edit.
/**
* Edit state of issue.
*
* @param close
* @return this task
*/
public EditStateTask edit(boolean close) {
int message = close ? R.string.closing_issue : R.string.reopening_issue;
IssueState state = close ? IssueState.Closed : IssueState.Open;
try {
store.changeState(repository, issueNumber, state).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).compose(RxProgress.bindToLifecycle(activity, message)).as(AutoDisposeUtils.bindToLifecycle(activity)).subscribe(observer);
} catch (Exception e) {
e.printStackTrace();
}
return this;
}
use of com.meisolsson.githubsdk.model.IssueState in project PocketHub by pockethub.
the class EditStateTask method subscribe.
@Override
public void subscribe(ObservableEmitter<Issue> emitter) throws Exception {
try {
IssueState state = close ? IssueState.closed : IssueState.open;
emitter.onNext(store.changeState(repositoryId, issueNumber, state));
emitter.onComplete();
} catch (IOException e) {
emitter.onError(e);
}
}
Aggregations