Commit f935ab00 authored by maxiaoliang's avatar maxiaoliang

修改插屏广告

parent 0ad4dc0b
...@@ -104,12 +104,12 @@ ...@@ -104,12 +104,12 @@
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" />
<!-- <meta-data--> <meta-data
<!-- android:name="design_width_in_dp"--> android:name="design_width_in_dp"
<!-- android:value="420"/>--> android:value="420"/>
<!-- <meta-data--> <meta-data
<!-- android:name="design_height_in_dp"--> android:name="design_height_in_dp"
<!-- android:value="740"/>--> android:value="740"/>
<!-- <meta-data--> <!-- <meta-data-->
<!-- android:name="design_width_in_dp"--> <!-- android:name="design_width_in_dp"-->
<!-- android:value="360"/>--> <!-- android:value="360"/>-->
......
PACKAGE_NAME=com.zxhl.shop PACKAGE_NAME=com.zxhl.shop
VERSION_CODE=26 VERSION_CODE=27
VERSION_NAME=1.2.5 VERSION_NAME=1.2.6
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,11 @@ import com.pay.paytypelibrary.base.OnPayResultListener ...@@ -14,7 +14,11 @@ import com.pay.paytypelibrary.base.OnPayResultListener
import com.pay.paytypelibrary.base.OrderInfo import com.pay.paytypelibrary.base.OrderInfo
import com.pay.paytypelibrary.base.PayUtil import com.pay.paytypelibrary.base.PayUtil
import com.zx.ad.AdManager import com.zx.ad.AdManager
import com.zx.ad.callback.AdLoadCallBack
import com.zx.ad.callback.InterertionAdListener import com.zx.ad.callback.InterertionAdListener
import com.zx.ad.callback.RewardVideoAdListener
import com.zx.ad.modulecommon.module.NewsEntity
import com.zx.ad.platform.csj.CSJAdManager
import com.zxbw.modulemain.R import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.OperatorAdapter import com.zxbw.modulemain.adapter.OperatorAdapter
import com.zxbw.modulemain.adapter.RechargeAdapter import com.zxbw.modulemain.adapter.RechargeAdapter
...@@ -106,8 +110,28 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity ...@@ -106,8 +110,28 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}) })
} }
fun showRewardViewAd(){
AdManager.loadRewardAd(this@RechargeActivity, object : RewardVideoAdListener {
override fun onRewardVideoAdClose() {
}
override fun onRewardVideoAdReward() {
}
override fun onRewardVideoAdShow() {
}
override fun onRewardVideoAdError(errorMsg: String?) {
}
})
}
override fun init() { override fun init() {
showIntriAd() showIntriAd()
// showRewardViewAd()
id_img_back?.setOnClickListener { id_img_back?.setOnClickListener {
finish() finish()
} }
......
...@@ -104,7 +104,7 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa ...@@ -104,7 +104,7 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
fun showIntriAd(){ fun showIntriAd(){
AdManager.loadInterAd(this!!, object : InterertionAdListener { AdManager.loadInterAd(this!!, object : InterertionAdListener {
override fun onAdShow() { override fun onAdShow() {
Log.e("MXL","onshow")
} }
override fun onAdError(errorMsg: String?) { override fun onAdError(errorMsg: String?) {
...@@ -112,7 +112,7 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa ...@@ -112,7 +112,7 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
} }
override fun onAdClose() { override fun onAdClose() {
Log.e("MXL","onAdClose")
} }
}) })
......
...@@ -34,7 +34,7 @@ object CSJAdManager { ...@@ -34,7 +34,7 @@ object CSJAdManager {
} }
fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) { fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) {
TTAdManagerHolder.init(context, appId, initCallback) TTAdManagerHolder.init(context, appId, initCallback)
//TTAdManagerHolder.init(context, "5335826", initCallback) //TTAdManagerHolder.init(context, "5335826", initCallback)
} }
...@@ -159,9 +159,10 @@ object CSJAdManager { ...@@ -159,9 +159,10 @@ object CSJAdManager {
//step4:创建广告请求参数AdSlot,具体参数含义参考文档 //step4:创建广告请求参数AdSlot,具体参数含义参考文档
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
.setCodeId(entity.codeId) //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD .setCodeId(entity.codeId) //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD
// .setCodeId("949814576") //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD //.setCodeId("949814576") //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD
.setAdLoadType(TTAdLoadType.LOAD) .setAdLoadType(TTAdLoadType.LOAD)
// .setExpressViewAcceptedSize(200f,200f)
.build() .build()
mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener { mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener {
override fun onError(p0: Int, p1: String?) { override fun onError(p0: Int, p1: String?) {
...@@ -195,7 +196,11 @@ object CSJAdManager { ...@@ -195,7 +196,11 @@ object CSJAdManager {
//该方法直接展示广告 //该方法直接展示广告
//mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this); //mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this);
innterstitialAd?.showFullScreenVideoAd(context,TTAdConstant.RitScenes.GAME_GIFT_BONUS, null) innterstitialAd?.showFullScreenVideoAd(
context,
TTAdConstant.RitScenes.GAME_GIFT_BONUS,
null
)
innterstitialAd = null innterstitialAd = null
innterstitialAd?.setFullScreenVideoAdInteractionListener(object : innterstitialAd?.setFullScreenVideoAdInteractionListener(object :
TTFullScreenVideoAd.FullScreenVideoAdInteractionListener { TTFullScreenVideoAd.FullScreenVideoAdInteractionListener {
...@@ -219,18 +224,6 @@ object CSJAdManager { ...@@ -219,18 +224,6 @@ object CSJAdManager {
override fun onSkippedVideo() { override fun onSkippedVideo() {
} }
// override fun onAdClicked() {
//
// }
//
// override fun onAdShow() {
//
// }
//
// override fun onAdDismiss() {
//
// }
}) })
...@@ -244,8 +237,8 @@ object CSJAdManager { ...@@ -244,8 +237,8 @@ object CSJAdManager {
fun loadRewardVideoAd(context: Context, entity: NewsEntity, loadCallBack: AdLoadCallBack) { fun loadRewardVideoAd(context: Context, entity: NewsEntity, loadCallBack: AdLoadCallBack) {
mTTAdNative = TTAdManagerHolder.get().createAdNative(context) mTTAdNative = TTAdManagerHolder.get().createAdNative(context)
var adSlot = AdSlot.Builder() var adSlot = AdSlot.Builder()
.setCodeId(entity.codeId) // .setCodeId(entity.codeId)
// .setCodeId("901121365") .setCodeId("950070471")
.setExpressViewAcceptedSize(500f, 500f) .setExpressViewAcceptedSize(500f, 500f)
.setOrientation(TTAdConstant.VERTICAL) //必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL .setOrientation(TTAdConstant.VERTICAL) //必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL
.setAdLoadType(TTAdLoadType.UNKNOWN)//推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略 .setAdLoadType(TTAdLoadType.UNKNOWN)//推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment