Android: fix load anchor not reset in flow layout

This commit is contained in:
王劲鹏 2021-11-22 11:38:18 +08:00 committed by osborn
parent c3e05a39c0
commit 040823a8af
2 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.DoricViewHolder> {
int itemCount = 0;
int batchCount = 15;
SparseArray<String> itemValues = new SparseArray<>();
private int loadAnchor = 0;
int loadAnchor = -1;
FlowAdapter(FlowLayoutNode flowLayoutNode) {
this.flowLayoutNode = flowLayoutNode;

View File

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