Browse Source

[메인][New] 가로 이미지 간격 벌리기, 세로 첫 카테고리 텍스트 플로팅 처리

hyodong.min 7 years ago
parent
commit
274535e4bd

+ 14 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainCategoryContentsAdapter.java

@@ -41,10 +41,12 @@ public class MainCategoryContentsAdapter extends RecyclerView.Adapter<MainCatego
   private Context context;
   private LayoutInflater inflater;
   private MainContentsBean bean;
+  private int index; // category index;
 
-  public MainCategoryContentsAdapter(Context context, MainContentsBean bean, IEventListener listener) {
+  public MainCategoryContentsAdapter(Context context, MainContentsBean bean, int index, IEventListener listener) {
     this.context = context;
     this.bean = bean;
+    this.index = index;
     this.listener = listener;
 
     holders = new ArrayList<>();
@@ -63,7 +65,7 @@ public class MainCategoryContentsAdapter extends RecyclerView.Adapter<MainCatego
     switch (viewType) {
       case VIEW_TYPE_IMAGE:
         view = inflater.inflate(R.layout.main_contents_category_image, parent, false);
-        holder = new MainCategoryContentsImageView(context, view);
+        holder = new MainCategoryContentsImageView(context, view, index);
         break;
       case VIEW_TYPE_TAIL:
         view = inflater.inflate(R.layout.main_contents_category_tail, parent, false);
@@ -127,10 +129,18 @@ public class MainCategoryContentsAdapter extends RecyclerView.Adapter<MainCatego
   }
 
 
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+  public void onScrolledVertical(RecyclerView recyclerView, int dx, int dy) {
     for (MainCategoryContentsView holder : holders) {
       if (null != holder) {
-        holder.onScrolled(recyclerView, dx, dy);
+        holder.onScrolledVertical(recyclerView, dx, dy);
+      }
+    }
+  }
+
+  public void onScrolledHorizontal(RecyclerView recyclerView, int dx, int dy) {
+    for (MainCategoryContentsView holder : holders) {
+      if (null != holder) {
+        holder.onScrolledHorizontal(recyclerView, dx, dy);
       }
     }
   }

+ 0 - 53
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainCategoryContentsHeadView.java

@@ -1,53 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.main;
-
-import android.content.Context;
-import android.support.v7.widget.RecyclerView;
-import android.view.View;
-
-import kr.co.zumo.app.lifeplus.bean.api.MainContentsCategoryBean;
-import kr.co.zumo.app.lifeplus.view.IEventListener;
-
-/**
- * MainCategoryContentsImageView
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 10. 16.]   [최초 작성]
- * @since 2018. 10. 16.
- */
-public class MainCategoryContentsHeadView extends MainCategoryContentsView {
-
-  public MainCategoryContentsHeadView(Context context, View view) {
-    super(context, view);
-  }
-
-  @Override
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-
-  }
-
-  @Override
-  public void init(int index, MainContentsCategoryBean bean, IEventListener listener) {
-  }
-
-  @Override
-  public void attach() {
-
-  }
-
-  @Override
-  public void detach() {
-
-  }
-
-  @Override
-  public void dispose() {
-
-  }
-
-}

+ 203 - 171
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainCategoryContentsImageView.java

@@ -6,6 +6,7 @@ package kr.co.zumo.app.lifeplus.view.screen.main;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Matrix;
+import android.os.Handler;
 import android.support.annotation.Nullable;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
@@ -58,16 +59,73 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
   private int screenHeight;
   private int spaceWidth;
 
-  public MainCategoryContentsImageView(Context context, View view) {
+  private int categoryIndex;
+
+  public MainCategoryContentsImageView(Context context, View view, int index) {
     super(context, view);
+
+    this.categoryIndex = index;
+  }
+
+  @Override
+  public void onScrolledVertical(RecyclerView recyclerView, int dx, int dy) {
+    if (categoryIndex == 1) {
+      onScrolledForText();
+    }
+    onScrolledForImage();
   }
 
   @Override
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-    onScrolledInternal();
+  public void onScrolledHorizontal(RecyclerView recyclerView, int dx, int dy) {
+    if (categoryIndex == 1) {
+      onScrolledForText();
+    }
+    onScrolledForImage();
   }
 
-  private void onScrolledInternal() {
+  private void onScrolledForText() {
+    /**
+     * 화면 높이 - 71 보다 아래에 있으면 해당 위치까지 위치시키고,
+     * 내부의 위치가 152보다 높으면 제한
+     */
+
+
+    // text
+    int cy = getScreenY(textBig);
+
+    // 적당한 위치에 있을 때만 처리한다.
+    // 화면 밖일 경우도 있으므로 스크린 높이의 2배를 허용.
+    if (cy >= 0 && cy < (screenHeight << 2)) {
+      moveText(cy);
+    }
+
+  }
+
+  private void moveText(int cy) {
+    int ty;
+    int gap;
+    int y;
+    int max;
+    int min;
+    ty = textPositionTargetYOnScreen;
+    gap = ty - cy;
+    Log.i("APP# MainCategoryContentsImageView | moveText", "|" + " cy: " + cy + ", ty: " + ty + ", gap: " + gap + ", this:" + this.hashCode());
+
+    y = (int) (textBig.getY() + gap);
+    // 뷰 영역 안에서만 이동 가능
+    max = textPositionMaxYOnMask;
+    min = -400;    // 위쪽으로 사라지도록 0 보다 작은 값
+    if (y > max) {
+      y = max;
+    }
+    else if (y < min) {
+      y = min;
+    }
+    textBig.setY(y);
+  }
+
+
+  private void onScrolledForImage() {
     /**
      * 화면 높이 - 71 보다 아래에 있으면 해당 위치까지 위치시키고,
      * 내부의 위치가 152보다 높으면 제한
@@ -76,187 +134,162 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
     int cx;
     int cy;
     int ty;
-    int tx;
-    int gap;
+    int tx = 0;
     int x;
     int y;
     float dx = 0f;
     float dy = 0f;
-    int max;
-    int min;
     float ratio;
 
-    // text
-    /*if (null != textBig) {
-      cy = getScreenY(textBig);
-
-      // 적당한 위치에 있을 때만 처리한다.
-      if (cy > 0 && cy < (screenHeight << 1)) {
-        ty = textPositionTargetYOnScreen;
-        gap = ty - cy;
-//        Log.i("APP# MainCategoryContentsImageView | onScrolled", "|" + " cy: " + cy + ", ty: " + ty + ", gap: " + gap + ", this:" + this.hashCode());
-
-        y = (int) (textBig.getY() + gap);
-        // 뷰 영역 안에서만 이동 가능
-        max = textPositionMaxYOnMask;
-        min = -400;    // 위쪽으로 사라지도록 0 보다 작은 값
-        if (y > max) {
-          y = max;
-        }
-        else if (y < min) {
-          y = min;
-        }
-        textBig.setY(y);
-      }
-    }*/
-
     // image
-    if (null != imageView) {
-      Matrix matrix = new Matrix();
-      matrix.set(imageView.getImageMatrix());
-      // Get the values of the matrix
-      float[] values = new float[9];
-      matrix.getValues(values);
-
-      // 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.
-
-      /**
-       * * 이미지가 스크린보다 작을 때
-       *           │                       │
-       *           ├────────┐     ┌────────┤
-       *           │image   │     │  img   │
-       *           ├──────┐ │     │ ┌──────┤
-       *           │      │ │     │ │      │
-       *           │ mask │ │     │ │ mask │
-       *           ├──────┘ │     │ └──────┤
-       *           ├────────┘     └────────┤
-       *           │                       │
-       *           │0                      │ screen width
-       *
-       *
-       *  * 이미지가 스크린보다 클 때
-       *           │                       │
-       *  ┌────────┼───────────────────────┤
-       *  │  img   │                       │
-       *  │        │                       ├──────┐
-       *  │        │                       │      │
-       *  │        │                       │ mask │
-       *  │        │                       ├──────┘
-       *  └────────┼───────────────────────┤
-       *           │                       │
-       *           │0                      │ screen width
-       *           ├───────────────────────┼────────┐
-       *           │image                  │        │
-       *    ┌──────┤                       │        │
-       *    │      │                       │        │
-       *    │ mask │                       │        │
-       *    └──────┤                       │        │
-       *           ├───────────────────────┼────────┘
-       *              mask == itemView
-       */
-
-      /**
-       mask.x : 0 ~ screen.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)
-
-       - 화면에 표시되는 영역만 계산하고 나머지는 비율에 맞게 움직이도록 처리
-
-       */
-
-      x = (int) itemView.getX();
-
-      if (x > -maskWidth && x < screenWidth) {  // holder 가 표시되는 부분에서만 계산
-
-        // modify itemView x -------------------------------------------------
-        tx = 0;
-//        cx = x + (maskWidth >> 1);
-//        ratio = (float) -cx / (maskWidth >> 1);
-//
-//        if (ratio > 1) {
-//          ratio = 1;
-//        }
-//        else if (ratio < 0) {
-//          ratio = 0;
-//        }
-//        tx = (int) -(spaceWidth * ratio);
-//
-//        // 이미지와 dim 마스크 함께 이동.
-//        imageView.setX(tx);
-//        mask0.setX(tx);
-//        mask1.setX(tx);
-//        mask2.setX(tx);
-        // modify itemView x -------------------------------------------------
-
-        // bitmap x -------------------------------------------------------
-        if (imageWidth > screenWidth) {
-          /**
-           * 이미지가 스크린보다 클 때
-           */
-          // x = 0 ~ image.w - screen.w
-          ratio = (float) (maskWidth + x) / (maskWidth + screenWidth);
-          tx = -((int) ((imageWidth + maskWidth) * ratio)) + maskWidth - tx;  // image 이동 구간 -image.w ~ mask.w, 이미지 view 이동 구간 반영
-        }
-        else {
-          /**
-           * 이미지가 스크린보다 작을 때
-           */
-          // x = 0 ~ screen.w - mask.w
-          ratio = (float) x / (screenWidth - maskWidth);
-          tx = -((int) ((imageWidth - maskWidth) * ratio)) - tx;  // image 이동 구간 0 ~ -image.w-mask.w, 이미지 view 이동 구간 반영
-        }
+    Matrix matrix = new Matrix();
+    matrix.set(imageView.getImageMatrix());
+    // Get the values of the matrix
+    float[] values = new float[9];
+    matrix.getValues(values);
 
-        cx = (int) values[2];
-        dx = tx - cx;
-        // bitmap x -------------------------------------------------------
+    // 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.
 
-//        if (index == 2) {
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " x: " + x);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " ratio: " + ratio);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " imageWidth: " + imageWidth);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " maskWidth: " + maskWidth);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " tx: " + tx);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "|" + " dx: " + dx);
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "| item x: " + itemView.getX());
-//          Log.i("APP# MainCategoryContentsImageView | onScrolledInternal", "| item y: " + itemView.getY());
-//        }
-      }
+    /**
+     * * 이미지가 스크린보다 작을 때
+     *           │                       │
+     *           ├────────┐     ┌────────┤
+     *           │image   │     │  img   │
+     *           ├──────┐ │     │ ┌──────┤
+     *           │      │ │     │ │      │
+     *           │ mask │ │     │ │ mask │
+     *           ├──────┘ │     │ └──────┤
+     *           ├────────┘     └────────┤
+     *           │                       │
+     *           │0                      │ screen width
+     *
+     *
+     *  * 이미지가 스크린보다 클 때
+     *           │                       │
+     *  ┌────────┼───────────────────────┤
+     *  │  img   │                       │
+     *  │        │                       ├──────┐
+     *  │        │                       │      │
+     *  │        │                       │ mask │
+     *  │        │                       ├──────┘
+     *  └────────┼───────────────────────┤
+     *           │                       │
+     *           │0                      │ screen width
+     *           ├───────────────────────┼────────┐
+     *           │image                  │        │
+     *    ┌──────┤                       │        │
+     *    │      │                       │        │
+     *    │ mask │                       │        │
+     *    └──────┤                       │        │
+     *           ├───────────────────────┼────────┘
+     *              mask == itemView
+     */
 
