Explorar el Código

[콘텐츠상세][Common] 추천콘텐츠 영역 추천콘텐츠 타입에 따라 해당 타이틀, 서브타이틀 변경 임시 구현

Hasemi hace 6 años
padre
commit
3c54647acb

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

@@ -20,6 +20,9 @@ import kr.co.zumo.app.lifeplus.bean.api.WithShownItemBean;
 public class WithShownListBean extends JsonBeanBase {
 
   private List<WithShownItemBean> withItemList;
+  //임시추가
+  private boolean isWithShownPageTagType = true;
+
 
   public List<WithShownItemBean> getWithItemList() {
     return withItemList;
@@ -28,4 +31,12 @@ public class WithShownListBean extends JsonBeanBase {
   public void setWithItemList(List<WithShownItemBean> withItemList) {
     this.withItemList = withItemList;
   }
+
+  public boolean isWithShownPageTagType() {
+    return isWithShownPageTagType;
+  }
+
+  public void setWithShownPageTagType(boolean withShownPageTagType) {
+    isWithShownPageTagType = withShownPageTagType;
+  }
 }

+ 34 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/recommend/RecommendContentsView.java

@@ -43,6 +43,12 @@ public class RecommendContentsView extends ConstraintLayout {
   private IndexScrollListener indexScrollListener;
   private LinearLayoutManager layoutManager;
 
+  private String type;
+
+  public static final String CONTENTS_TAG = "1";
+  public static final String CONTENTS_LOGIC = "2";
+  public static final String EVENT = "3";
+
   public RecommendContentsView(Context context) {
     super(context);
     init(context);
@@ -117,6 +123,13 @@ public class RecommendContentsView extends ConstraintLayout {
 
   }
 
+  public void setWithShownPageType(String type) {
+    this.type = type;
+    if (null != type) {
+      setTitleArea(type);
+    }
+  }
+
   public void draw(Context context, List<WithShownItemBean> withItemList, IEventListener listener) {
     this.withItemList = withItemList;
 
@@ -130,4 +143,25 @@ public class RecommendContentsView extends ConstraintLayout {
     recyclerViewRecommendContents.setAdapter(recommendContentsViewAdapter);
 
   }
+
+  public void setTitleArea(String type) {
+    int titleRes = 0;
+    int subTitleRes = 0;
+
+    switch (type) {
+      case CONTENTS_TAG:
+        titleRes = R.string.with_shown_contents_with_tag;
+        subTitleRes = R.string.with_shown_contents_with_tag_detail;
+        break;
+      case CONTENTS_LOGIC:
+        titleRes = R.string.with_shown_contents;
+        subTitleRes = R.string.with_shown_contents_detail;
+        break;
+      default:
+        break;
+
+    }
+    textViewTitle.setText(titleRes);
+    textViewSubTitle.setText(subTitleRes);
+  }
 }

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

@@ -28,6 +28,7 @@ public class ContentsWithShownHolder extends ContentsHolder<WithShownListBean> {
 
   @Override
   protected void bindInternal() {
+    recommendContentsView.setWithShownPageType(bean.isWithShownPageTagType() ? RecommendContentsView.CONTENTS_TAG : RecommendContentsView.CONTENTS_LOGIC);
     recommendContentsView.draw(itemView.getContext(), bean.getWithItemList(), listener);
   }