فهرست منبع

[공통][Common] 디버그 모드를 초기에 설정하여 SuperModel 디펜던시 제거
- 위젯에서 SuperModel 관련 에러 발생하여 수정

hyodong.min 6 سال پیش
والد
کامیت
658b3ef596

+ 2 - 0
app/src/common/java/kr/co/zumo/app/lifeplus/network/NetworkWatcher.java

@@ -47,6 +47,8 @@ public class NetworkWatcher {
 
     boolean isConnected = networkStatus.isConnected();
 
+    Log.i("APP# NetworkWatcher | check", "|" + " network: " + isConnected);
+
     if (isConnected) {
       single = new InternetStatus().check(NetworkConfig.getHostUrl(), Integer.parseInt(NetworkConfig.getHostPort()));
     }

+ 6 - 0
app/src/dev/java/kr/co/zumo/app/lifeplus/config/NetworkConfigSetup.java

@@ -2,6 +2,8 @@ package kr.co.zumo.app.lifeplus.config;
 
 import android.util.Log;
 
+import kr.co.zumo.app.lifeplus.model.SuperModel;
+
 public class NetworkConfigSetup {
 
   protected static INetworkConfig networkConfig;
@@ -11,6 +13,10 @@ public class NetworkConfigSetup {
    * - dev / product 별로 처리된다.
    */
   public static void setConfig() {
+
+    // debug target 설정
+    DebugConfig.setDebugTarget(SuperModel.getInstance().getPreferences().getDebugTarget(DebugConfig.DEBUG_TARGET_DEVELOP));
+
     if (DebugConfig.isDebugProduct()) {
       networkConfig = new NetworkConfigProduct();
     }

+ 10 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/config/DebugConfig.java

@@ -20,18 +20,24 @@ public class DebugConfig {
   public static final String DEBUG_TARGET_DEVELOP = "debug_target_develop";
   public static final String DEBUG_TARGET_PRODUCT = "debug_target_product";
 
+  private static String target = DEBUG_TARGET_DEVELOP;
+
+  public static void setDebugTarget(String debugTarget) {
+    target = debugTarget;
+  }
+
   public static boolean isDebugProduct() {
-    return DEBUG_TARGET_PRODUCT.equals(SuperModel.getInstance().getPreferences().getDebugTarget(DEBUG_TARGET_DEVELOP));
+    return DEBUG_TARGET_PRODUCT.equals(target);
   }
 
   public static boolean isDebugDevelop() {
-    return DEBUG_TARGET_DEVELOP.equals(SuperModel.getInstance().getPreferences().getDebugTarget(DEBUG_TARGET_DEVELOP));
+    return DEBUG_TARGET_DEVELOP.equals(target);
   }
 
-  public static void setDebugTargetDevelop() {
+  public static void saveDebugTargetDevelop() {
     SuperModel.getInstance().getPreferences().setDebugTarget(DebugConfig.DEBUG_TARGET_DEVELOP);
   }
-  public static void setDebugTargetProduct() {
+  public static void saveDebugTargetProduct() {
     SuperModel.getInstance().getPreferences().setDebugTarget(DebugConfig.DEBUG_TARGET_PRODUCT);
   }
 }

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainFragment.java

@@ -388,13 +388,13 @@ public class MainFragment extends FragmentBase<MainPresenter> implements IMainVi
       else {
         button = findViewById(R.id.button_dev);
         button.setOnClickListener(v -> {
-          DebugConfig.setDebugTargetDevelop();
+          DebugConfig.saveDebugTargetDevelop();
           new CommandInvoker().invoke(presenter, new ExitCommand());
         });
 
         button = findViewById(R.id.button_product);
         button.setOnClickListener(v -> {
-          DebugConfig.setDebugTargetProduct();
+          DebugConfig.saveDebugTargetProduct();
           new CommandInvoker().invoke(presenter, new ExitCommand());
         });
         if (DebugConfig.isDebugDevelop()) {