admin
2020-09-10 a62905c725c5ffd88f29dfac644591cde18751e1
BuWanVideo/src/com/weikou/beibeivideo/util/ad/SplashAdUtil.java
@@ -9,6 +9,7 @@
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTSplashAd;
import com.lcjian.library.util.ManifestDataUtil;
import com.qq.e.ads.splash.SplashAD;
import com.qq.e.ads.splash.SplashADListener;
import com.qq.e.comm.util.AdError;
@@ -29,14 +30,14 @@
     * @param tv_time
     * @param splashAdListener
     */
    public static void loadAD(String adType, Activity context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) {
        if (StringUtils.isNullOrEmpty(adType)) {
    public static void loadAD(AdUtil.AD_TYPE adType, Activity context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) {
        if (adType==null) {
            splashAdListener.close();
            return;
        }
        if (AdTypeVO.TYPE_CSJ.equalsIgnoreCase(adType)) {
        if (AdUtil.AD_TYPE.csj==adType) {
            loadCSJ(context, skip, vg_ad, splashAdListener);
        } else if (AdTypeVO.TYPE_GDT.equalsIgnoreCase(adType)) {
        } else if (AdUtil.AD_TYPE.gdt==adType) {
            loadGDT(context, skip, vg_ad, tv_time, splashAdListener);
        } else {
            splashAdListener.close();
@@ -44,7 +45,13 @@
    }
    private static void loadGDT(Activity context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) {
        new SplashAD(context, skip, BeibeiConstant.GDT_SPLASH_POSITION_ID, new SplashADListener() {
        String channel = ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL");
        String code = BeibeiConstant.GDT_SPLASH_POSITION_ID;
        if ("vivo".equalsIgnoreCase(channel)) {
            code = BeibeiConstant.GDT_SPLASH_VIVO_POSITION_ID;
        }
        new SplashAD(context, skip, code, new SplashADListener() {
            @Override
            public void onADDismissed() {
                splashAdListener.close();
@@ -119,8 +126,14 @@
            width = 720;
        if (height == 0)
            height = 1080;
        String channel = ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL");
        String code = CSJConstant.SPLASH_AD;
        if ("vivo".equalsIgnoreCase(channel)) {
            code = CSJConstant.SPLASH_AD_VIVO;
        }
        AdSlot adSlot = new AdSlot.Builder()
                .setCodeId("887360667")
                .setCodeId(code)
                .setSupportDeepLink(true)
                .setImageAcceptedSize(width, height)
                .build();