|
|
@@ -3,9 +3,13 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.view.screen.error;
|
|
|
|
|
|
+import io.reactivex.disposables.Disposable;
|
|
|
import kr.co.zumo.app.lifeplus.activity.ScreenStarter;
|
|
|
import kr.co.zumo.app.lifeplus.activity.ScreenStarterIDMapper;
|
|
|
import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
+import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
+import kr.co.zumo.app.lifeplus.view.command.ExitCommand;
|
|
|
+import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
|
|
|
|
|
|
/**
|
|
|
* NetworkErrorPresenter
|
|
|
@@ -17,9 +21,10 @@ import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
* @history 민효동 [2018. 9. 21.] [최초 작성]
|
|
|
* @since 2018. 9. 21.
|
|
|
*/
|
|
|
-public class NetworkErrorStartingPresenter extends NetworkErrorPresenter {
|
|
|
+public class NetworkErrorStartingPresenter extends Presenter<BlankModel, INetworkErrorView> {
|
|
|
|
|
|
protected ScreenStarter starter;
|
|
|
+ protected Disposable disposable;
|
|
|
|
|
|
public NetworkErrorStartingPresenter(BlankModel model, INetworkErrorView view) {
|
|
|
super(model, view);
|
|
|
@@ -28,16 +33,63 @@ public class NetworkErrorStartingPresenter extends NetworkErrorPresenter {
|
|
|
@Override
|
|
|
protected void createViewInternal() {
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
protected void destroyInternal() {
|
|
|
- super.destroyInternal();
|
|
|
|
|
|
+ if (null != disposable) {
|
|
|
+ disposable.dispose();
|
|
|
+ disposable = null;
|
|
|
+ }
|
|
|
if (null != starter) {
|
|
|
starter.dispose();
|
|
|
starter = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ protected void startInternal() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void stopInternal() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void resumeInternal() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void pauseInternal() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void destroyViewInternal() {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onBackPressed() {
|
|
|
+ onCommand(new ExitCommand());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onEventInternal(Event event) {
|
|
|
+ switch (event.getEventId()) {
|
|
|
+ case Event.RETRY:
|
|
|
+ model.checkNetwork();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
protected void next() {
|
|
|
/**
|
|
|
* 진입 지점이 다를 경우 화면 이동 처리
|
|
|
@@ -50,4 +102,27 @@ public class NetworkErrorStartingPresenter extends NetworkErrorPresenter {
|
|
|
go(screenId);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ /***********************************
|
|
|
+ * listener
|
|
|
+ ***********************************/
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onResult(Event event) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onScreenReady() {
|
|
|
+ onChangedConnection(false, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onChangedConnection(boolean isConnected, int type) {
|
|
|
+ super.onChangedConnection(isConnected, type);
|
|
|
+
|
|
|
+ if (isConnected) {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|