Преглед изворни кода

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

Hasemi пре 7 година
родитељ
комит
ea90536666

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/ContentsDescriptionBean.java

@@ -19,9 +19,9 @@ import kr.co.zumo.app.lifeplus.util.StringUtil;
  * @since 2018. 11. 27.
  */
 public class ContentsDescriptionBean extends JsonBeanBase {
-  @SerializedName("itemDtifNo")
+  @SerializedName("itemRecuNo")
   private String itemDescriptionNumber;
-  @SerializedName("dtalCten")
+  @SerializedName("rcmdCaus")
   private String description;
 
   public String getItemDescriptionNumber() {

+ 19 - 8
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/ContentsDetailBean.java

@@ -38,8 +38,11 @@ public class ContentsDetailBean extends LifeplusContentsBean {
   @SerializedName("itemTagList")
   private List<TagBean> tagList;
 
-//  @SerializedName("itemDtalList") // 이미지 아래 세부 내용
-//  private List<ContentsDescriptionBean> descriptionList;
+  @SerializedName("itemDtalList") // more info
+  private List<ContentsMoreInfoBean> moreInfoList;
+
+  @SerializedName("itemRecuList") // 이미지 아래 1. 2... 내용
+  private List<ContentsDescriptionBean> descriptionList;
 
   /**
    * 이미지 리스트 중에서 첫 번째 것을 가져온다.
@@ -102,11 +105,19 @@ public class ContentsDetailBean extends LifeplusContentsBean {
     this.tagList = tagList;
   }
 
-//  public List<ContentsDescriptionBean> getDescriptionList() {
-//    return descriptionList;
-//  }
+  public List<ContentsMoreInfoBean> getMoreInfoList() {
+    return moreInfoList;
+  }
+
+  public void setMoreInfoList(List<ContentsMoreInfoBean> moreInfoList) {
+    this.moreInfoList = moreInfoList;
+  }
 
-//  public void setDescriptionList(List<ContentsDescriptionBean> descriptionList) {
-//    this.descriptionList = descriptionList;
-//  }
+  public List<ContentsDescriptionBean> getDescriptionList() {
+    return descriptionList;
+  }
+
+  public void setDescriptionList(List<ContentsDescriptionBean> descriptionList) {
+    this.descriptionList = descriptionList;
+  }
 }

+ 46 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/ContentsMoreInfoBean.java

@@ -0,0 +1,46 @@
+/*
+ * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
+ */
+package kr.co.zumo.app.lifeplus.bean.api;
+
+import com.google.gson.annotations.SerializedName;
+
+import kr.co.zumo.app.lifeplus.bean.JsonBeanBase;
+import kr.co.zumo.app.lifeplus.util.StringUtil;
+
+/**
+ * ContentsDescriptionBean
+ * <pre>
+ * </pre>
+ *
+ * @author 민효동
+ * @version 1.0
+ * @history 민효동   [2018. 11. 27.]   [최초 작성]
+ * @since 2018. 11. 27.
+ */
+public class ContentsMoreInfoBean extends JsonBeanBase {
+  @SerializedName("itemDtifNo")
+  private String itemMoreInfoNumber;
+  @SerializedName("dtalCten")
+  private String moreInfo;
+
+  public String getItemMoreInfoNumber() {
+    return itemMoreInfoNumber;
+  }
+
+  public void setItemMoreInfoNumber(String itemMoreInfoNumber) {
+    this.itemMoreInfoNumber = itemMoreInfoNumber;
+  }
+
+  public String getMoreInfo() {
+    return StringUtil.stripHtml(moreInfo);
+  }
+
+  public void setMoreInfo(String moreInfo) {
+    this.moreInfo = moreInfo;
+  }
+
+  public String getDescriptionWithHtml() {
+    return moreInfo;
+  }
+}

+ 4 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsDetailModel.java

@@ -1,5 +1,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.contents;
 
+import android.util.Log;
+
 import io.reactivex.disposables.Disposable;
 import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailListBean;
 import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailResultBean;
@@ -44,6 +46,8 @@ public class ContentsDetailModel extends ContentsModel {
       public void onApiSuccess(ContentsDetailResultBean resultBean) {
         contentsDetailListBean = resultBean.getData();
 
+        Log.w("APP# ContentsDetailModel | onApiSuccess", "|\n" + contentsDetailListBean.toPrettyJson());
+
         onResult(new Event.Builder(Event.SUCCESS).index(Event.LOADED_DETAIL).build());
       }
 

+ 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;