|
|
@@ -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);
|
|
|
+ }
|
|
|
}
|