Pārlūkot izejas kodu

[공통][Common] 리팩토링

hyodong.min 6 gadi atpakaļ
vecāks
revīzija
20981869ad

+ 16 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/helper/ActionBarHelper.java

@@ -2,6 +2,7 @@ package kr.co.zumo.app.lifeplus.helper;
 
 import android.animation.Animator;
 import android.animation.ObjectAnimator;
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.graphics.drawable.StateListDrawable;
 import android.support.annotation.IntRange;
@@ -43,13 +44,20 @@ public class ActionBarHelper extends Helper {
 
   private static final int APP_BAR_LAYOUT_SCROLL_PARAM = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS; // | AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP;
 
-  private Activity activity;
   private ActionBar actionBar;
+  @SuppressLint("StaticFieldLeak")
+  private Activity activity;
+  @SuppressLint("StaticFieldLeak")
   private AppBarLayout appBarLayout;
+  @SuppressLint("StaticFieldLeak")
   private ConstraintLayout container;
+  @SuppressLint("StaticFieldLeak")
   private Toolbar toolbar;
+  @SuppressLint("StaticFieldLeak")
   private ProgressBar progressBar;
+  @SuppressLint("StaticFieldLeak")
   private ConstraintLayout layoutCategoryTab;
+  @SuppressLint("StaticFieldLeak")
   private ConstraintLayout categoryMainTab;
 
 
@@ -323,7 +331,7 @@ public class ActionBarHelper extends Helper {
   /**
    * 카테고리 탭 감추기
    */
-  public void cloaseCategoryTab() {
+  public void closeCategoryTab() {
     if (builder.isVisibleCategory && navigationBar.isArrowOpened()) {
       navigationBar.toggleArrow();
       setCategoryTabVisible(false);
@@ -531,9 +539,13 @@ public class ActionBarHelper extends Helper {
 
     scrollListener = null;
     titleClickListener = null;
-
     actionBar = null;
     builder = null;
-
+    activity = null;
+    container = null;
+    toolbar = null;
+    progressBar = null;
+    layoutCategoryTab = null;
+    categoryMainTab = null;
   }
 }

+ 6 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/helper/AllMenuHelper.java

@@ -3,6 +3,7 @@
  */
 package kr.co.zumo.app.lifeplus.helper;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.support.constraint.ConstraintLayout;
 import android.support.design.widget.CoordinatorLayout;
@@ -27,7 +28,9 @@ import kr.co.zumo.app.lifeplus.activity.IDrawerMenu;
 public class AllMenuHelper extends Helper implements IDrawerMenu, IDrawerEvent {
 
   private AllMenuDriver allMenuDriver;
-  private DrawerLayout drawerLayout;    // fixme to weak reference
+  @SuppressLint("StaticFieldLeak")
+  private DrawerLayout drawerLayout;
+  @SuppressLint("StaticFieldLeak")
   private CoordinatorLayout containerMain;
 
   private IAllMenuEvent menuListener;
@@ -94,6 +97,8 @@ public class AllMenuHelper extends Helper implements IDrawerMenu, IDrawerEvent {
     this.drawerLayout = null;
     this.containerMain = null;
     allMenuDriver = null;
+    menuListener = null;
+    drawerListener = null;
   }
 
   /***********************************

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/category/CategoryMainPresenter.java

@@ -123,7 +123,7 @@ public abstract class CategoryMainPresenter<M extends CategoryMainModel, V exten
   @CallSuper
   @Override
   protected void stopInternal() {
-    getHelper(ActionBarHelper.class).cloaseCategoryTab();
+    getHelper(ActionBarHelper.class).closeCategoryTab();
   }
 
   @CallSuper