Search in sources :

Example 56 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.

the class WXListComponent method createChildViewAt.

@Override
public void createChildViewAt(int index) {
    int indexToCreate = index;
    if (indexToCreate < 0) {
        indexToCreate = childCount() - 1;
        if (indexToCreate < 0) {
            return;
        }
    }
    final WXComponent child = getChild(indexToCreate);
    if (child instanceof WXBaseRefresh) {
        child.createView();
        if (child instanceof WXRefresh) {
            getHostView().setOnRefreshListener((WXRefresh) child);
            getHostView().postDelayed(new Runnable() {

                @Override
                public void run() {
                    getHostView().setHeaderView(child);
                }
            }, 100);
        } else if (child instanceof WXLoading) {
            getHostView().setOnLoadingListener((WXLoading) child);
            getHostView().postDelayed(new Runnable() {

                @Override
                public void run() {
                    getHostView().setFooterView(child);
                }
            }, 100);
        }
    } else {
        super.createChildViewAt(indexToCreate);
    }
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) WXBaseRefresh(com.taobao.weex.ui.component.WXBaseRefresh) WXLoading(com.taobao.weex.ui.component.WXLoading) WXRefresh(com.taobao.weex.ui.component.WXRefresh)

Example 57 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.

the class WXDomStatement method invokeMethod.

void invokeMethod(String ref, String method, JSONArray args) {
    if (mDestroy) {
        return;
    }
    WXComponent comp = mWXRenderManager.getWXComponent(mInstanceId, ref);
    if (comp == null) {
        WXLogUtils.e("DomStatement", "target component not found.");
        return;
    }
    comp.invoke(method, args);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 58 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.

the class SimpleComponentHolder method createInstance.

@Override
public synchronized WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent) throws IllegalAccessException, InvocationTargetException, InstantiationException {
    WXComponent component = mCreator.createInstance(instance, node, parent);
    component.bindHolder(this);
    return component;
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 59 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.

the class WXRenderStatement method setLayout.

/**
   * set layout information of View
   */
void setLayout(String ref, WXDomObject domObject) {
    WXComponent component = mRegistry.get(ref);
    if (component == null) {
        return;
    }
    component.setLayout(domObject);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 60 with WXComponent

use of com.taobao.weex.ui.component.WXComponent in project weex-example by KalicyZhou.

the class WXRenderStatement method scrollTo.

/**
   * @see com.taobao.weex.dom.WXDomStatement#scrollToDom(String, JSONObject)
   */
void scrollTo(String ref, Map<String, Object> options) {
    WXComponent component = mRegistry.get(ref);
    if (component == null) {
        return;
    }
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    scroller.scrollTo(component, options);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Scrollable(com.taobao.weex.ui.component.Scrollable)

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