File tree Expand file tree Collapse file tree
src/main/java/com/morihacky/android/rxjava/fragments Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ buildscript {
2+ repositories {
3+ // mavenCentral()
4+ jcenter()
5+ }
6+ dependencies {
7+ classpath ' me.tatarka:gradle-retrolambda:3.2.5'
8+ // can be removed with android-gradle plugin is upgraded to 2.2
9+ // https://twitter.com/JakeWharton/status/760836175586267136
10+ classpath ' me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
11+ }
12+
13+ // Exclude the lombok version that the android plugin depends on.
14+ configurations. classpath. exclude group : ' com.android.tools.external.lombok'
15+ }
16+
117apply plugin : ' com.android.application'
18+ apply plugin : ' me.tatarka.retrolambda'
219
320dependencies {
421 compile ' com.android.support:support-v13:23.2.1'
@@ -27,17 +44,14 @@ dependencies {
2744
2845android {
2946 compileSdkVersion 23
30- buildToolsVersion ' 24rc4 '
47+ buildToolsVersion ' 23.0.3 '
3148
3249 defaultConfig {
3350 applicationId " com.morihacky.android.rxjava"
3451 minSdkVersion 15
35- targetSdkVersion 24
36- versionCode 1
37- versionName " 1.0"
38- jackOptions {
39- enabled true
40- }
52+ targetSdkVersion 23
53+ versionCode 2
54+ versionName " 1.2"
4155 }
4256 buildTypes {
4357 release {
Original file line number Diff line number Diff line change 2020import butterknife .OnClick ;
2121import rx .Observable ;
2222import rx .Observer ;
23+ import rx .Subscriber ;
2324import rx .functions .Func1 ;
2425import rx .observables .MathObservable ;
2526import rx .subscriptions .CompositeSubscription ;
@@ -75,8 +76,7 @@ public void startRetryingWithExponentialBackoffStrategy() {
7576 Observable //
7677 .error (new RuntimeException ("testing" )) // always fails
7778 .retryWhen (new RetryWithDelay (5 , 1000 )) // notice this is called only onError (onNext values sent are ignored)
78- .doOnSubscribe (() ->
79- _log ("Attempting the impossible 5 times in intervals of 1s" ))//
79+ .doOnSubscribe (() -> _log ("Attempting the impossible 5 times in intervals of 1s" ))//
8080 .subscribe (new Observer <Object >() {
8181 @ Override
8282 public void onCompleted () {
@@ -114,7 +114,7 @@ public void startExecutingWithExponentialBackoffDelay() {
114114 .doOnSubscribe (() ->
115115 _log (String .format ("Execute 4 tasks with delay - time now: [xx:%02d]" ,
116116 _getSecondHand ())))//
117- .subscribe (new Observer <Integer >() {
117+ .subscribe (new Subscriber <Integer >() {
118118 @ Override
119119 public void onCompleted () {
120120 Timber .d ("onCompleted" );
You can’t perform that action at this time.
0 commit comments