Android: fix load anchor not reset

This commit is contained in:
王劲鹏 2021-11-22 11:27:42 +08:00 committed by osborn
parent 76bcedac98
commit c3e05a39c0
2 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class ListAdapter extends RecyclerView.Adapter<ListAdapter.DoricViewHolder> {
} }
int itemCount = 0; int itemCount = 0;
private int loadAnchor = 0; int loadAnchor = -1;
@NonNull @NonNull
@Override @Override

View File

@ -201,6 +201,7 @@ public class ListNode extends SuperNode<RecyclerView> implements IDoricScrollabl
} }
String funcId = prop.asString().value(); String funcId = prop.asString().value();
if (!funcId.equals(this.renderItemFuncId)) { if (!funcId.equals(this.renderItemFuncId)) {
this.listAdapter.loadAnchor = -1;
this.renderItemFuncId = funcId; this.renderItemFuncId = funcId;
// If reset renderItem,should reset native cache. // If reset renderItem,should reset native cache.
for (int index = 0; index < this.itemValues.size(); index++) { for (int index = 0; index < this.itemValues.size(); index++) {