use of com.meisolsson.githubsdk.service.organizations.OrganizationService in project gh4a by slapperwan.
the class UserFragment method loadOrganizationsIfUser.
private void loadOrganizationsIfUser(boolean force) {
if (mUser.type() != UserType.User) {
fillOrganizations(null);
return;
}
final OrganizationService service = ServiceFactory.get(OrganizationService.class, force);
ApiHelpers.PageIterator.toSingle(page -> mIsSelf ? service.getMyOrganizations(page) : service.getUserPublicOrganizations(mUser.login(), page)).compose(makeLoaderSingle(ID_LOADER_ORG_LIST, force)).subscribe(this::fillOrganizations, this::handleLoadFailure);
}
use of com.meisolsson.githubsdk.service.organizations.OrganizationService in project gh4a by slapperwan.
the class NewsFeedFactory method loadOrganizations.
private void loadOrganizations(boolean force) {
final Gh4Application app = Gh4Application.get();
final OrganizationService service = ServiceFactory.get(OrganizationService.class, force);
mOrganizationSubscription = ApiHelpers.PageIterator.toSingle(page -> ApiHelpers.loginEquals(mUserLogin, app.getAuthLogin()) ? service.getMyOrganizations(page) : service.getUserPublicOrganizations(mUserLogin, page)).compose(mActivity.makeLoaderSingle(ID_LOADER_ORGS, force)).subscribe(result -> {
mUserScopes = result.isEmpty() ? null : result;
mActivity.supportInvalidateOptionsMenu();
}, mActivity::handleLoadFailure);
}
Aggregations