use of com.taobao.weex.dom.WXDomObject in project incubator-weex by apache.
the class Statements method getComponentId.
public static String getComponentId(WXComponent component) {
if (component instanceof WXCell || component == null) {
return null;
}
WXDomObject domObject = (WXDomObject) component.getDomObject();
WXAttr attr = domObject.getAttrs();
if (attr.get(ELUtils.IS_COMPONENT_ROOT) != null && WXUtils.getBoolean(attr.get(ELUtils.IS_COMPONENT_ROOT), false)) {
if (attr.get(ELUtils.COMPONENT_PROPS) != null && attr.get(ELUtils.COMPONENT_PROPS) instanceof JSONObject) {
Object componentId = attr.get(CellDataManager.VIRTUAL_COMPONENT_ID);
if (componentId == null) {
return null;
}
return componentId.toString();
}
}
return getComponentId(component.getParent());
}
use of com.taobao.weex.dom.WXDomObject in project incubator-weex by apache.
the class WXCell method getStickyOffset.
public int getStickyOffset() {
if (getDomObject() == null) {
return 0;
}
WXDomObject domObject = (WXDomObject) getDomObject();
if (domObject.getAttrs().get(STICKY_OFFSET) == null) {
return 0;
}
float offset = WXUtils.getFloat(domObject.getAttrs().get(STICKY_OFFSET));
return (int) (WXViewUtils.getRealPxByWidth(offset, domObject.getViewPortWidth()));
}
Aggregations