소스 검색

[메인][Bug] 코드 정리

hyodong.min 7 년 전
부모
커밋
436edfcc2c
1개의 변경된 파일13개의 추가작업 그리고 20개의 파일을 삭제
  1. 13 20
      app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/main/MainContentsCategoryImageView.java

+ 13 - 20
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/main/MainContentsCategoryImageView.java

@@ -7,7 +7,6 @@ import android.content.Context;
 import android.graphics.Matrix;
 import android.graphics.drawable.Drawable;
 import android.support.v7.widget.RecyclerView;
-import android.util.Log;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
@@ -105,24 +104,18 @@ public class MainContentsCategoryImageView extends MainContentsView {
       // values[2] and values[5] are the x,y coordinates of the top left corner of the drawable image, regardless of the zoom factor.
       // values[0] and values[4] are the zoom factors for the image's width and height respectively. If you zoom at the same factor, these should both be the same value.
 
-//      Log.i("APP# MainContentsCategoryImageView | onScrolledInternal", "| scale x: " + values[0]);
-//      Log.i("APP# MainContentsCategoryImageView | onScrolledInternal", "| scale y: " + values[4]);
-//      Log.i("APP# MainContentsCategoryImageView | onScrolledInternal", "| x: " + values[2]);
-//      Log.i("APP# MainContentsCategoryImageView | onScrolledInternal", "| y: " + values[5]);
-//      Log.i("APP# MainContentsCategoryImageView | onScrolledInternal", "| -------------------------------");
-
       /**
        *
-       *           |                     |
-       *           ⎡‾‾‾‾‾‾‾⎤     ⎡‾‾‾‾‾‾‾⎤
-       *           ⎢image  ⎥     ⎢  img  ⎥
-       *           ⎡‾‾‾‾‾‾⎤⎥     ⎢⎡‾‾‾‾‾‾⎤
-       *           ⎢      ⎥⎥     ⎢⎢      ⎥
-       *           ⎢ mask ⎥⎥     ⎢⎢ mask ⎥
-       *           ⎣⎽⎽⎽⎽⎽⎽⎦⎥     ⎢⎣⎽⎽⎽⎽⎽⎽⎦
-       *           ⎣⎽⎽⎽⎽⎽⎽⎽⎦     ⎣⎽⎽⎽⎽⎽⎽⎽⎦
-       *           |                     |
-       *           |0                    | screen width
+       *           │                       │
+       *           ├────────┐     ┌────────┤
+       *           │image   │     │  img   │
+       *           ├──────┐ │     │ ┌──────┤
+       *           │      │ │     │ │      │
+       *           │ mask │ │     │ │ mask │
+       *           ├──────┘ │     │ └──────┤
+       *           ├────────┘     └────────┤
+       *           │                       │
+       *           │0                      │ screen width
        *
        *              mask == itemView
        */
@@ -130,8 +123,8 @@ public class MainContentsCategoryImageView extends MainContentsView {
       /**
        mask.x : 0 ~ screen.w-mask.w
 
-       mask.x == 0 => image.x = 0;
-       mask.x == screen.w-mask.w => image.x = image.w-mask.w
+       if mask.x == 0 => image.x = 0;
+       if mask.x == screen.w-mask.w => image.x = image.w-mask.w
 
        image.x : 0 ~ -(image.w-mask.w)
 
@@ -168,7 +161,7 @@ public class MainContentsCategoryImageView extends MainContentsView {
       if (y > -maskHeight && y < screenHeight) {  // holder 가 표시되는 부분에서만 계산
         ratio = (float) y / (screenHeight - maskHeight);
 
-        ty = -((int) ((imageHeight - maskHeight) * ratio));  // image 이동 구간 0 ~ -image.w-mask.w
+        ty = -((int) ((imageHeight - maskHeight) * ratio));
 
         cy = (int) values[5];
         dy = ty - cy;