use of com.tmall.wireless.tangram3.MVHelper in project Tangram-Android by alibaba.
the class Card method addCellInternal.
public boolean addCellInternal(@Nullable BaseCell cell, boolean silent) {
if (cell != null) {
cell.parentId = id;
cell.parent = this;
cell.serviceManager = serviceManager;
MVHelper mvHelper = getMVHelper();
if (mvHelper != null) {
if (mvHelper.isValid(cell, serviceManager)) {
if (cell.position >= 0 && !TextUtils.isEmpty(load)) {
cell.pos = cell.position;
mPendingCells.add(cell);
return true;
} else {
cell.pos = mHeader != null ? this.mCells.size() + 1 : this.mCells.size();
}
if (!silent && mIsActivated) {
// do cell added
cell.added();
}
this.mCells.add(cell);
if (mFooter != null) {
mFooter.pos = cell.pos + 1;
}
return true;
}
}
}
return false;
}
use of com.tmall.wireless.tangram3.MVHelper 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();
}
SimpleClickSupport simpleClickSupport = getService(SimpleClickSupport.class);
if (simpleClickSupport != null) {
simpleClickSupport.destroy();
}
ExposureSupport exposureSupport = getService(ExposureSupport.class);
if (exposureSupport != null) {
exposureSupport.destroy();
}
BusSupport busSupport = getService(BusSupport.class);
if (busSupport != null) {
busSupport.shutdown();
}
BannerSupport bannerSupport = getService(BannerSupport.class);
if (bannerSupport != null) {
bannerSupport.destroy();
}
MVHelper mvHelper = getService(MVHelper.class);
if (mvHelper != null) {
mvHelper.renderManager().destroyRenderService();
}
}
Aggregations