+    /**
+     mask.x : 0 ~ screen.w-mask.w
 
-      y = getScreenY(itemView);
+     if mask.x == 0 => image.x = 0;
+     if mask.x == screen.w-mask.w => image.x = image.w-mask.w
 
-      if (y > -maskHeight && y < screenHeight) {  // holder 가 표시되는 부분에서만 계산
+     image.x : 0 ~ -(image.w-mask.w)
 
-        // bitmap y -------------------------------------------------------
-        if (imageHeight > screenHeight) {
-          /**
-           * 이미지가 스크린보다 클 때
-           */
-          ratio = (float) (maskHeight + y) / (maskHeight + screenHeight);
-          ty = -((int) ((imageHeight + maskHeight) * ratio)) + maskHeight;
-        }
-        else {
-          /**
-           * 이미지가 스크린보다 작을 때
-           */
-          ratio = (float) y / (screenHeight - maskHeight);
-          ty = -((int) ((imageHeight - maskHeight) * ratio));
-        }
-        cy = (int) values[5];
-        dy = ty - cy;
-        // bitmap y -------------------------------------------------------
+     - 화면에 표시되는 영역만 계산하고 나머지는 비율에 맞게 움직이도록 처리
+
+     */
+
+    x = (int) itemView.getX();
+
+    if (x > -maskWidth && x < screenWidth) {  // holder 가 표시되는 부분에서만 계산
+
+      // modify itemView x -------------------------------------------------
+      int widthHalf = maskWidth >> 1;
+      cx = x + widthHalf;
+      ratio = (float) cx / (widthHalf - spaceWidth);
 
+//      if (index == 0) {
+//        Log.w("APP# MainCategoryContentsImageView | onScrolledForImage", "| x: " + x + ", cx: " + cx + ", ratio: " + ratio);
+//      }
+
+      if (ratio < -1) {
+        ratio = -1;
+      }
+      else if (ratio > 0) {
+        ratio = 0;
+      }
+      tx = (int) (spaceWidth * ratio);
+
+      // 이미지와 dim 마스크 함께 이동.
+      imageView.setX(tx);
+      mask0.setX(tx);
+      mask1.setX(tx);
+      mask2.setX(tx);
+      // modify itemView x -------------------------------------------------
+
+      // bitmap x -------------------------------------------------------
+      if (imageWidth > screenWidth) {
+        /**
+         * 이미지가 스크린보다 클 때
+         */
+        // x = 0 ~ image.w - screen.w
+        ratio = (float) (maskWidth + x) / (maskWidth + screenWidth);
+        tx = -((int) ((imageWidth + maskWidth) * ratio)) + maskWidth - tx;  // image 이동 구간 -image.w ~ mask.w, 이미지 view 이동 구간 반영
       }
+      else {
+        /**
+         * 이미지가 스크린보다 작을 때
+         */
+        // x = 0 ~ screen.w - mask.w
+        ratio = (float) x / (screenWidth - maskWidth);
+        tx = -((int) ((imageWidth - maskWidth) * ratio)) - tx;  // image 이동 구간 0 ~ -image.w-mask.w, 이미지 view 이동 구간 반영
+      }
+
+      cx = (int) values[2];
+      dx = tx - cx;
+      // bitmap x -------------------------------------------------------
+
+//        if (index == 2) {
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " x: " + x);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " ratio: " + ratio);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " imageWidth: " + imageWidth);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " maskWidth: " + maskWidth);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " tx: " + tx);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "|" + " dx: " + dx);
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "| item x: " + itemView.getX());
+//          Log.i("APP# MainCategoryContentsImageView | onScrolledForText", "| item y: " + itemView.getY());
+//        }
+    }
 
