| | |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTSplashAd; |
| | | import com.bytedance.sdk.openadsdk.CSJSplashAd; |
| | | import com.huawei.hms.ads.AdParam; |
| | | import com.huawei.hms.ads.AudioFocusType; |
| | | import com.huawei.hms.ads.splash.SplashView; |
| | |
| | | if (isAdLoaded()) { |
| | | //穿山甲广告 |
| | | if (adLoadInfo.getCsjAd() != null) { |
| | | TTSplashAd ad = adLoadInfo.getCsjAd(); |
| | | CSJSplashAd ad = adLoadInfo.getCsjAd(); |
| | | View view = ad.getSplashView(); |
| | | fl_ad.removeAllViews(); |
| | | //把SplashView 添加到ViewGroup中 |
| | | fl_ad.addView(view); |
| | | |
| | | ad.setSplashInteractionListener(new TTSplashAd.AdInteractionListener() { |
| | | ad.setSplashAdListener(new CSJSplashAd.SplashAdListener() { |
| | | @Override |
| | | public void onAdClicked(View view, int type) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdShow(View view, int type) { |
| | | public void onSplashAdShow(CSJSplashAd csjSplashAd) { |
| | | lastShowTime = System.currentTimeMillis(); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdSkip() { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | public void onSplashAdClick(CSJSplashAd csjSplashAd) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdTimeOver() { |
| | | public void onSplashAdClose(CSJSplashAd csjSplashAd, int i) { |
| | | if (mAdShowListener != null) |
| | | mAdShowListener.onClose(); |
| | | } |