use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXListComponentTest method testAppear.
@Test
public void testAppear() throws Exception {
WXComponent child = WXDivTest.create(component);
ComponentTest.create(child);
component.addChild(child);
component.bindAppearEvent(child);
component.notifyAppearStateChange(0, 0, 0, 10);
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXListComponentTest method testAddChild.
@Test
public void testAddChild() throws Exception {
WXComponent child = WXDivTest.create(component);
ComponentTest.create(child);
component.addChild(child);
child = WXHeaderTest.create(component);
ComponentTest.create(child);
component.addChild(child);
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXRenderStatement method setExtra.
/**
* set extra information of View
*/
void setExtra(String ref, Object extra) {
WXComponent component = mRegistry.get(ref);
if (component == null) {
return;
}
component.updateExtra(extra);
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXRenderStatement method removeComponent.
/**
*@see com.taobao.weex.dom.WXDomStatement#removeDom(String)
*/
WXComponent removeComponent(String ref) {
WXComponent component = mRegistry.get(ref);
if (component == null || component.getParent() == null) {
return component;
}
WXVContainer parent = component.getParent();
clearRegistryForComponent(component);
parent.remove(component, true);
mRegistry.remove(ref);
return component;
}
use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.
the class WXRenderStatement method clearRegistryForComponent.
/**
* Clear registry information that current instance contains.
*/
private void clearRegistryForComponent(WXComponent component) {
WXComponent removedComponent = mRegistry.remove(component.getDomObject().getRef());
if (removedComponent != null) {
removedComponent.removeAllEvent();
removedComponent.removeStickyStyle();
}
if (component instanceof WXVContainer) {
WXVContainer container = (WXVContainer) component;
int count = container.childCount();
for (int i = count - 1; i >= 0; --i) {
clearRegistryForComponent(container.getChild(i));
}
}
}
Aggregations