Skip to content

Commit 163ffee

Browse files
Add Base Activity
1 parent 31e28bd commit 163ffee

30 files changed

Lines changed: 75 additions & 75 deletions

app/src/main/java/com/rxjava2/android/samples/AbsExampleActivity.java renamed to app/src/main/java/com/rxjava2/android/samples/ExampleBaseActivity.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Created by threshold on 2017/1/11.
2323
*/
2424

25-
public abstract class AbsExampleActivity extends AppCompatActivity {
25+
public abstract class ExampleBaseActivity extends AppCompatActivity {
2626

2727
protected String TAG = getClass().getSimpleName();
2828
protected Button btn;
@@ -56,22 +56,22 @@ protected <T> Observer<T> getObserver(final Object theNumberOfObserver) {
5656

5757
@Override
5858
public void onSubscribe(Disposable d) {
59-
AbsExampleActivity.this.onSubscribe(theNumberOfObserver,d);
59+
ExampleBaseActivity.this.onSubscribe(theNumberOfObserver,d);
6060
}
6161

6262
@Override
6363
public void onNext(T value) {
64-
AbsExampleActivity.this.onNext(theNumberOfObserver,value);
64+
ExampleBaseActivity.this.onNext(theNumberOfObserver,value);
6565
}
6666

6767
@Override
6868
public void onError(Throwable e) {
69-
AbsExampleActivity.this.onError(theNumberOfObserver,e);
69+
ExampleBaseActivity.this.onError(theNumberOfObserver,e);
7070
}
7171

7272
@Override
7373
public void onComplete() {
74-
AbsExampleActivity.this.onComplete(theNumberOfObserver);
74+
ExampleBaseActivity.this.onComplete(theNumberOfObserver);
7575
}
7676
};
7777
}
@@ -84,17 +84,17 @@ protected CompletableObserver getCompletableObserver(final Object theNumberOfObs
8484
return new CompletableObserver() {
8585
@Override
8686
public void onSubscribe(Disposable d) {
87-
AbsExampleActivity.this.onSubscribe(theNumberOfObserver, d);
87+
ExampleBaseActivity.this.onSubscribe(theNumberOfObserver, d);
8888
}
8989

9090
@Override
9191
public void onComplete() {
92-
AbsExampleActivity.this.onComplete(theNumberOfObserver);
92+
ExampleBaseActivity.this.onComplete(theNumberOfObserver);
9393
}
9494

9595
@Override
9696
public void onError(Throwable e) {
97-
AbsExampleActivity.this.onError(theNumberOfObserver, e);
97+
ExampleBaseActivity.this.onError(theNumberOfObserver, e);
9898
}
9999
};
100100
}
@@ -107,17 +107,17 @@ protected <T> DisposableObserver<T> getDisposableObserver(final Object theNumber
107107
return new DisposableObserver<T>() {
108108
@Override
109109
public void onNext(T t) {
110-
AbsExampleActivity.this.onNext(theNumberOfObserver, t);
110+
ExampleBaseActivity.this.onNext(theNumberOfObserver, t);
111111
}
112112

113113
@Override
114114
public void onError(Throwable e) {
115-
AbsExampleActivity.this.onError(theNumberOfObserver, e);
115+
ExampleBaseActivity.this.onError(theNumberOfObserver, e);
116116
}
117117

118118
@Override
119119
public void onComplete() {
120-
AbsExampleActivity.this.onComplete(theNumberOfObserver);
120+
ExampleBaseActivity.this.onComplete(theNumberOfObserver);
121121
}
122122
};
123123
}
@@ -130,17 +130,17 @@ protected <T> SingleObserver<T> getSingleObserver(final Object theNumberOfObserv
130130
return new SingleObserver<T>() {
131131
@Override
132132
public void onSubscribe(Disposable d) {
133-
AbsExampleActivity.this.onSubscribe(theNumberOfObserver, d);
133+
ExampleBaseActivity.this.onSubscribe(theNumberOfObserver, d);
134134
}
135135

136136
@Override
137137
public void onSuccess(T t) {
138-
AbsExampleActivity.this.onNext(theNumberOfObserver, t);
138+
ExampleBaseActivity.this.onNext(theNumberOfObserver, t);
139139
}
140140

141141
@Override
142142
public void onError(Throwable e) {
143-
AbsExampleActivity.this.onError(theNumberOfObserver, e);
143+
ExampleBaseActivity.this.onError(theNumberOfObserver, e);
144144
}
145145
};
146146
}
@@ -153,22 +153,22 @@ protected <T> MaybeObserver<T> getMaybeObserver(final Object theNumberOfObserver
153153
return new MaybeObserver<T>() {
154154
@Override
155155
public void onSubscribe(Disposable d) {
156-
AbsExampleActivity.this.onSubscribe(theNumberOfObserver, d);
156+
ExampleBaseActivity.this.onSubscribe(theNumberOfObserver, d);
157157
}
158158

159159
@Override
160160
public void onSuccess(T t) {
161-
AbsExampleActivity.this.onSuccess(theNumberOfObserver, t);
161+
ExampleBaseActivity.this.onSuccess(theNumberOfObserver, t);
162162
}
163163

164164
@Override
165165
public void onError(Throwable e) {
166-
AbsExampleActivity.this.onError(theNumberOfObserver, e);
166+
ExampleBaseActivity.this.onError(theNumberOfObserver, e);
167167
}
168168

169169
@Override
170170
public void onComplete() {
171-
AbsExampleActivity.this.onComplete(theNumberOfObserver);
171+
ExampleBaseActivity.this.onComplete(theNumberOfObserver);
172172
}
173173
};
174174
}

‎app/src/main/java/com/rxjava2/android/samples/operators/AsyncSubjectExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import io.reactivex.subjects.AsyncSubject;
66

77
/**
88
* Created by amitshekhar on 17/12/16.
99
*/
1010

11-
public class AsyncSubjectExampleActivity extends AbsExampleActivity {
11+
public class AsyncSubjectExampleActivity extends ExampleBaseActivity {
1212

1313
/* An AsyncSubject emits the last value (and only the last value) emitted by the source
1414
* Observable, and only after that source Observable completes. (If the source Observable

‎app/src/main/java/com/rxjava2/android/samples/operators/BehaviorSubjectExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import io.reactivex.subjects.BehaviorSubject;
66

77
/**
88
* Created by amitshekhar on 17/12/16.
99
*/
1010

11-
public class BehaviorSubjectExampleActivity extends AbsExampleActivity {
11+
public class BehaviorSubjectExampleActivity extends ExampleBaseActivity {
1212

1313
/* When an observer subscribes to a BehaviorSubject, it begins by emitting the item most
1414
* recently emitted by the source Observable (or a seed/default value if none has yet been

‎app/src/main/java/com/rxjava2/android/samples/operators/BufferExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import io.reactivex.Observable;
66

77
/**
88
* Created by amitshekhar on 27/08/16.
99
*/
10-
public class BufferExampleActivity extends AbsExampleActivity {
10+
public class BufferExampleActivity extends ExampleBaseActivity {
1111

1212
/*
1313
* simple example using buffer operator - bundles all emitted values into a list

‎app/src/main/java/com/rxjava2/android/samples/operators/CompletableObserverExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import java.util.Random;
66

@@ -13,7 +13,7 @@
1313
/**
1414
* Created by amitshekhar on 27/08/16.
1515
*/
16-
public class CompletableObserverExampleActivity extends AbsExampleActivity {
16+
public class CompletableObserverExampleActivity extends ExampleBaseActivity {
1717

1818
/*
1919
* simple example using CompletableObserver

‎app/src/main/java/com/rxjava2/android/samples/operators/ConcatExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import io.reactivex.Observable;
66

77
/**
88
* Created by amitshekhar on 27/08/16.
99
*/
10-
public class ConcatExampleActivity extends AbsExampleActivity {
10+
public class ConcatExampleActivity extends ExampleBaseActivity {
1111

1212
private static final String TAG = ConcatExampleActivity.class.getSimpleName();
1313

‎app/src/main/java/com/rxjava2/android/samples/operators/DebounceExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import java.util.concurrent.TimeUnit;
66

@@ -14,7 +14,7 @@
1414
* Created by amitshekhar on 22/12/16.
1515
*/
1616

17-
public class DebounceExampleActivity extends AbsExampleActivity {
17+
public class DebounceExampleActivity extends ExampleBaseActivity {
1818

1919
private static final String TAG = DebounceExampleActivity.class.getSimpleName();
2020

‎app/src/main/java/com/rxjava2/android/samples/operators/DeferExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44
import com.rxjava2.android.samples.model.Car;
55

66
import io.reactivex.Observable;
77

88
/**
99
* Created by amitshekhar on 30/08/16.
1010
*/
11-
public class DeferExampleActivity extends AbsExampleActivity {
11+
public class DeferExampleActivity extends ExampleBaseActivity {
1212

1313
/*
1414
* Defer used for Deferring Observable code until subscription in RxJava

‎app/src/main/java/com/rxjava2/android/samples/operators/DisposableExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.os.SystemClock;
44

5-
import com.rxjava2.android.samples.AbsExampleActivity;
5+
import com.rxjava2.android.samples.ExampleBaseActivity;
66

77
import java.util.concurrent.Callable;
88

@@ -15,7 +15,7 @@
1515
/**
1616
* Created by amitshekhar on 27/08/16.
1717
*/
18-
public class DisposableExampleActivity extends AbsExampleActivity {
18+
public class DisposableExampleActivity extends ExampleBaseActivity {
1919

2020
private final CompositeDisposable disposables = new CompositeDisposable();
2121

‎app/src/main/java/com/rxjava2/android/samples/operators/DistinctExampleActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.rxjava2.android.samples.operators;
22

3-
import com.rxjava2.android.samples.AbsExampleActivity;
3+
import com.rxjava2.android.samples.ExampleBaseActivity;
44

55
import io.reactivex.Observable;
66

77
/**
88
* Created by techteam on 13/09/16.
99
*/
10-
public class DistinctExampleActivity extends AbsExampleActivity {
10+
public class DistinctExampleActivity extends ExampleBaseActivity {
1111

1212
protected void doSomeWork(){
1313
getObservable().distinct() .subscribe(getObserver());

0 commit comments

Comments
 (0)