Commit 315d21e4 authored by xw's avatar xw

[提交人]:王雪伟

[提交简述] :多多菜园1.0.8
[实现方案] :log
parent 1c075b9e
...@@ -701,7 +701,7 @@ object MainDialog { ...@@ -701,7 +701,7 @@ object MainDialog {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad_seed)
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd) AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd)
mDialogView.findViewById<TextView>(R.id.id_tv_seed_price)?.text = "$seedPrice" mDialogView.findViewById<TextView>(R.id.id_tv_seed_price)?.text = "$seedPrice"
mDialogView.findViewById<TextView>(R.id.id_tv_seed_video_num)?.text = mDialogView.findViewById<TextView>(R.id.id_tv_seed_video_num)?.text =
...@@ -761,12 +761,12 @@ object MainDialog { ...@@ -761,12 +761,12 @@ object MainDialog {
fun onDestroy() { fun onDestroy() {
if (adView != null) { // if (adView != null) {
if (adView is NativeExpressADView) { // if (adView is NativeExpressADView) {
(adView as NativeExpressADView)?.destroy() // (adView as NativeExpressADView)?.destroy()
} else if (adView is TTNativeExpressAd) { // } else if (adView is TTNativeExpressAd) {
(adView as TTNativeExpressAd)?.destroy() // (adView as TTNativeExpressAd)?.destroy()
} // }
} // }
} }
} }
\ No newline at end of file
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</RelativeLayout> </RelativeLayout>
<FrameLayout <FrameLayout
android:id="@+id/layout_get_drop_ad" android:id="@+id/layout_get_drop_ad_seed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5" android:layout_marginLeft="@dimen/dp_5"
......
...@@ -23,7 +23,7 @@ object AdUtils { ...@@ -23,7 +23,7 @@ object AdUtils {
var handler = object : Handler() { var handler = object : Handler() {
override fun handleMessage(msg: Message?) { override fun handleMessage(msg: Message?) {
super.handleMessage(msg) super.handleMessage(msg)
when(msg?.what) { when (msg?.what) {
0 -> { 0 -> {
if (activity != null) { if (activity != null) {
AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_REWARD_VIDIO, activity!!) AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_REWARD_VIDIO, activity!!)
...@@ -53,17 +53,17 @@ object AdUtils { ...@@ -53,17 +53,17 @@ object AdUtils {
override fun onAdShow() { override fun onAdShow() {
Utils.showToast(activity, "看完视频可获得奖励") Utils.showToast(activity, "看完视频可获得奖励")
// AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!) // AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_VIDEO, activity!!)
handler?.sendEmptyMessageDelayed(0, 2000) handler?.sendEmptyMessageDelayed(0, 2000)
} }
override fun onAdVideoBarClick() { override fun onAdVideoBarClick() {
Log.d(TAG,"onAdVideoBarClick:") Log.d(TAG, "onAdVideoBarClick:")
} }
override fun onError(errorMsg: String?) { override fun onError(errorMsg: String?) {
listener?.onError(errorMsg) listener?.onError(errorMsg)
Log.d(TAG,"onError:" + errorMsg) Log.d(TAG, "onError:" + errorMsg)
} }
}) })
...@@ -72,26 +72,25 @@ object AdUtils { ...@@ -72,26 +72,25 @@ object AdUtils {
fun showFeedAd(activity: Activity, actionName: String, view: FrameLayout) { fun showFeedAd(activity: Activity, actionName: String, view: FrameLayout) {
try { try {
view.postDelayed(object :Runnable {
override fun run() { if (activity?.isFinishing) {
if(activity?.isFinishing){ return
return }
} activity?.runOnUiThread() {
activity?.runOnUiThread() { Log.d(TAG, "loadFeedCacheAdToCache展示广告")
AdManager.showFeedAd( AdManager.showFeedAd(
ADConfig.AD_IMG_FADE, ADConfig.AD_IMG_FADE,
actionName, actionName,
ZXADSizeConfig( ZXADSizeConfig(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280 Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, // Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt() // ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
), ),
activity, activity,
view view
) )
} }
}
},500)
} catch (e: Exception) { } catch (e: Exception) {
} }
} }
...@@ -103,11 +102,12 @@ object AdUtils { ...@@ -103,11 +102,12 @@ object AdUtils {
//预加载信息流 //预加载信息流
fun loadFeedCacheAdToCache(activity: Activity) { fun loadFeedCacheAdToCache(activity: Activity) {
Log.d(TAG, "loadFeedCacheAdToCache吓一跳广告")
AdManager.loadFeedAdToCache( AdManager.loadFeedAdToCache(
ADConfig.AD_IMG_FADE, activity, ZXADSizeConfig( ADConfig.AD_IMG_FADE, activity, ZXADSizeConfig(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280 Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, // Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt() // ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
) )
) )
} }
......
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