|
|
@@ -10,6 +10,8 @@ import android.util.Log;
|
|
|
import io.reactivex.disposables.Disposable;
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.LoginResultBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.PopupInfoListBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.PopupInfoResultBean;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.RequestBean;
|
|
|
import kr.co.zumo.app.lifeplus.model.LifeplusPreferences;
|
|
|
import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
@@ -17,6 +19,8 @@ import kr.co.zumo.app.lifeplus.model.module.APIError;
|
|
|
import kr.co.zumo.app.lifeplus.model.module.APILoginStatusMapper;
|
|
|
import kr.co.zumo.app.lifeplus.model.module.APIMemberSelectModule;
|
|
|
import kr.co.zumo.app.lifeplus.model.module.APIModuleSimpleListener;
|
|
|
+import kr.co.zumo.app.lifeplus.model.module.APIPopupLoadModule;
|
|
|
+import kr.co.zumo.app.lifeplus.supervisor.ActivityDeliveryHelper;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
@@ -26,6 +30,7 @@ import kr.co.zumo.app.lifeplus.view.dialog.DialogBuilder;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogID;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.IAttribute;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.ICustomDialogListener;
|
|
|
+import kr.co.zumo.app.lifeplus.view.screen.main.SystemPopupModelHelper;
|
|
|
|
|
|
/**
|
|
|
* ScreenStarter
|
|
|
@@ -43,7 +48,7 @@ public class ScreenStarter {
|
|
|
|
|
|
public static final int START_FROM_MAIN = 0;
|
|
|
public static final int START_FROM_NETWORK_ERROR = 1;
|
|
|
- //public static final int START_FROM_PERMISSION_INFO = 2;
|
|
|
+ public static final int START_FROM_SYSTEM_CHECK = 2;
|
|
|
public static final int START_FROM_ON_BOARDING = 3;
|
|
|
public static final int START_FROM_MEMBER_BLOCK = 4;
|
|
|
public static final int START_FROM_MEMBER_REST = 5;
|
|
|
@@ -65,13 +70,20 @@ public class ScreenStarter {
|
|
|
public void launch(boolean isConnected, IListener listener) {
|
|
|
this.listener = listener;
|
|
|
Log.i("APP# ScreenStarter | launch", "| Network Connected ==> " + isConnected);
|
|
|
- LifeplusPreferences preferences = SuperModel.getInstance().getPreferences();
|
|
|
-
|
|
|
- String userId = SuperModel.getInstance().getUserId();
|
|
|
if (isConnected == false) {
|
|
|
gotoScreen(START_FROM_NETWORK_ERROR);
|
|
|
}
|
|
|
- else if (StringUtil.isFull(userId)) {
|
|
|
+ else {
|
|
|
+ // popup 데이터 로딩 ->
|
|
|
+ loadPopupInfo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void launchInternal() {
|
|
|
+ LifeplusPreferences preferences = SuperModel.getInstance().getPreferences();
|
|
|
+
|
|
|
+ String userId = SuperModel.getInstance().getUserId();
|
|
|
+ if (StringUtil.isFull(userId)) {
|
|
|
/**
|
|
|
* 로그인
|
|
|
* 로그인 완료되면
|
|
|
@@ -91,7 +103,32 @@ public class ScreenStarter {
|
|
|
// 비회원;
|
|
|
gotoScreen(START_FROM_MAIN);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ public void loadPopupInfo() {
|
|
|
+ disposable = new APIPopupLoadModule().call(new RequestBean(), new APIModuleSimpleListener<PopupInfoResultBean>() {
|
|
|
+ @Override
|
|
|
+ public void onApiSuccess(PopupInfoResultBean resultBean) {
|
|
|
+ PopupInfoListBean popupInfoListBean = resultBean.getData();
|
|
|
+ if (null != popupInfoListBean) {
|
|
|
+ SystemPopupModelHelper.getInstance().setSystemPopupBeans(popupInfoListBean.getSystemPopupList());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (SystemPopupModelHelper.getInstance().isClosing()) {
|
|
|
+ // 시스템 점검 중...
|
|
|
+ ActivityDeliveryHelper.getInstance().setPackaging(SystemPopupModelHelper.getInstance().getMatchedBean());
|
|
|
+ gotoScreen(START_FROM_SYSTEM_CHECK);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ launchInternal();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onApiError(String errorMessage, APIError error) {
|
|
|
+ showErrorPopup(errorMessage);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void login() {
|