Search in sources :

Example 1 with WXComponent

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);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Test(org.junit.Test) ComponentTest(com.taobao.weex.ui.component.ComponentTest) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest) WXHeaderTest(com.taobao.weex.ui.component.WXHeaderTest) WXDivTest(com.taobao.weex.ui.component.WXDivTest)

Example 2 with WXComponent

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);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Test(org.junit.Test) ComponentTest(com.taobao.weex.ui.component.ComponentTest) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest) WXHeaderTest(com.taobao.weex.ui.component.WXHeaderTest) WXDivTest(com.taobao.weex.ui.component.WXDivTest)

Example 3 with WXComponent

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);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 4 with WXComponent

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;
}
Also used : WXVContainer(com.taobao.weex.ui.component.WXVContainer) WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 5 with WXComponent

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));
        }
    }
}
Also used : WXVContainer(com.taobao.weex.ui.component.WXVContainer) WXComponent(com.taobao.weex.ui.component.WXComponent)

Aggregations

WXComponent (com.taobao.weex.ui.component.WXComponent)101 Point (android.graphics.Point)21 WXDomObject (com.taobao.weex.dom.WXDomObject)20 WXVContainer (com.taobao.weex.ui.component.WXVContainer)19 HashMap (java.util.HashMap)13 View (android.view.View)9 WXSDKInstanceTest (com.taobao.weex.WXSDKInstanceTest)9 WXRecyclerView (com.taobao.weex.ui.view.listview.WXRecyclerView)9 Map (java.util.Map)9 Test (org.junit.Test)9 ArrayMap (android.support.v4.util.ArrayMap)8 RecyclerView (android.support.v7.widget.RecyclerView)8 JSONObject (com.alibaba.fastjson.JSONObject)8 WXSDKInstance (com.taobao.weex.WXSDKInstance)8 ComponentTest (com.taobao.weex.ui.component.ComponentTest)8 WXDivTest (com.taobao.weex.ui.component.WXDivTest)8 Scrollable (com.taobao.weex.ui.component.Scrollable)6 WXBaseRefresh (com.taobao.weex.ui.component.WXBaseRefresh)6 WXHeaderTest (com.taobao.weex.ui.component.WXHeaderTest)6 AppearanceHelper (com.taobao.weex.ui.component.AppearanceHelper)5