android: fix in list, cell changed cause node lost

This commit is contained in:
pengfei.zhou 2023-04-04 10:46:49 +08:00 committed by jingpeng
parent 1add0f564c
commit d89b0a7bbb

View File

@ -127,7 +127,12 @@ public abstract class SuperNode<V extends View> extends ViewNode<V> {
JSValue[] subviews = jsValue.asArray().toArray(); JSValue[] subviews = jsValue.asArray().toArray();
List<JSValue> finalTarget = new ArrayList<>(); List<JSValue> finalTarget = new ArrayList<>();
if (oriSubviews.isArray()) {
JSArray array = oriSubviews.asArray();
for (int i = 0; i < array.size(); i++) {
finalTarget.add(array.get(i));
}
}
for (JSValue subview : subviews) { for (JSValue subview : subviews) {
boolean find = false; boolean find = false;
if (oriSubviews.isArray()) { if (oriSubviews.isArray()) {
@ -135,7 +140,6 @@ public abstract class SuperNode<V extends View> extends ViewNode<V> {
if (viewIdIsEqual(subview.asObject(), targetSubview.asObject())) { if (viewIdIsEqual(subview.asObject(), targetSubview.asObject())) {
find = true; find = true;
recursiveMixin(subview.asObject(), targetSubview.asObject()); recursiveMixin(subview.asObject(), targetSubview.asObject());
finalTarget.add(targetSubview);
break; break;
} }
} }