|
|
13
|
+
|
|
|
14
|
+ private BriefsContract.View briefsView;
|
|
|
15
|
+ private BriefsInteractor interactor;
|
|
|
16
|
+
|
|
|
17
|
+ public BriefsPresenter(BriefsContract.View briefsView){
|
|
|
18
|
+ this.briefsView = briefsView;
|
|
|
19
|
+ interactor = new BriefsInteractor(this);
|
|
|
20
|
+ }
|
|
7
|
21
|
|
|
8
|
22
|
@Override
|
|
9
|
23
|
public void start() {
|
|
10
|
|
-
|
|
|
24
|
+ interactor.startJob();
|
|
11
|
25
|
}
|
|
12
|
26
|
|
|
13
|
27
|
@Override
|
|
14
|
28
|
public void stop() {
|
|
|
29
|
+ interactor.cancelJob();
|
|
|
30
|
+ }
|
|
15
|
31
|
|
|
|
32
|
+ @Override
|
|
|
33
|
+ public void onInteractSuccess(BriefsBean bean) {
|
|
|
34
|
+ briefsView.updateUserInfo(bean);
|
|
|
35
|
+ }
|
|
|
36
|
+
|
|
|
37
|
+ @Override
|
|
|
38
|
+ public void onInteractFail(String errorMsg) {
|
|
|
39
|
+ if(NetworkUtil.isWifiConnected(App.getAppContext())){
|
|
|
40
|
+ interactor.startJob();
|
|
|
41
|
+ }
|
|
16
|
42
|
}
|
|
17
|
43
|
|
|
18
|
44
|
}
|