android: fix flowlayout read item's identifier error

This commit is contained in:
pengfei.zhou 2021-10-12 17:08:37 +08:00 committed by osborn
parent eaaa2c457a
commit c60ba612f5

View File

@ -102,8 +102,8 @@ class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.DoricViewHolder> {
}
JSValue value = getItemModel(position);
if (value != null && value.isObject()) {
if (value.asObject().getProperty("identifier").isString()) {
return value.asObject().getProperty("identifier").asString().value().hashCode();
if (value.asObject().getProperty("props").asObject().getProperty("identifier").isString()) {
return value.asObject().getProperty("props").asObject().getProperty("identifier").asString().value().hashCode();
}
}
return super.getItemViewType(position);