use of com.tmall.wireless.tangram.support.CellSupport in project Tangram-Android by alibaba.
the class MVHelper method mountView.
public void mountView(BaseCell cell, View view) {
try {
mvResolver.register(getCellUniqueId(cell), cell, view);
if (cell.serviceManager != null) {
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.bindView(cell, view);
}
}
if (view instanceof IContainer) {
ViewBase vb = ((IContainer) view).getVirtualView();
vb.setVData(cell.extras);
if (vb.supportExposure()) {
VafContext context = cell.serviceManager.getService(VafContext.class);
context.getEventManager().emitEvent(EventManager.TYPE_Exposure, EventData.obtainData(context, vb));
}
renderStyle(cell, view);
} else {
loadMethod(cell, view);
initView(cell, view);
renderView(cell, view);
renderStyle(cell, view);
}
if (resolver().isCompatibleType(cell.stringType)) {
resolver().getCellClass(cell.stringType).cast(cell).bindView(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);
}
}
}
}
use of com.tmall.wireless.tangram.support.CellSupport in project Tangram-Android by alibaba.
the class MVHelper method unMountView.
public void unMountView(BaseCell cell, View view) {
if (view instanceof IContainer) {
ViewBase vb = ((IContainer) view).getVirtualView();
vb.reset();
}
postUnMountView(cell, view);
if (cell.serviceManager != null) {
CellSupport cellSupport = cell.serviceManager.getService(CellSupport.class);
if (cellSupport != null) {
cellSupport.unBindView(cell, view);
}
}
if (resolver().isCompatibleType(cell.stringType)) {
resolver().getCellClass(cell.stringType).cast(cell).unbindView(view);
}
}
Aggregations