Sfoglia il codice sorgente

[메인][New] 날씨 텍스트 이동 거리 줄임, 이미지 스페이싱 진행 거리 조절

hyodong.min 7 anni fa
parent
commit
73bf50616c

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

@@ -172,8 +172,8 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
       if (x > -maskWidth && x < screenWidth) {  // holder 가 표시되는 부분에서만 계산
 
         // modify itemView x -------------------------------------------------
-        cx = x;
-        ratio = (float) -cx / maskWidth;
+        cx = x + (maskWidth >> 1);
+        ratio = (float) -cx / (maskWidth >> 1);
 
         if (ratio > 1) {
           ratio = 1;
@@ -198,7 +198,7 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
            */
           // x = 0 ~ screen.w - mask.w
           ratio = (float) x / (screenWidth - maskWidth);
-          tx = -((int) ((imageWidth - maskWidth) * ratio));  // image 이동 구간 0 ~ -image.w-mask.w
+          tx = -((int) ((imageWidth - maskWidth) * ratio)) - tx;  // image 이동 구간 0 ~ -image.w-mask.w, 이미지 view 이동 구간 반영
 
         }
         else {
@@ -207,7 +207,7 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
            */
           // x = 0 ~ image.w - screen.w
           ratio = (float) (maskWidth + x) / (maskWidth + screenWidth);
-          tx = -((int) ((imageWidth + maskWidth) * ratio)) + maskWidth;  // image 이동 구간 -image.w ~ mask.w
+          tx = -((int) ((imageWidth + maskWidth) * ratio)) + maskWidth - tx;  // image 이동 구간 -image.w ~ mask.w, 이미지 view 이동 구간 반영
         }
 
         cx = (int) values[2];

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

@@ -60,7 +60,7 @@ public class MainContentsWeatherHolder extends MainContentsHolder /*implements V
     return false;
   }
 
-  private int weatherArea = -ResourceUtil.dpToPx(100);
+  private int weatherArea = -ResourceUtil.dpToPx(30); // 값이 클 수록 글자가 오래 머물러 있음.
   private float initY = -8969;
   private float initWeatherY;
   private ViewGroup weather;