Ver código fonte

[컨텐츠][New] 컨텐츠 bean 정의 2

hyodong.min 7 anos atrás
pai
commit
a6e24ebd44

+ 46 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/ContentsDescriptionBean.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 ContentsDescriptionBean extends JsonBeanBase {
+  @SerializedName("itemDtifNo")
+  private String itemDescriptionNumber;
+  @SerializedName("dtalCten")
+  private String description;
+
+  public String getItemDescriptionNumber() {
+    return itemDescriptionNumber;
+  }
+
+  public void setItemDescriptionNumber(String itemDescriptionNumber) {
+    this.itemDescriptionNumber = itemDescriptionNumber;
+  }
+
+  public String getDescription() {
+    return StringUtil.stripHtml(description);
+  }
+
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  public String getDescriptionWithHtml() {
+    return description;
+  }
+}

+ 11 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/bean/api/ContentsDetailBean.java

@@ -33,6 +33,9 @@ public class ContentsDetailBean extends LifeplusContentsBean {
   @SerializedName("itemTagList")
   private List<TagBean> tagList;
 
+  @SerializedName("itemDtalList") // 이미지 아래 세부 내용
+  private List<ContentsDescriptionBean> descriptionList;
+
   /**
    * 이미지 리스트 중에서 첫 번째 것을 가져온다.
    *
@@ -93,4 +96,12 @@ public class ContentsDetailBean extends LifeplusContentsBean {
   public void setTagList(List<TagBean> tagList) {
     this.tagList = tagList;
   }
+
+  public List<ContentsDescriptionBean> getDescriptionList() {
+    return descriptionList;
+  }
+
+  public void setDescriptionList(List<ContentsDescriptionBean> descriptionList) {
+    this.descriptionList = descriptionList;
+  }
 }

+ 15 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/util/StringUtil.java

@@ -206,6 +206,21 @@ public class StringUtil {
     }
   }
 
+  /**
+   * HTML 을 제외한 String 반환
+   *
+   * @param html
+   * @return
+   */
+  public static String stripHtml(String html) {
+    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
+      return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY).toString();
+    }
+    else {
+      return Html.fromHtml(html).toString();
+    }
+  }
+
   /**
    * 폰 번호 스타일 반환 (국내 전용)
    *

+ 3 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/factory/BasicFragmentFactory.java

@@ -278,6 +278,9 @@ public class BasicFragmentFactory extends FragmentFactory {
       case ScreenID.CONTENTS:
         fragment = new ContentsFragment();
         break;
+      case ScreenID.CONTENTS_NATIVE:
+        fragment = new ContentsDetailFragment();
+        break;
       case ScreenID.OVER_VIEW:
         fragment = new ContentsOverviewFragment();
         break;
@@ -301,9 +304,6 @@ public class BasicFragmentFactory extends FragmentFactory {
       case ScreenID.SERIES:
         fragment = new CategoryMainSeriesFragment();
         break;
-      case ScreenID.CONTENTS_NATIVE:
-        fragment = new ContentsDetailFragment();
-        break;
       default:
         break;
     }