use of com.tmall.wireless.vaf.framework.VafContext 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.vaf.framework.VafContext in project Tangram-Android by alibaba.
the class BaseTangramEngine method destroy.
/**
* Call this when your activity is ready to destory to clear inner resource.
*/
public void destroy() {
if (mContentView != null) {
if (mGroupBasicAdapter != null) {
mGroupBasicAdapter.destroy();
}
mContentView.setAdapter(null);
mContentView = null;
}
TimerSupport timerSupport = getService(TimerSupport.class);
if (timerSupport != null) {
timerSupport.clear();
}
BusSupport busSupport = getService(BusSupport.class);
if (busSupport != null) {
busSupport.shutdown();
}
VafContext vafContext = getService(VafContext.class);
if (vafContext != null) {
vafContext.onDestroy();
}
}
Aggregations