Skip to content

Commit

Permalink
update to play services 9.6.0 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauin authored Sep 23, 2016
1 parent c8dfb99 commit 46dcd4d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android:
- tools
- tools
- platform-tools
- build-tools-24.0.1
- build-tools-24.0.2
- android-24

# Additional components
Expand Down
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ ext.versions = [
compileSdk : 24,
targetSdk : 24,
minSdk : 15,
buildTools : '24.0.1',
buildTools : '24.0.2',

// Gradle Versions
androidGradlePlugin : '2.2.0-alpha7',
androidGradlePlugin : '2.2.0',
retrolambdaGradlePlugin: '3.2.5',
mavenGradlePlugin : '1.4.1',
bintrayGradlePlugin : '1.7.1',

// Dependency Versions
playServices : '9.4.0',
rxJava : '1.1.8'
playServices : '9.6.0',
rxJava : '1.2.0'
]

ext.gradlePlugins = [
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ dependencies {
// compile project(':servant')
compile "com.mtramin:servant:$versions.name"

compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile "com.google.android.gms:play-services-location:$versions.playServices"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,25 @@
import com.google.android.gms.common.api.GoogleApiClient;

import rx.Completable;
import rx.Single;
import rx.SingleSubscriber;
import rx.CompletableSubscriber;
import rx.subscriptions.Subscriptions;

/**
* Provides an interface that serves a {@link GoogleApiClient} as a {@link Single}.
* Provides an interface that serves a {@link GoogleApiClient} as a {@link Completable}.
* <p>
* Will disconnect the Client once the Single is unsubscribed from. This is also the case if the Single
* emits anything in {@link SingleSubscriber#onSuccess(Object)}.
* Will disconnect the Client once the Completable is unsubscribed from. This is also the case once
* the Completable calls {@link CompletableSubscriber#onCompleted()}.
*/
public abstract class GoogleApiClientCompletable extends BaseClient implements Completable.CompletableOnSubscribe {
public abstract class GoogleApiClientCompletable extends BaseClient implements Completable.OnSubscribe {

private Completable.CompletableSubscriber completableSubscriber;
private CompletableSubscriber completableSubscriber;

protected GoogleApiClientCompletable(Context context) {
super(context);
}

@Override
public void call(Completable.CompletableSubscriber completableSubscriber) {
public void call(CompletableSubscriber completableSubscriber) {
this.completableSubscriber = completableSubscriber;

buildClient(getApi());
Expand Down Expand Up @@ -72,10 +71,17 @@ void onClientError(Throwable throwable) {
*/
protected abstract Api getApi();

/**
* Call when the Completable GoogleApiClient should complete.
*/
protected void onCompleted() {
completableSubscriber.onCompleted();
}

/**
* Call when the Completable should error.
* @param throwable throwable to emit in onError.
*/
protected void onError(Throwable throwable) {
completableSubscriber.onError(throwable);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ private GoogleApiClientObservable(Context context, Api api) {
}

static Observable<GoogleApiClient> create(Context context, Api api) {
return Observable.fromAsync(new GoogleApiClientObservable(context, api), AsyncEmitter.BackpressureMode.NONE);
return Observable.fromEmitter(new GoogleApiClientObservable(context, api),
AsyncEmitter.BackpressureMode.NONE);
}

@Override
Expand Down

0 comments on commit 46dcd4d

Please sign in to comment.