use of com.meisolsson.githubsdk.service.misc.MarkdownService in project gh4a by slapperwan.
the class ReleaseInfoActivity method loadBody.
private void loadBody() {
final Single<Optional<String>> htmlSingle;
if (TextUtils.isEmpty(mRelease.body())) {
htmlSingle = Single.just(Optional.absent());
} else {
MarkdownService service = ServiceFactory.get(MarkdownService.class, false);
RequestMarkdown request = RequestMarkdown.builder().context(mRepoOwner + "/" + mRepoName).mode("gfm").text(mRelease.body()).build();
htmlSingle = service.renderMarkdown(request).map(ApiHelpers::throwOnFailure).map(Optional::of);
}
mBodySubscription = htmlSingle.compose(makeLoaderSingle(ID_LOADER_BODY, false)).subscribe(this::fillNotes, this::handleLoadFailure);
}
Aggregations