Search in sources :

Example 1 with WidgetContainer

use of com.taobao.weex.ui.flat.WidgetContainer in project incubator-weex by apache.

the class WXComponent method setComponentLayoutParams.

private void setComponentLayoutParams(int realWidth, int realHeight, int realLeft, int realTop, int realRight, int realBottom, Point rawOffset) {
    if (getInstance() == null || getInstance().isDestroy()) {
        return;
    }
    FlatGUIContext UIImp = getInstance().getFlatUIContext();
    WidgetContainer ancestor;
    Widget widget;
    if (UIImp != null && (ancestor = UIImp.getFlatComponentAncestor(this)) != null) {
        if (this instanceof FlatComponent && !((FlatComponent) this).promoteToView(true)) {
            widget = ((FlatComponent) this).getOrCreateFlatWidget();
        } else {
            widget = UIImp.getAndroidViewWidget(this);
        }
        setWidgetParams(widget, UIImp, rawOffset, realWidth, realHeight, realLeft, realRight, realTop, realBottom);
    } else if (mHost != null) {
        // clear box shadow before host's size changed
        clearBoxShadow();
        if (mDomObj.isFixed()) {
            setFixedHostLayoutParams(mHost, realWidth, realHeight, realLeft, realRight, realTop, realBottom);
        } else {
            setHostLayoutParams(mHost, realWidth, realHeight, realLeft, realRight, realTop, realBottom);
        }
        mPreRealWidth = realWidth;
        mPreRealHeight = realHeight;
        mPreRealLeft = realLeft;
        mPreRealTop = realTop;
        onFinishLayout();
        // restore box shadow
        updateBoxShadow();
    }
}
Also used : FlatComponent(com.taobao.weex.ui.flat.FlatComponent) FlatGUIContext(com.taobao.weex.ui.flat.FlatGUIContext) Widget(com.taobao.weex.ui.flat.widget.Widget) AndroidViewWidget(com.taobao.weex.ui.flat.widget.AndroidViewWidget) WidgetContainer(com.taobao.weex.ui.flat.WidgetContainer)

Aggregations

FlatComponent (com.taobao.weex.ui.flat.FlatComponent)1 FlatGUIContext (com.taobao.weex.ui.flat.FlatGUIContext)1 WidgetContainer (com.taobao.weex.ui.flat.WidgetContainer)1 AndroidViewWidget (com.taobao.weex.ui.flat.widget.AndroidViewWidget)1 Widget (com.taobao.weex.ui.flat.widget.Widget)1