use of com.meisolsson.githubsdk.service.repositories.RepositoryCollaboratorService in project gh4a by slapperwan.
the class CollaboratorListFragment method loadPage.
@Override
protected Single<Response<Page<User>>> loadPage(int page, boolean bypassCache) {
String owner = getArguments().getString("owner");
String repo = getArguments().getString("repo");
final RepositoryCollaboratorService service = ServiceFactory.get(RepositoryCollaboratorService.class, bypassCache);
return service.getCollaborators(owner, repo, page);
}
use of com.meisolsson.githubsdk.service.repositories.RepositoryCollaboratorService in project gh4a by slapperwan.
the class SingleFactory method isAppUserRepoCollaborator.
public static Single<Boolean> isAppUserRepoCollaborator(String repoOwner, String repoName, boolean bypassCache) {
Gh4Application app = Gh4Application.get();
RepositoryCollaboratorService service = ServiceFactory.get(RepositoryCollaboratorService.class, bypassCache);
if (!app.isAuthorized()) {
return Single.just(false);
}
return service.isUserCollaborator(repoOwner, repoName, app.getAuthLogin()).map(ApiHelpers::throwOnFailure).compose(RxUtils.mapFailureToValue(403, false)).map(result -> true);
}
use of com.meisolsson.githubsdk.service.repositories.RepositoryCollaboratorService in project gh4a by slapperwan.
the class IssueEditActivity method loadPotentialAssignees.
private void loadPotentialAssignees() {
final RepositoryCollaboratorService service = ServiceFactory.get(RepositoryCollaboratorService.class, false);
registerTemporarySubscription(ApiHelpers.PageIterator.toSingle(page -> service.getCollaborators(mRepoOwner, mRepoName, page)).compose(RxUtils::doInBackground).compose(RxUtils.wrapWithProgressDialog(this, R.string.loading_msg)).subscribe(result -> {
mAllAssignee = result;
User creator = mEditIssue.user();
if (creator != null && !mAllAssignee.contains(creator)) {
mAllAssignee.add(creator);
}
showAssigneesDialog();
}, this::handleLoadFailure));
}
Aggregations