-      matrix.postTranslate(dx, dy);
 
-      imageView.setImageMatrix(matrix);
+    y = getScreenY(itemView);
+
+    if (y > -maskHeight && y < screenHeight) {  // holder 가 표시되는 부분에서만 계산
+
+      // bitmap y -------------------------------------------------------
+      if (imageHeight > screenHeight) {
+        /**
+         * 이미지가 스크린보다 클 때
+         */
+        ratio = (float) (maskHeight + y) / (maskHeight + screenHeight);
+        ty = -((int) ((imageHeight + maskHeight) * ratio)) + maskHeight;
+      }
+      else {
+        /**
+         * 이미지가 스크린보다 작을 때
+         */
+        ratio = (float) y / (screenHeight - maskHeight);
+        ty = -((int) ((imageHeight - maskHeight) * ratio));
+      }
+      cy = (int) values[5];
+      dy = ty - cy;
+      // bitmap y -------------------------------------------------------
+
     }
 
+    matrix.postTranslate(dx, dy);
+
+    imageView.setImageMatrix(matrix);
+
   }
 
 
@@ -285,11 +318,12 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
     maskWidth = ResourceUtil.getDimension(R.dimen.main_contents_image_width);
     maskHeight = ResourceUtil.getDimension(R.dimen.main_contents_image_height);
 
