Ver código fonte

Merge branch 'develop' of https://github.com/swict/LifeplusAndroid into develop

hyodong.min 6 anos atrás
pai
commit
df78daefa9

+ 2 - 9
app/src/main/java/kr/co/zumo/app/lifeplus/view/animation/Barrier.java

@@ -11,8 +11,6 @@ import android.view.View;
 import android.widget.FrameLayout;
 
 import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.util.AppUtil;
-import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 
 /**
  * Barrier - 화면 입력 막기
@@ -60,13 +58,8 @@ public class Barrier {
         }
       });
 
-      if (AppUtil.isDebug()) {
-        view.setAlpha(0.7f);
-        view.setBackgroundColor(ResourceUtil.getColor(R.color.C666666));
-      }
-      else {
-        view.setAlpha(0f);
-      }
+      view.setAlpha(0f);
+
       frameLayout.addView(view);
     }
   }

+ 40 - 10
app/src/main/java/kr/co/zumo/app/lifeplus/view/presenter/Presenter.java

@@ -658,27 +658,53 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
    * listener
    ***********************************/
   // INetworkReceiverListener
-  private Barrier barrier;
+  private Barrier networkBarrier;
+  private Barrier contentsBarrier;
 
   /**
+   * 네트워크용
    * 배리어 제거
    */
-  protected void hideBarrier() {
-    if (null != barrier) {
-      barrier.hide();
-      barrier = null;
+  protected void hideNetworkBarrier() {
+    if (null != networkBarrier) {
+      networkBarrier.hide();
+      networkBarrier = null;
     }
   }
 
   /**
+   * 네트워크용
    * 사용자 터치 입력을 막는 배리어 생성
    */
-  protected void showBarrier() {
-    if (null == barrier) {
-      barrier = new Barrier(view.getActivity()).show();
+  protected void showNetworkBarrier() {
+    if (null == networkBarrier) {
+      networkBarrier = new Barrier(view.getActivity()).show();
     }
   }
 
+  /**
+   * 콘텐츠용
+   * 배리어 제거
+   */
+  protected void hideContentsBarrier() {
+    if (null != contentsBarrier) {
+      contentsBarrier.hide();
+      contentsBarrier = null;
+    }
+  }
+
+  /**
+   * 콘텐츠용
+   * 사용자 터치 입력을 막는 배리어 생성
+   */
+  protected void showContentsBarrier() {
+    if (null == contentsBarrier) {
+      contentsBarrier = new Barrier(view.getActivity()).show();
+    }
+  }
+
+  private boolean isDoingNetworkCheck = false;
+
   @Override
   public void onChangedConnection(boolean isConnected, int type) {
     Log.i("APP# Presenter | onChangedConnection", "| " + this.getClass().getSimpleName() + ", isConnected:" + isConnected);
@@ -688,7 +714,9 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
         dialogNetwork.dispose();
         dialogNetwork = null;
       }
-      hideBarrier();
+      if (isDoingNetworkCheck) {
+        hideNetworkBarrier();
+      }
     }
     else {
       if (null == dialogNetwork) {
@@ -704,8 +732,9 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
                 dialogNetwork.dispose();
                 dialogNetwork = null;
 
-                showBarrier();
+                showNetworkBarrier();
 
+                isDoingNetworkCheck = true;
                 model.checkNetwork();
               }
             }
@@ -723,6 +752,7 @@ public abstract class Presenter<M extends Model, V extends IView> implements ILi
           .show();
       }
     }
+    isDoingNetworkCheck = false;
   }
 
   /***********************************

+ 13 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/select/EventDetailSelectPresenter.java

@@ -121,7 +121,10 @@ public class EventDetailSelectPresenter extends EventDetailPresenter<EventDetail
             model.submit();
           }
           else {
-            new Handler().postDelayed(() -> {view.setScrollToPosition(index + 1);}, 150); // 약간 머물렀다 이동
+            showContentsBarrier();
+            new Handler().postDelayed(() -> {
+              scrollToPosition(index + 1);
+            }, 150); // 약간 머물렀다 이동
           }
         }
         else {
@@ -158,7 +161,7 @@ public class EventDetailSelectPresenter extends EventDetailPresenter<EventDetail
             model.submit();
           }
           else {
-            view.setScrollToPosition(index + 1);
+            scrollToPosition(index + 1);
           }
         }
         else {
@@ -167,7 +170,8 @@ public class EventDetailSelectPresenter extends EventDetailPresenter<EventDetail
         break;
 
       case Event.NEXT:
-        view.setScrollToPosition(event.getIndex() + 1);
+        scrollToPosition(event.getIndex() + 1);
+
         break;
 
       case Event.TAG:
@@ -300,12 +304,18 @@ public class EventDetailSelectPresenter extends EventDetailPresenter<EventDetail
       }
       view.setScrollDisabled();
       view.setBlackActionBar();
+      hideContentsBarrier();
     }
 
     view.setLiked(model.isItemLiked(), false);
   }
 
 
+  private void scrollToPosition(int index) {
+    showContentsBarrier();
+    view.setScrollToPosition(index);
+  }
+
   private void setProgress(int percent) {
     view.setProgress(percent);
   }