fix: Android list reuse identifier get error

This commit is contained in:
王劲鹏 2021-07-21 17:46:24 +08:00 committed by osborn
parent cd9f08fa97
commit 37f8898eac

View File

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