From c3e05a39c0db87e45e90d150676a7e392a161cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Mon, 22 Nov 2021 11:27:42 +0800 Subject: [PATCH] Android: fix load anchor not reset --- .../doric/src/main/java/pub/doric/shader/list/ListAdapter.java | 2 +- .../doric/src/main/java/pub/doric/shader/list/ListNode.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doric-android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java b/doric-android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java index 6406ca6d..8243c4c7 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/list/ListAdapter.java @@ -47,7 +47,7 @@ class ListAdapter extends RecyclerView.Adapter { } int itemCount = 0; - private int loadAnchor = 0; + int loadAnchor = -1; @NonNull @Override diff --git a/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java b/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java index f6baaf75..13bf8bf1 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/list/ListNode.java @@ -201,6 +201,7 @@ public class ListNode extends SuperNode implements IDoricScrollabl } String funcId = prop.asString().value(); if (!funcId.equals(this.renderItemFuncId)) { + this.listAdapter.loadAnchor = -1; this.renderItemFuncId = funcId; // If reset renderItem,should reset native cache. for (int index = 0; index < this.itemValues.size(); index++) {