Skip to content

Commit

Permalink
Merge pull request #555 from ReactiveX/jakew/java-eight/2019-12-31
Browse files Browse the repository at this point in the history
Update to RxJava RC7 and Java 8
  • Loading branch information
JakeWharton authored Jan 1, 2020
2 parents ef3785c + d7bb498 commit 72da15d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subprojects {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
Expand All @@ -23,5 +23,5 @@ subprojects {
ext {
minSdkVersion = 9
compileSdkVersion = 29
sourceCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
}
2 changes: 1 addition & 1 deletion rxandroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
}

dependencies {
api 'io.reactivex.rxjava3:rxjava:3.0.0-RC3'
api 'io.reactivex.rxjava3:rxjava:3.0.0-RC7'

testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ public final void dispose() {
if (Looper.myLooper() == Looper.getMainLooper()) {
onDispose();
} else {
AndroidSchedulers.mainThread().scheduleDirect(new Runnable() {
@Override public void run() {
onDispose();
}
});
AndroidSchedulers.mainThread().scheduleDirect(this::onDispose);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ private static final class MainHolder {
= new HandlerScheduler(new Handler(Looper.getMainLooper()), true);
}

private static final Scheduler MAIN_THREAD = RxAndroidPlugins.initMainThreadScheduler(
new Callable<Scheduler>() {
@Override public Scheduler call() throws Exception {
return MainHolder.DEFAULT;
}
});
private static final Scheduler MAIN_THREAD =
RxAndroidPlugins.initMainThreadScheduler(() -> MainHolder.DEFAULT);

/**
* A {@link Scheduler} which executes actions on the Android main thread.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import android.os.Message;
import io.reactivex.rxjava3.core.Scheduler;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.disposables.Disposables;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -70,7 +69,7 @@ public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
if (unit == null) throw new NullPointerException("unit == null");

if (disposed) {
return Disposables.disposed();
return Disposable.disposed();
}

run = RxJavaPlugins.onSchedule(run);
Expand All @@ -89,7 +88,7 @@ public Disposable schedule(Runnable run, long delay, TimeUnit unit) {
// Re-check disposed state for removing in case we were racing a call to dispose().
if (disposed) {
handler.removeCallbacks(scheduled);
return Disposables.disposed();
return Disposable.disposed();
}

return scheduled;
Expand Down

0 comments on commit 72da15d

Please sign in to comment.