-    spaceWidth = ResourceUtil.getDimension(R.dimen.main_contents_start_gap);
+    spaceWidth = ResourceUtil.getDimension(R.dimen.main_contents_start_gap) - ResourceUtil.getDimension(R.dimen.main_contents_image_padding_end);
 
     String url = bean.getImageUrl();
 
-    onScrolledInternal();
+    // 텍스트 위치 조절
+    new Handler().post(() -> moveText(getScreenY(textBig)));
 
     imageWidth = Math.max(maskWidth + ResourceUtil.dpToPx(50), screenWidth - ResourceUtil.dpToPx(50));
     imageHeight = maskHeight + ResourceUtil.dpToPx(50);
@@ -317,15 +351,13 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
           Log.i("APP# MainCategoryContentsImageView | init", "| maskWidth: " + maskWidth + ", maskHeight: " + maskHeight);
           Log.i("APP# MainCategoryContentsImageView | init", "| imageWidth: " + imageLoadedWidth + ", imageHeight: " + imageLoadedHeight);
 
-          onScrolledInternal();
+          onScrolledForImage();
 
           return false;
         }
 
       })
       .into(imageView);
-
-
   }
 
   @Override

+ 6 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainCategoryContentsTailView.java

@@ -29,10 +29,15 @@ public class MainCategoryContentsTailView extends MainCategoryContentsView {
   }
 
   @Override
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+  public void onScrolledVertical(RecyclerView recyclerView, int dx, int dy) {
 
   }
 
