use of com.tmall.wireless.tangram3.support.CellSupport in project Tangram-Android by alibaba.
the class MVHelper method isValid.
public boolean isValid(BaseCell cell, ServiceManager serviceManager) {
boolean ret = cell.isValid();
if (serviceManager != null) {
BaseCellBinderResolver componentBinderResolver = serviceManager.getService(BaseCellBinderResolver.class);
ret = ret && (componentBinderResolver.has(cell.stringType) || cell.componentInfo != null && renderManager.getRenderService(cell.componentInfo.getType()) != null);
CellSupport cellSupport = serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
ret = cellSupport.isValid(cell) && ret;
}
}
return ret;
}
use of com.tmall.wireless.tangram3.support.CellSupport in project Tangram-Android by alibaba.
the class MVHelper method unMountView.
public void unMountView(BaseCell cell, View view) {
renderManager.unmountView(cell, view);
if (cell.serviceManager != null) {
if (cell.serviceManager.supportRx()) {
cell.emitNext(BDE.UNBIND);
}
}
postUnMountView(cell, view);
if (cell.serviceManager != null) {
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.unBindView(cell, view);
}
}
}
use of com.tmall.wireless.tangram3.support.CellSupport in project Tangram-Android by alibaba.
the class MVHelper method mountView.
public void mountView(BaseCell cell, View view) {
try {
mvResolver.register(cell, view);
if (view.getTag(R.id.TANGRAM_ENGINE_TAG) == null) {
view.setTag(R.id.TANGRAM_ENGINE_TAG, engineTag);
}
if (cell.serviceManager != null) {
if (cell.serviceManager.supportRx()) {
cell.emitNext(BDE.BIND);
}
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.bindView(cell, view);
}
}
boolean renderServiceSuccess = renderManager.mountView(cell, view);
if (!renderServiceSuccess) {
initView(cell, view);
}
renderStyle(cell, view);
postMountView(cell, view);
if (cell.serviceManager != null) {
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.postBindView(cell, view);
}
}
} catch (Exception e) {
e.printStackTrace();
if (cell.serviceManager != null) {
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.onBindViewException(cell, view, e);
}
}
}
}
Aggregations