WXScroller extends WXVContainer<ViewGroup> implements WXScrollViewListener,Scrollable { @Override public void addChild(WXComponent child, int index) { if (child == null || index < -1) { return; } if (child instanceof WXBaseRefresh) { if (!checkRefreshOrLoading(child)) { mRefreshs.add(child); } return; } if (mChildren == null) { mChildren = new ArrayList<>(); } int count = mChildren.size(); index = index >= count ? -1 : index; if (index == -1) { mChildren.add(child); } else { mChildren.add(index, child); } } @Deprecated  WXScroller(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy);  WXScroller(WXSDKInstance instance, WXDomObject node,
                    WXVContainer parent, boolean lazy); @Override ViewGroup getRealView(); @Override void createViewImpl(WXVContainer parent, int index); ViewGroup getInnerView(); @Override void addChild(WXComponent child, int index); @Override void destroy(); @Override int getScrollY(); @Override int getScrollX(); Map<String, HashMap<String, WXComponent>> getStickMap(); @WXComponentProp(name = Constants.Name.SHOW_SCROLLBAR) void setShowScrollbar(boolean show); @Override void bindStickStyle(WXComponent component); @Override void unbindStickStyle(WXComponent component); @Override void bindAppearEvent(WXComponent component); @Override void bindDisappearEvent(WXComponent component); @Override void unbindAppearEvent(WXComponent component); @Override void unbindDisappearEvent(WXComponent component); @Override void scrollTo(WXComponent component,int offset); void scrollBy(final int x, final int y); @Override void onScrollChanged(WXScrollView scrollView, int x, int y,
                              int oldx, int oldy); @Override void onScrollToBottom(WXScrollView scrollView, int x, int y); @Override void onScrollStopped(WXScrollView scrollView, int x, int y); @Override void onScroll(WXScrollView scrollView, int x, int y); static final String DIRECTION; }
@Test public void testAddChild() throws Exception{ WXDiv div = WXDivTest.create(component); component.addChild(div); ComponentTest.create(div); }