Android: fix listItem cannot be animated
This commit is contained in:
		| @@ -236,14 +236,16 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr | ||||
|                 padding.top - rowSpace / 2, | ||||
|                 padding.right - columnSpace / 2, | ||||
|                 padding.bottom - rowSpace / 2); | ||||
|         if (mView != null) { | ||||
|             mView.post(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     flowAdapter.itemCount = itemCount; | ||||
|                     flowAdapter.notifyDataSetChanged(); | ||||
|                 } | ||||
|             }); | ||||
|         if (jsObject.propertySet().size() > 1 || !jsObject.propertySet().contains("subviews")) { | ||||
|             if (mView != null) { | ||||
|                 mView.post(new Runnable() { | ||||
|                     @Override | ||||
|                     public void run() { | ||||
|                         flowAdapter.itemCount = itemCount; | ||||
|                         flowAdapter.notifyDataSetChanged(); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -168,16 +168,19 @@ public class ListNode extends SuperNode<RecyclerView> implements IDoricScrollabl | ||||
|     @Override | ||||
|     public void blend(JSObject jsObject) { | ||||
|         super.blend(jsObject); | ||||
|         if (mView != null) { | ||||
|             mView.post(new Runnable() { | ||||
|                 @SuppressLint("NotifyDataSetChanged") | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     listAdapter.itemCount = itemCount; | ||||
|                     listAdapter.notifyDataSetChanged(); | ||||
|                 } | ||||
|             }); | ||||
|         if (jsObject.propertySet().size() > 1 || !jsObject.propertySet().contains("subviews")) { | ||||
|             if (mView != null) { | ||||
|                 mView.post(new Runnable() { | ||||
|                     @SuppressLint("NotifyDataSetChanged") | ||||
|                     @Override | ||||
|                     public void run() { | ||||
|                         listAdapter.itemCount = itemCount; | ||||
|                         listAdapter.notifyDataSetChanged(); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
| @@ -162,24 +162,24 @@ public class SliderNode extends SuperNode<RecyclerView> { | ||||
|         } | ||||
|  | ||||
|         slideAdapter.loop = loop; | ||||
|  | ||||
|         if (mView != null) { | ||||
|             mView.post(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     slideAdapter.itemCount = itemCount; | ||||
|                     slideAdapter.notifyDataSetChanged(); | ||||
|  | ||||
|                     if (needToScroll) { | ||||
|                         mView.post(new Runnable() { | ||||
|                             @Override | ||||
|                             public void run() { | ||||
|                                 mView.scrollToPosition(1); | ||||
|                             } | ||||
|                         }); | ||||
|         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 | ||||
|                                 public void run() { | ||||
|                                     mView.scrollToPosition(1); | ||||
|                                 } | ||||
|                             }); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             }); | ||||
|                 }); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user