+  @Override
+  public void onScrolledHorizontal(RecyclerView recyclerView, int dx, int dy) {
+    
+  }
+
   @Override
   public void init(int index, MainContentsCategoryBean bean, IEventListener listener) {
     getView().findViewById(R.id.text_more).setOnClickListener(v -> listener.onEvent(new Event.Builder(Event.MORE).build()));

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

@@ -48,7 +48,9 @@ public abstract class MainCategoryContentsView extends RecyclerView.ViewHolder {
    * @param dx
    * @param dy
    */
-  public abstract void onScrolled(RecyclerView recyclerView, int dx, int dy);
+  public abstract void onScrolledVertical(RecyclerView recyclerView, int dx, int dy);
+
+  public abstract void onScrolledHorizontal(RecyclerView recyclerView, int dx, int dy);
 
 
   /**

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

@@ -64,7 +64,7 @@ public class MainCategorySnapper extends RecyclerView.OnFlingListener {
 
       @Override
       public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-//        Log.i("APP# MainCategorySnapper | onScrolled", "|" + "dx: " + dx);
+//        Log.i("APP# MainCategorySnapper | onScrolledVertical", "|" + "dx: " + dx);
         if (dx != 0 || dy != 0) {
           mScrolled = true;
         }

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

@@ -110,7 +110,7 @@ public class MainContentsAdapter extends RecyclerView.Adapter<MainContentsHolder
   public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
     for (MainContentsHolder holder : holders) {
       if (null != holder) {
-        holder.onScrolled(recyclerView, dx, dy);
+        holder.onScrolledVertical(recyclerView, dx, dy);
       }
     }
   }

+ 6 - 6
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainContentsCategoryHolder.java

@@ -36,9 +36,9 @@ public class MainContentsCategoryHolder extends MainContentsHolder {
   }
 
   @Override
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+  public void onScrolledVertical(RecyclerView recyclerView, int dx, int dy) {
     if (null != adapter) {
-      adapter.onScrolled(recyclerView, dx, dy);
+      adapter.onScrolledVertical(recyclerView, dx, dy);
     }
   }
 
@@ -66,11 +66,11 @@ public class MainContentsCategoryHolder extends MainContentsHolder {
     recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
 
     if (recyclerView.getOnFlingListener() == null) {
-      MainCategorySnapper snapper = new MainCategorySnapper(1000, ResourceUtil.dpToPx(57));
+      MainCategorySnapper snapper = new MainCategorySnapper(1000, ResourceUtil.getDimension(R.dimen.main_contents_start_gap));
       snapper.attachToRecyclerView(recyclerView);
     }
 
-    adapter = new MainCategoryContentsAdapter(context, bean, event -> {
+    adapter = new MainCategoryContentsAdapter(context, bean, index, event -> {
       /**
        * more 는 그대로 전송하고
        * contents 에는 data index 를 추가한다.
@@ -94,13 +94,13 @@ public class MainContentsCategoryHolder extends MainContentsHolder {
       @Override
       public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
         if (null != adapter) {
-          adapter.onScrolled(recyclerView, dx, dy);
+          adapter.onScrolledHorizontal(recyclerView, dx, dy);
           /**
            * 스크롤 시킬 조건
            * - 1번 카테고리가 화면에서 벗어나 있을 때, (아래 쪽이 잘렸을 때)
            */
           if (index == 1 && dx != 0) {
-//            Log.i("APP# MainContentsCategoryHolder | onScrolled", "|" + "---------------------------------------" + dx + ", " + dy);
+//            Log.i("APP# MainContentsCategoryHolder | onScrolledVertical", "|" + "---------------------------------------" + dx + ", " + dy);
 //            listener.onEvent(new Event.Builder(Event.SCROLL).build());
           }
         }

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

@@ -46,7 +46,7 @@ public abstract class MainContentsHolder extends RecyclerView.ViewHolder {
    * @param dx
    * @param dy
    */
-  public abstract void onScrolled(RecyclerView recyclerView, int dx, int dy);
+  public abstract void onScrolledVertical(RecyclerView recyclerView, int dx, int dy);
 
   /**
    * 포커스 상태인지 판단해줌. 여기서 포커스는 indicator 를 활성화 시켜줄 목적

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

@@ -65,7 +65,7 @@ public class MainContentsSnapper extends RecyclerView.OnFlingListener {
 
       @Override
       public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
-//        Log.i("APP# MainContentsSnapper | onScrolled", "|" + "dx: " + dx);
+//        Log.i("APP# MainContentsSnapper | onScrolledVertical", "|" + "dx: " + dx);
         if (dx != 0 || dy != 0) {
           mScrolled = true;
         }

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

@@ -33,7 +33,7 @@ public class MainContentsWeatherHolder extends MainContentsHolder /*implements V
   }
 
   @Override
-  public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+  public void onScrolledVertical(RecyclerView recyclerView, int dx, int dy) {
 
     // 초기 위치가 설정된 후 작동
     if (0 <= initY) {

+ 9 - 8
app/src/main/res/layout/main_contents_category_image.xml

@@ -5,7 +5,7 @@
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
-  android:paddingEnd="12dp">
+  android:paddingEnd="@dimen/main_contents_image_padding_end">
 
   <ImageView
     android:id="@+id/image_contents"
@@ -41,13 +41,14 @@
     android:orientation="vertical"
     app:layout_constraintGuide_begin="32dp"/>
 
-  <android.support.constraint.Guideline
-    android:id="@+id/guide_horizontal"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal"
-    app:layout_constraintGuide_begin="218dp"/>
+  <!--<android.support.constraint.Guideline-->
+    <!--android:id="@+id/guide_horizontal"-->
+    <!--android:layout_width="match_parent"-->
+    <!--android:layout_height="match_parent"-->
+    <!--android:orientation="horizontal"-->
+    <!--app:layout_constraintGuide_begin="218dp"/>-->
   <TextView
+    android:layout_marginTop="218dp"
     android:id="@+id/text_big"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
@@ -56,7 +57,7 @@
     android:textSize="19sp"
     android:textStyle="bold"
     app:layout_constraintStart_toStartOf="@+id/guide_vertical"
-    app:layout_constraintTop_toTopOf="@+id/guide_horizontal"
+    app:layout_constraintTop_toTopOf="parent"
     tools:text="며느리도 모르는\n신당동 핫플"/>
 
   <TextView

+ 1 - 0
app/src/main/res/values/dimens.xml

@@ -9,5 +9,6 @@
   <dimen name="main_contents_start_gap">57dp</dimen>
   <dimen name="main_contents_image_width">285dp</dimen>
   <dimen name="main_contents_image_height">328dp</dimen>
+  <dimen name="main_contents_image_padding_end">12dp</dimen>
 
 </resources>