use of com.morihacky.android.rxjava.retrofit.GithubService in project RxJava-Android-Samples by kaushikgopal.
the class PseudoCacheFragment method getFreshNetworkData.
private Observable<Contributor> getFreshNetworkData() {
String githubToken = getResources().getString(R.string.github_oauth_token);
GithubApi githubService = GithubService.createGithubService(githubToken);
return githubService.contributors("square", "retrofit").flatMap(Observable::fromIterable).doOnSubscribe((data) -> //
new Handler(Looper.getMainLooper()).post(//
() -> adapterSubscriptionInfo.add("(network) subscribed"))).doOnComplete(() -> //
new Handler(Looper.getMainLooper()).post(() -> adapterSubscriptionInfo.add("(network) completed")));
}
Aggregations