| | |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | |
| | | String channel = ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL"); |
| | | if (StringUtils.isNullOrEmpty(code)) |
| | | code = BeibeiConstant.GDT_SPLASH_POSITION_ID; |
| | | skip.setVisibility(View.VISIBLE); |
| | | gdtSplashAD = new SplashAD(context, skip, code, new SplashADListener() { |
| | | if (skip != null) |
| | | skip.setVisibility(View.VISIBLE); |
| | | gdtSplashAD = new SplashAD(context, code, new SplashADListener() { |
| | | @Override |
| | | public void onADDismissed() { |
| | | splashAdListener.close(); |
| | |
| | | @Override |
| | | public void onADClicked() { |
| | | System.out.println(""); |
| | | splashAdListener.onAdClick(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | Log.i(TAG, "GDT:onADLoaded-" + l); |
| | | splashAdListener.onAdLoad(new SplashAdLoadInfo(gdtSplashAD, System.currentTimeMillis() + (l - SystemClock.elapsedRealtime()))); |
| | | } |
| | | }, 0); |
| | | }, 3500); |
| | | |
| | | gdtSplashAD.fetchAdOnly(); |
| | | } |
| | | |
| | |
| | | private static void loadCSJ(String code, Context context, final View skip, final SplashAdListener splashAdListener) { |
| | | if (skip != null) |
| | | skip.setVisibility(View.GONE); |
| | | TTAdManager ttAdManager = TTAdManagerHolder.get(); |
| | | TTAdManager ttAdManager = null; |
| | | |
| | | try { |
| | | ttAdManager = TTAdManagerHolder.get(); |
| | | } catch (Exception e) { |
| | | } |
| | | if (ttAdManager == null) { |
| | | splashAdListener.noAd(); |
| | | return; |
| | | } |
| | | TTAdNative mTTAdNative = ttAdManager.createAdNative(context.getApplicationContext()); |
| | | //穿山甲广告 |
| | | int width = DimenUtils.getScreenWidth(context.getApplicationContext()); |
| | |
| | | |
| | | public void onAdLoad(SplashAdLoadInfo adLoadInfo); |
| | | |
| | | public void onAdClick(); |
| | | |
| | | public void close(); |
| | | |
| | | public void noAd(); |