Search in sources :

Example 71 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project incubator-weex by apache.

the class RemoveElementAction method executeRender.

@Override
public void executeRender(RenderActionContext context) {
    WXComponent component = context.getComponent(mRef);
    if (component == null || component.getParent() == null) {
        return;
    }
    WXVContainer parent = component.getParent();
    clearRegistryForComponent(context, component);
    parent.remove(component, true);
    context.unregisterComponent(mRef);
    WXSDKInstance instance = context.getInstance();
    if (null != instance) {
        instance.onElementChange();
    }
}
Also used : WXVContainer(com.taobao.weex.ui.component.WXVContainer) WXSDKInstance(com.taobao.weex.WXSDKInstance) WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 72 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project incubator-weex by apache.

the class RemoveEventAction method executeRender.

@Override
public void executeRender(RenderActionContext context) {
    WXComponent comp = context.getComponent(mRef);
    if (comp != null) {
        // sync dom change to component
        comp.updateDom(mUpdatedDomObject);
        comp.removeEvent(mEvent);
    }
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 73 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project incubator-weex by apache.

the class ScrollToElementAction method executeRender.

@Override
public void executeRender(RenderActionContext context) {
    WXComponent component = context.getComponent(mRef);
    if (component == null) {
        return;
    }
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    scroller.scrollTo(component, mOptions);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Scrollable(com.taobao.weex.ui.component.Scrollable)

Example 74 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project incubator-weex by apache.

the class DefaultDragHelperTest method onDragStart.

@Test
public void onDragStart() throws Exception {
    WXComponent c = new WXCell(WXSDKInstanceTest.createInstance(), new TestDomObject(), null, false);
    mFakeDragHelper.onDragStart(c, 3);
    verify(mockedEventTrigger).triggerEvent(eq("dragstart"), anyMap());
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) TestDomObject(com.taobao.weex.dom.TestDomObject) WXSDKInstanceTest(com.taobao.weex.WXSDKInstanceTest) WXDivTest(com.taobao.weex.ui.component.WXDivTest) Test(org.junit.Test) ComponentTest(com.taobao.weex.ui.component.ComponentTest)

Example 75 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project incubator-weex by apache.

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)

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