|
@@ -0,0 +1,40 @@
|
|
1
|
+package com.kuxuan.laraver.net.callback;
|
|
2
|
+
|
|
3
|
+import android.widget.Toast;
|
|
4
|
+
|
|
5
|
+import com.kuxuan.laraver.app.Laraver;
|
|
6
|
+import com.kuxuan.laraver.ui.LaraverLoader;
|
|
7
|
+import com.kuxuan.laraver.ui.LoaderStyle;
|
|
8
|
+
|
|
9
|
+import io.reactivex.Observer;
|
|
10
|
+import io.reactivex.disposables.Disposable;
|
|
11
|
+
|
|
12
|
+/**
|
|
13
|
+ *
|
|
14
|
+ * @author huangfuruixin
|
|
15
|
+ * @date 2017/12/13
|
|
16
|
+ */
|
|
17
|
+
|
|
18
|
+public class RxCallBack implements Observer<String> {
|
|
19
|
+
|
|
20
|
+ @Override
|
|
21
|
+ public void onSubscribe(Disposable d) {
|
|
22
|
+
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ @Override
|
|
26
|
+ public void onNext(String s) {
|
|
27
|
+
|
|
28
|
+ }
|
|
29
|
+
|
|
30
|
+ @Override
|
|
31
|
+ public void onError(Throwable e) {
|
|
32
|
+ Toast.makeText(Laraver.getApplicationContext(),e.getMessage() , Toast.LENGTH_SHORT).show();
|
|
33
|
+ }
|
|
34
|
+
|
|
35
|
+ @Override
|
|
36
|
+ public void onComplete() {
|
|
37
|
+
|
|
38
|
+ LaraverLoader.stopLoading();
|
|
39
|
+ }
|
|
40
|
+}
|