Pārlūkot izejas kodu

[메뉴][New] 등장 에니메이션 수정

hyodong.min 6 gadi atpakaļ
vecāks
revīzija
4f36c845ff

+ 22 - 26
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/menu/AllMenuFragment.java

@@ -18,7 +18,6 @@ import java.util.List;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
-import kr.co.zumo.app.lifeplus.util.AppUtil;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
@@ -76,31 +75,12 @@ public class AllMenuFragment extends FragmentBase<AllMenuPresenter> implements I
     findViewById(R.id.text_event).setOnClickListener(view -> presenter.onEvent(new Event.Builder(Event.EVENT).build()));
     findViewById(R.id.text_view_life_plus_guide).setOnClickListener(view -> presenter.onEvent(new Event.Builder(Event.GUIDE).build()));
 
-    if (AppUtil.isDebug()) {
-      findViewById(R.id.text_coupon).setVisibility(View.VISIBLE);
-      findViewById(R.id.text_coupon).setOnClickListener(view -> presenter.onEvent(new Event.Builder(Event.COUPON_MALL).build()));
-    }
-    else {
-      findViewById(R.id.text_coupon).setVisibility(View.GONE);
-    }
+    findViewById(R.id.text_coupon).setVisibility(View.VISIBLE);
+    findViewById(R.id.text_coupon).setOnClickListener(view -> presenter.onEvent(new Event.Builder(Event.COUPON_MALL).build()));
 
     setDefaultAnimationSetting();
   }
 
-  @Override
-  public void setDefaultAnimationSetting() {
-    for (int i = 0; i < categoryList.size(); ++i) {
-      TextView categoryText = categoryList.get(i);
-      categoryText.setTranslationX(ResourceUtil.dpToPx(90));
-      categoryText.setAlpha(0f);
-    }
-  }
-
-  @Override
-  public void hideMenuAnimation() {
-    // TODO: 메뉴 들어갈때 애니메이션 구현
-  }
-
   @Override
   protected void defineActionBar(ActionBarHelper actionBarHelper) {
     actionBarHelper.begin()
@@ -131,6 +111,11 @@ public class AllMenuFragment extends FragmentBase<AllMenuPresenter> implements I
     return true;
   }
 
+  @Override
+  public void hideMenuAnimation() {
+    // TODO: 메뉴 들어갈때 애니메이션 구현
+  }
+
   /**
    * 알림이 1개 이상일 경우 진입시 애니메이션과 함께 뱃지 노출
    *
@@ -142,6 +127,14 @@ public class AllMenuFragment extends FragmentBase<AllMenuPresenter> implements I
     getHelper(ActionBarHelper.class).setNotiMarker(isNewNoti, isAnim);
   }
 
+
+  void setDefaultAnimationSetting() {
+    for (int i = 0; i < categoryList.size(); ++i) {
+      TextView categoryText = categoryList.get(i);
+      categoryText.setTranslationX(ResourceUtil.dpToPx(120));
+      categoryText.setAlpha(0f);
+    }
+  }
   /**
    * 메뉴 애니메이션 추가
    */
@@ -150,16 +143,19 @@ public class AllMenuFragment extends FragmentBase<AllMenuPresenter> implements I
 
     AnimatorSet animatorSet = new AnimatorSet();
 
+    final int duration = 400;
+    final int delay = 80;
+
     for (int i = 0; i < categoryList.size(); ++i) {
       TextView categoryText = categoryList.get(i);
       ObjectAnimator translationX = ObjectAnimator.ofFloat(categoryText, View.TRANSLATION_X, categoryText.getTranslationX(), 0f);
       ObjectAnimator alpha = ObjectAnimator.ofFloat(categoryText, View.ALPHA, 0.0f, 1f);
 
-      translationX.setDuration(700);
-      translationX.setStartDelay(100 * i + 1);
+      translationX.setDuration(duration);
+      translationX.setStartDelay(delay * i);
 
-      alpha.setDuration(700);
-      alpha.setStartDelay(100 * i + 1);
+      alpha.setDuration(duration);
+      alpha.setStartDelay(delay * i);
 
       animatorSet.playTogether(translationX, alpha);
     }

+ 1 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/menu/AllMenuPresenter.java

@@ -47,7 +47,7 @@ public class AllMenuPresenter extends Presenter<AllMenuModel, IAllMenuView> {
   @Override
   protected void startInternalOnce() {
     Log.w("APP# AllMenuPresenter | startInternalOnce", "|" + "====> startInternalOnce");
-    view.setDefaultAnimationSetting();
+    view.showMenuAnimation();
   }
 
   @Override
@@ -151,8 +151,6 @@ public class AllMenuPresenter extends Presenter<AllMenuModel, IAllMenuView> {
   @Override
   public void onScreenReady() {
     // TODO: 알림 1개 이상일 경우 뱃지 노출
-    // TODO: 메뉴 애니메이션 구현  
     //view.showNotiAnimation(true, true);
-    view.showMenuAnimation();
   }
 }

+ 0 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/menu/IAllMenuView.java

@@ -21,7 +21,5 @@ public interface IAllMenuView extends IView {
 
   void showMenuAnimation();
 
-  void setDefaultAnimationSetting();
-
   void hideMenuAnimation();
 }