|
|
@@ -12,6 +12,7 @@ import android.util.Log;
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
|
import kr.co.zumo.app.lifeplus.ILifeCycle;
|
|
|
+import kr.co.zumo.app.lifeplus.activity.MainActivity;
|
|
|
import kr.co.zumo.app.lifeplus.helper.Helper;
|
|
|
import kr.co.zumo.app.lifeplus.helper.NavigationBar;
|
|
|
import kr.co.zumo.app.lifeplus.model.IModelResult;
|
|
|
@@ -24,6 +25,7 @@ import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
import kr.co.zumo.app.lifeplus.view.IView;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.Command;
|
|
|
+import kr.co.zumo.app.lifeplus.view.command.FinishActivityCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.ScreenCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.ConfirmDialog;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogBase;
|
|
|
@@ -194,11 +196,11 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
|
|
|
|
|
|
protected void go(@IntRange(from = 0, to = 1000) int id, @ScreenID.Direction int direction, @Screen.Method int method) {
|
|
|
onCommand(new ScreenCommand(id, direction, method));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected void go(@IntRange(from = 0, to = 1000) int id) {
|
|
|
go(id, ScreenID.DIRECTION_NEXT);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
protected void go(@IntRange(from = 0, to = 1000) int id, @ScreenID.Direction int direction) {
|
|
|
@@ -206,8 +208,15 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
|
|
|
}
|
|
|
|
|
|
protected void back(@IntRange(from = 0, to = 1000) int id) {
|
|
|
- go(id, ScreenID.DIRECTION_BACK, Screen.METHOD_SKIP);
|
|
|
+ if (id == ScreenID.MAIN) {
|
|
|
+ // 현재 activity 가 main activity 가 아닐 경우 main 으로 가려면 activity 를 종료 해야 함
|
|
|
+ if (view.getActivity().getClass().getSimpleName().equalsIgnoreCase(MainActivity.class.getSimpleName()) == false) {
|
|
|
+ onCommand(new FinishActivityCommand());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ go(id, ScreenID.DIRECTION_BACK, Screen.METHOD_SKIP);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -217,12 +226,10 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
|
|
|
*/
|
|
|
protected void jump(@IntRange(from = 0, to = 1000) int id) {
|
|
|
go(id, ScreenID.DIRECTION_BACK, Screen.METHOD_JUMP);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
protected void home() {
|
|
|
go(ScreenID.MAIN, ScreenID.DIRECTION_BACK, Screen.METHOD_HOME);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|