Android: fix listItem cannot be animated

This commit is contained in:
pengfei.zhou 2021-12-03 17:33:07 +08:00 committed by osborn
parent 094a0936b9
commit c3093d9ff2
3 changed files with 39 additions and 34 deletions

View File

@ -236,6 +236,7 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
padding.top - rowSpace / 2,
padding.right - columnSpace / 2,
padding.bottom - rowSpace / 2);
if (jsObject.propertySet().size() > 1 || !jsObject.propertySet().contains("subviews")) {
if (mView != null) {
mView.post(new Runnable() {
@Override
@ -246,6 +247,7 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
});
}
}
}
@Override
protected void blendSubNode(JSObject subProperties) {

View File

@ -168,6 +168,7 @@ public class ListNode extends SuperNode<RecyclerView> implements IDoricScrollabl
@Override
public void blend(JSObject jsObject) {
super.blend(jsObject);
if (jsObject.propertySet().size() > 1 || !jsObject.propertySet().contains("subviews")) {
if (mView != null) {
mView.post(new Runnable() {
@SuppressLint("NotifyDataSetChanged")
@ -180,6 +181,8 @@ public class ListNode extends SuperNode<RecyclerView> implements IDoricScrollabl
}
}
}
@Override
protected void blend(RecyclerView view, String name, final JSValue prop) {
switch (name) {

View File

@ -162,14 +162,13 @@ public class SliderNode extends SuperNode<RecyclerView> {
}
slideAdapter.loop = loop;
if (jsObject.propertySet().size() > 1 || !jsObject.propertySet().contains("subviews")) {
if (mView != null) {
mView.post(new Runnable() {
@Override
public void run() {
slideAdapter.itemCount = itemCount;
slideAdapter.notifyDataSetChanged();
if (needToScroll) {
mView.post(new Runnable() {
@Override
@ -182,6 +181,7 @@ public class SliderNode extends SuperNode<RecyclerView> {
});
}
}
}
@Override
protected void blend(RecyclerView view, String name, JSValue prop) {