Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
e41e1722
Commit
e41e1722
authored
Nov 11, 2020
by
erwin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
黄军辉
大图广告修改
parent
e6864a2b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
1 deletion
+79
-1
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+53
-0
TTADUtils.kt
library/src/main/java/com/ym/library/csj/TTADUtils.kt
+1
-1
GDTAdUtils.kt
library/src/main/java/com/ym/library/gdt/GDTAdUtils.kt
+1
-0
ZXADExpressListener.kt
.../main/java/com/ym/library/listener/ZXADExpressListener.kt
+4
-0
SettingActivity.kt
...n/java/com/ym/userinfo/module/activity/SettingActivity.kt
+20
-0
No files found.
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
e41e1722
...
...
@@ -3,6 +3,7 @@ package com.ym.game.view
import
android.app.Activity
import
android.app.Dialog
import
android.content.Context
import
android.content.DialogInterface
import
android.text.Html
import
android.view.Gravity
import
android.view.MotionEvent
...
...
@@ -12,6 +13,7 @@ import android.widget.*
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.qq.e.ads.nativ.NativeExpressADView
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.game.module.FlyBoxEntity
import
com.ym.game.module.OrderListEntity
...
...
@@ -28,6 +30,9 @@ import java.text.DecimalFormat
object
MainDialog
{
var
adView
:
Any
?
=
null
fun
showBottomDialog
(
layout
:
Int
,
activity
:
Context
,
...
...
@@ -35,6 +40,9 @@ object MainDialog {
animation
:
Int
,
gravity
:
Int
):
View
{
adView
=
null
val
mDialogView
=
View
.
inflate
(
activity
,
layout
,
null
)
setHeadDialog
.
setContentView
(
mDialogView
)
val
window
=
setHeadDialog
.
window
...
...
@@ -86,6 +94,7 @@ object MainDialog {
}
override
fun
onNativeExpressAdLoad
(
p0
:
MutableList
<
TTNativeExpressAd
>?)
{
}
override
fun
onAdClicked
(
newsEntity
:
NewsEntity
)
{
...
...
@@ -123,10 +132,20 @@ object MainDialog {
override
fun
onSuccess
()
{
}
override
fun
returnObject
(
nativeExpressADView
:
Any
?)
{
adView
=
nativeExpressADView
}
},
layouAd
)
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
}
})
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
lv_get_drop_close2
).
setOnClickListener
{
EventUtils
.
onEvent
(
"click_close_receive_redPack_dialog"
,
"点击关闭领取红包弹窗"
)
mDialog
.
dismiss
()
...
...
@@ -223,6 +242,8 @@ object MainDialog {
}
}
// shwoAd(adType, context, layoutAd)
AdManager
.
loadFeedAd
(
ADConfig
.
AD_IMG_FADE
,
...
...
@@ -273,6 +294,11 @@ object MainDialog {
override
fun
onSuccess
()
{
}
override
fun
returnObject
(
nativeExpressADView
:
Any
?)
{
adView
=
nativeExpressADView
}
},
layoutAd
)
...
...
@@ -284,6 +310,12 @@ object MainDialog {
mDialog
.
dismiss
()
}
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
}
})
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
...
...
@@ -461,10 +493,20 @@ object MainDialog {
override
fun
onSuccess
()
{
}
override
fun
returnObject
(
nativeExpressADView
:
Any
?)
{
adView
=
nativeExpressADView
}
},
layoutAd
)
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
}
})
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
...
...
@@ -582,4 +624,15 @@ object MainDialog {
this
.
onTouchEvent
(
event
)
}
}
fun
onDestroy
()
{
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
library/src/main/java/com/ym/library/csj/TTADUtils.kt
View file @
e41e1722
...
...
@@ -248,7 +248,7 @@ object TTADUtils {
bindAdListener
(
newsEntity
,
mTTAd
,
zxadExpressListener
,
container
,
callback
)
startTime
=
System
.
currentTimeMillis
()
mTTAd
.
render
()
zxadExpressListener
.
returnObject
(
mTTAd
)
}
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
...
...
library/src/main/java/com/ym/library/gdt/GDTAdUtils.kt
View file @
e41e1722
...
...
@@ -181,6 +181,7 @@ object GDTAdUtils {
// 需要保证 View 被绘制的时候是可见的,否则将无法产生曝光和收益。
container
.
addView
(
nativeExpressADView
);
callback
.
onAdSuccess
()
listener
.
returnObject
(
nativeExpressADView
)
}
override
fun
onADOpenOverlay
(
p0
:
NativeExpressADView
?)
{
...
...
library/src/main/java/com/ym/library/listener/ZXADExpressListener.kt
View file @
e41e1722
...
...
@@ -2,7 +2,10 @@ package com.ym.library.listener
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.qq.e.ads.nativ.NativeExpressADView
import
com.ym.library.module.NewsEntity
import
org.apache.poi.hssf.record.formula.functions.T
import
java.util.*
interface
ZXADExpressListener
{
fun
onError
(
p1
:
String
?)
...
...
@@ -19,4 +22,5 @@ interface ZXADExpressListener {
fun
onIdle
()
fun
onFail
()
fun
onSuccess
()
fun
returnObject
(
nativeExpressADView
:
Any
?)
}
\ No newline at end of file
userinfo/src/main/java/com/ym/userinfo/module/activity/SettingActivity.kt
View file @
e41e1722
...
...
@@ -6,6 +6,7 @@ import android.content.Context
import
android.util.Log
import
android.widget.CompoundButton
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
import
com.qq.e.ads.nativ.NativeExpressADView
import
com.umeng.analytics.MobclickAgent
import
com.ym.library.Constant
import
com.ym.library.config.AdManager
...
...
@@ -27,7 +28,11 @@ class SettingActivity : BaseActivity() {
StatusBarUtil
.
transportStatus
(
this
,
resources
.
getColor
(
R
.
color
.
transparent
))
}
private
var
adView
:
Any
?
=
null
override
fun
init
()
{
adView
=
null
if
(
SettingPreference
.
getUserInfoData
()
!=
null
)
{
id_tv_id
.
text
=
"ID: ${SettingPreference.getUserInfoData().uid}"
}
...
...
@@ -125,6 +130,10 @@ class SettingActivity : BaseActivity() {
override
fun
onSuccess
()
{
}
override
fun
returnObject
(
nativeExpressADView
:
Any
?)
{
adView
=
nativeExpressADView
}
},
id_ad_frame_view
)
...
...
@@ -156,4 +165,15 @@ class SettingActivity : BaseActivity() {
super
.
onPause
()
MobclickAgent
.
onPause
(
this
)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
if
(
adView
!=
null
){
if
(
adView
is
NativeExpressADView
){
(
adView
as
NativeExpressADView
)
?.
destroy
()
}
else
if
(
adView
is
TTNativeExpressAd
){
(
adView
as
TTNativeExpressAd
)
?.
destroy
()
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment