Search in sources :

Example 6 with ReactionService

use of com.meisolsson.githubsdk.service.reactions.ReactionService in project gh4a by slapperwan.

the class IssueFragmentBase method addReaction.

@Override
public Single<Reaction> addReaction(GitHubCommentBase comment, String content) {
    ReactionService service = ServiceFactory.get(ReactionService.class, false);
    ReactionRequest request = ReactionRequest.builder().content(content).build();
    return service.createIssueCommentReaction(mRepoOwner, mRepoName, comment.id(), request).map(ApiHelpers::throwOnFailure);
}
Also used : ReactionRequest(com.meisolsson.githubsdk.model.request.ReactionRequest) ReactionService(com.meisolsson.githubsdk.service.reactions.ReactionService) ApiHelpers(com.gh4a.utils.ApiHelpers)

Example 7 with ReactionService

use of com.meisolsson.githubsdk.service.reactions.ReactionService in project gh4a by slapperwan.

the class PullRequestDiffViewerActivity method loadReactionDetails.

@Override
public Single<List<Reaction>> loadReactionDetails(ReactionBar.Item item, boolean bypassCache) {
    final CommitCommentWrapper comment = (CommitCommentWrapper) item;
    final ReactionService service = ServiceFactory.get(ReactionService.class, bypassCache);
    return ApiHelpers.PageIterator.toSingle(page -> service.getPullRequestReviewCommentReactions(mRepoOwner, mRepoName, comment.comment.id(), page));
}
Also used : ReactionService(com.meisolsson.githubsdk.service.reactions.ReactionService)

Example 8 with ReactionService

use of com.meisolsson.githubsdk.service.reactions.ReactionService in project gh4a by slapperwan.

the class PullRequestDiffViewerActivity method addReaction.

@Override
public Single<Reaction> addReaction(ReactionBar.Item item, String content) {
    CommitCommentWrapper comment = (CommitCommentWrapper) item;
    ReactionService service = ServiceFactory.get(ReactionService.class, false);
    ReactionRequest request = ReactionRequest.builder().content(content).build();
    return service.createPullRequestReviewCommentReaction(mRepoOwner, mRepoName, comment.comment.id(), request).map(ApiHelpers::throwOnFailure);
}
Also used : ReactionRequest(com.meisolsson.githubsdk.model.request.ReactionRequest) ReactionService(com.meisolsson.githubsdk.service.reactions.ReactionService) ApiHelpers(com.gh4a.utils.ApiHelpers)

Example 9 with ReactionService

use of com.meisolsson.githubsdk.service.reactions.ReactionService in project gh4a by slapperwan.

the class CommitDiffViewerActivity method addReaction.

@Override
public Single<Reaction> addReaction(ReactionBar.Item item, String content) {
    CommitCommentWrapper comment = (CommitCommentWrapper) item;
    final ReactionService service = ServiceFactory.get(ReactionService.class, false);
    ReactionRequest request = ReactionRequest.builder().content(content).build();
    return service.createCommitCommentReaction(mRepoOwner, mRepoName, comment.comment.id(), request).map(ApiHelpers::throwOnFailure);
}
Also used : ReactionRequest(com.meisolsson.githubsdk.model.request.ReactionRequest) ReactionService(com.meisolsson.githubsdk.service.reactions.ReactionService) ApiHelpers(com.gh4a.utils.ApiHelpers)

Example 10 with ReactionService

use of com.meisolsson.githubsdk.service.reactions.ReactionService in project gh4a by slapperwan.

the class CommitNoteAdapter method addReaction.

@Override
public Single<Reaction> addReaction(ReactionBar.Item item, String content) {
    GitComment comment = ((ViewHolder) item).mBoundItem;
    ReactionService service = ServiceFactory.get(ReactionService.class, false);
    ReactionRequest request = ReactionRequest.builder().content(content).build();
    return service.createCommitCommentReaction(mRepoOwner, mRepoName, comment.id(), request).map(ApiHelpers::throwOnFailure);
}
Also used : ReactionRequest(com.meisolsson.githubsdk.model.request.ReactionRequest) ReactionService(com.meisolsson.githubsdk.service.reactions.ReactionService) ApiHelpers(com.gh4a.utils.ApiHelpers) GitComment(com.meisolsson.githubsdk.model.git.GitComment)

Aggregations

ReactionService (com.meisolsson.githubsdk.service.reactions.ReactionService)10 ApiHelpers (com.gh4a.utils.ApiHelpers)7 ReactionRequest (com.meisolsson.githubsdk.model.request.ReactionRequest)5 GitComment (com.meisolsson.githubsdk.model.git.GitComment)2 Context (android.content.Context)1 PorterDuff (android.graphics.PorterDuff)1 Drawable (android.graphics.drawable.Drawable)1 Parcelable (android.os.Parcelable)1 ColorInt (android.support.annotation.ColorInt)1 IdRes (android.support.annotation.IdRes)1 LayoutRes (android.support.annotation.LayoutRes)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 DrawableCompat (android.support.v4.graphics.drawable.DrawableCompat)1 MenuBuilder (android.support.v7.view.menu.MenuBuilder)1 MenuPopupHelper (android.support.v7.view.menu.MenuPopupHelper)1 ListPopupWindow (android.support.v7.widget.ListPopupWindow)1 PopupMenu (android.support.v7.widget.PopupMenu)1 TextUtils (android.text.TextUtils)1 AttributeSet (android.util.AttributeSet)1