admin
2021-02-03 1981dee5aec45793d3c4ebdbc4e637528c71b3c5
BuWanVideo/src/com/weikou/beibeivideo/util/ad/SplashAdUtil.java
@@ -30,27 +30,25 @@
     * @param tv_time
     * @param splashAdListener
     */
    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) {
    public static void loadAD(String pid, 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 (AdUtil.AD_TYPE.csj==adType) {
            loadCSJ(context, skip, vg_ad, splashAdListener);
        } else if (AdUtil.AD_TYPE.gdt==adType) {
            loadGDT(context, skip, vg_ad, tv_time, splashAdListener);
        if (AdUtil.AD_TYPE.csj == adType) {
            loadCSJ(pid, context, skip, vg_ad, splashAdListener);
        } else if (AdUtil.AD_TYPE.gdt == adType) {
            loadGDT(pid, context, skip, vg_ad, tv_time, splashAdListener);
        } else {
            splashAdListener.close();
        }
    }
    private static void loadGDT(Activity context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener splashAdListener) {
    private static void loadGDT(String code, Activity context, final View skip, ViewGroup vg_ad, final TextView tv_time, final SplashAdListener 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;
        }
        if (StringUtils.isNullOrEmpty(code))
            code = BeibeiConstant.GDT_SPLASH_POSITION_ID;
        new SplashAD(context, skip, code, new SplashADListener() {
            @Override
            public void onADDismissed() {
@@ -115,7 +113,7 @@
     * @param vg_ad
     * @param splashAdListener
     */
    private static void loadCSJ(Activity context, final View skip, final ViewGroup vg_ad, final SplashAdListener splashAdListener) {
    private static void loadCSJ(String code, Activity context, final View skip, final ViewGroup vg_ad, final SplashAdListener splashAdListener) {
        skip.setVisibility(View.GONE);
        TTAdManager ttAdManager = TTAdManagerHolder.get();
        TTAdNative mTTAdNative = ttAdManager.createAdNative(context.getApplicationContext());
@@ -127,10 +125,8 @@
        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;
        }
        if (StringUtils.isNullOrEmpty(code))
            code = CSJConstant.SPLASH_AD;
        AdSlot adSlot = new AdSlot.Builder()
                .setCodeId(code)