use of com.tmall.wireless.tangram.structure.BaseCell in project Tangram-Android by alibaba.
the class LinearScrollEntityCard method parseWith.
@Override
public void parseWith(@NonNull JSONObject data, @NonNull MVHelper resolver) {
this.cells.clear();
id = data.optString(Card.KEY_ID, id == null ? "" : id);
this.cardType = data.optString(Card.KEY_TYPE);
// parsing header
JSONObject header = data.optJSONObject(Card.KEY_HEADER);
parseHeaderCell(resolver, header);
// parsing body
JSONArray componentArray = data.optJSONArray(Card.KEY_ITEMS);
if (componentArray != null) {
final int cellLength = componentArray.length();
for (int i = 0; i < cellLength; i++) {
final JSONObject cellData = componentArray.optJSONObject(i);
BaseCell cell = createCell(resolver, cellData, true);
try {
if (cell != null) {
cell.extras.put(MVResolver.KEY_INDEX, cell.pos);
}
} catch (JSONException e) {
}
}
}
// parsing footer
JSONObject footer = data.optJSONObject(Card.KEY_FOOTER);
parseFooterCell(resolver, footer);
JSONObject styleJson = data.optJSONObject(Card.KEY_STYLE);
parseStyle(styleJson);
}
Aggregations