|
@@ -110,7 +110,8 @@ public class ChangduSeriesCardBuilder {
|
|
|
if (bound) {
|
|
if (bound) {
|
|
|
elements.add(buildBoundTypeDiv(selectedType));
|
|
elements.add(buildBoundTypeDiv(selectedType));
|
|
|
} else {
|
|
} else {
|
|
|
- elements.add(buildTypeRow(candidate, imageKey));
|
|
|
|
|
|
|
+ elements.add(buildInfoDiv("短剧类型:"));
|
|
|
|
|
+ elements.add(buildTypeActions(candidate, imageKey));
|
|
|
}
|
|
}
|
|
|
column.put("elements", elements);
|
|
column.put("elements", elements);
|
|
|
return column;
|
|
return column;
|
|
@@ -181,42 +182,26 @@ public class ChangduSeriesCardBuilder {
|
|
|
return column;
|
|
return column;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private JSONObject buildTypeRow(ChangduSeriesCardCandidate candidate, String imageKey) {
|
|
|
|
|
- JSONObject container = new JSONObject();
|
|
|
|
|
- container.put("tag", "column_set");
|
|
|
|
|
- container.put("horizontal_align", "left");
|
|
|
|
|
- container.put("horizontal_spacing", "4px");
|
|
|
|
|
- container.put("flex_mode", "none");
|
|
|
|
|
|
|
+ private JSONObject buildTypeActions(ChangduSeriesCardCandidate candidate, String imageKey) {
|
|
|
|
|
+ JSONObject columnSet = new JSONObject();
|
|
|
|
|
+ columnSet.put("tag", "column_set");
|
|
|
|
|
+ columnSet.put("horizontal_spacing", "8px");
|
|
|
|
|
+ columnSet.put("horizontal_align", "left");
|
|
|
|
|
+ columnSet.put("flex_mode", "flow");
|
|
|
|
|
|
|
|
JSONArray columns = new JSONArray();
|
|
JSONArray columns = new JSONArray();
|
|
|
- columns.add(buildInlineTextColumn("短剧类型:"));
|
|
|
|
|
for (String typeValue : ChangduSeriesCardConstants.TYPE_OPTIONS) {
|
|
for (String typeValue : ChangduSeriesCardConstants.TYPE_OPTIONS) {
|
|
|
- columns.add(buildInlineButtonColumn(buildTypeButton(candidate, imageKey, typeValue)));
|
|
|
|
|
|
|
+ JSONObject column = new JSONObject();
|
|
|
|
|
+ column.put("tag", "column");
|
|
|
|
|
+ column.put("width", "auto");
|
|
|
|
|
+ column.put("vertical_align", "center");
|
|
|
|
|
+ JSONArray elements = new JSONArray();
|
|
|
|
|
+ elements.add(buildTypeButton(candidate, imageKey, typeValue));
|
|
|
|
|
+ column.put("elements", elements);
|
|
|
|
|
+ columns.add(column);
|
|
|
}
|
|
}
|
|
|
- container.put("columns", columns);
|
|
|
|
|
- return container;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private JSONObject buildInlineTextColumn(String content) {
|
|
|
|
|
- JSONObject column = new JSONObject();
|
|
|
|
|
- column.put("tag", "column");
|
|
|
|
|
- column.put("width", "auto");
|
|
|
|
|
- column.put("vertical_align", "center");
|
|
|
|
|
- JSONArray elements = new JSONArray();
|
|
|
|
|
- elements.add(buildInfoDiv(content));
|
|
|
|
|
- column.put("elements", elements);
|
|
|
|
|
- return column;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private JSONObject buildInlineButtonColumn(JSONObject button) {
|
|
|
|
|
- JSONObject column = new JSONObject();
|
|
|
|
|
- column.put("tag", "column");
|
|
|
|
|
- column.put("width", "auto");
|
|
|
|
|
- column.put("vertical_align", "center");
|
|
|
|
|
- JSONArray elements = new JSONArray();
|
|
|
|
|
- elements.add(button);
|
|
|
|
|
- column.put("elements", elements);
|
|
|
|
|
- return column;
|
|
|
|
|
|
|
+ columnSet.put("columns", columns);
|
|
|
|
|
+ return columnSet;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private JSONObject buildTypeButton(ChangduSeriesCardCandidate candidate, String imageKey, String seriesType) {
|
|
private JSONObject buildTypeButton(ChangduSeriesCardCandidate candidate, String imageKey, String seriesType) {
|