Search in sources :

Example 1 with ExposureSupport

use of com.tmall.wireless.tangram3.support.ExposureSupport in project Tangram-Android by alibaba.

the class Card method onBindCell.

/**
 * Don't change card's mCells in binding process!
 * <p/>
 */
public void onBindCell(int offset, int position, boolean showFromEnd) {
    if (!mIsExposed && serviceManager != null) {
        ExposureSupport exposureSupport = serviceManager.getService(ExposureSupport.class);
        if (exposureSupport != null) {
            mIsExposed = true;
            exposureSupport.onExposure(this, offset, position);
        }
    }
}
Also used : ExposureSupport(com.tmall.wireless.tangram3.support.ExposureSupport)

Example 2 with ExposureSupport

use of com.tmall.wireless.tangram3.support.ExposureSupport 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();
    }
}
Also used : ExposureSupport(com.tmall.wireless.tangram3.support.ExposureSupport) SimpleClickSupport(com.tmall.wireless.tangram3.support.SimpleClickSupport) TimerSupport(com.tmall.wireless.tangram3.support.TimerSupport) BusSupport(com.tmall.wireless.tangram3.eventbus.BusSupport) BannerSupport(com.tmall.wireless.tangram3.support.BannerSupport)

Example 3 with ExposureSupport

use of com.tmall.wireless.tangram3.support.ExposureSupport in project Tangram-Android by alibaba.

the class MVHelper method postMountView.

private void postMountView(BaseCell cell, View view) {
    if (!cell.mIsExposed && cell.serviceManager != null) {
        ExposureSupport exposureSupport = cell.serviceManager.getService(ExposureSupport.class);
        if (exposureSupport != null) {
            cell.mIsExposed = true;
            exposureSupport.onExposure(view, cell, cell.pos);
        }
    }
    if (view instanceof ITangramViewLifeCycle) {
        ((ITangramViewLifeCycle) view).postBindView(cell);
    } else {
        if (postBindMap.get(cell) != null) {
            try {
                postBindMap.get(cell).invoke(view, cell);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
Also used : ExposureSupport(com.tmall.wireless.tangram3.support.ExposureSupport) ITangramViewLifeCycle(com.tmall.wireless.tangram3.structure.view.ITangramViewLifeCycle)

Aggregations

ExposureSupport (com.tmall.wireless.tangram3.support.ExposureSupport)3 BusSupport (com.tmall.wireless.tangram3.eventbus.BusSupport)1 ITangramViewLifeCycle (com.tmall.wireless.tangram3.structure.view.ITangramViewLifeCycle)1 BannerSupport (com.tmall.wireless.tangram3.support.BannerSupport)1 SimpleClickSupport (com.tmall.wireless.tangram3.support.SimpleClickSupport)1 TimerSupport (com.tmall.wireless.tangram3.support.TimerSupport)1