Commit 315d21e4 authored by xw's avatar xw

[提交人]:王雪伟

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