Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
1c2147fd
Commit
1c2147fd
authored
Feb 23, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
f6e61c37
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
242 additions
and
297 deletions
+242
-297
build.gradle
GoodMoney/app/build.gradle
+1
-1
scenemodule-4.1-hzq.aar
GoodMoney/app/libs/scenemodule-4.1-hzq.aar
+0
-0
BaseVideoAd.kt
...src/main/java/com/mints/goodmoney/ad/video/BaseVideoAd.kt
+0
-115
CsjFullVideoAdManager.java
...a/com/mints/goodmoney/ad/video/CsjFullVideoAdManager.java
+14
-21
CsjVideoAdManager.java
.../java/com/mints/goodmoney/ad/video/CsjVideoAdManager.java
+17
-24
KsVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
+15
-20
MhVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/MhVideoAdManager.kt
+13
-17
ShVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
+13
-16
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+45
-37
WnVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/WnVideoAdManager.kt
+13
-19
YlhVideoAdManager.java
.../java/com/mints/goodmoney/ad/video/YlhVideoAdManager.java
+17
-27
BaseVideoAd.kt
...ain/java/com/mints/goodmoney/ad/video/base/BaseVideoAd.kt
+34
-0
ChannelRuleEnum.java
...va/com/mints/goodmoney/ad/video/base/ChannelRuleEnum.java
+35
-0
VedioAdStatusListener.kt
...om/mints/goodmoney/ad/video/base/VedioAdStatusListener.kt
+21
-0
DrawcashActivity.kt
...java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
+4
-0
No files found.
GoodMoney/app/build.gradle
View file @
1c2147fd
...
@@ -252,7 +252,7 @@ dependencies {
...
@@ -252,7 +252,7 @@ dependencies {
// implementation(name: 'ks_3.3.5.3', ext: 'aar')
// implementation(name: 'ks_3.3.5.3', ext: 'aar')
// 聚乐云
// 聚乐云
implementation
(
name:
'okgo-4.0'
,
ext:
'aar'
)
implementation
(
name:
'okgo-4.0'
,
ext:
'aar'
)
implementation
(
name:
'scenemodule-4.
0
-hzq'
,
ext:
'aar'
)
implementation
(
name:
'scenemodule-4.
1
-hzq'
,
ext:
'aar'
)
implementation
(
name:
'scenead-4.0'
,
ext:
'aar'
)
implementation
(
name:
'scenead-4.0'
,
ext:
'aar'
)
implementation
'com.just.agentweb:agentweb:4.1.2'
implementation
'com.just.agentweb:agentweb:4.1.2'
// 喜马拉雅 已集成
// 喜马拉雅 已集成
...
...
GoodMoney/app/libs/scenemodule-4.
0
-hzq.aar
→
GoodMoney/app/libs/scenemodule-4.
1
-hzq.aar
100755 → 100644
View file @
1c2147fd
No preview for this file type
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/BaseVideoAd.kt
deleted
100644 → 0
View file @
f6e61c37
package
com.mints.goodmoney.ad.video
import
android.app.Activity
import
android.content.DialogInterface
import
android.text.TextUtils
import
android.view.KeyEvent
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.views.BaseView
import
com.mints.goodmoney.ui.widgets.dialog.LoadingDialog
import
com.mints.goodmoney.utils.ToastUtil
import
java.util.HashMap
open
class
BaseVideoAd
(
activity
:
Activity
)
:
BaseView
{
open
var
activity
:
Activity
?
=
null
var
progressDialog
:
LoadingDialog
?
=
null
init
{
this
.
activity
=
activity
}
override
fun
getBaseApplication
():
MintsApplication
{
return
activity
?.
getApplication
()
as
MintsApplication
}
/**
* 显示加载进度条(自定义message)
*
* @param message
*/
override
fun
showLoading
(
message
:
String
?)
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
==
null
)
{
progressDialog
=
LoadingDialog
(
activity
)
progressDialog
!!
.
setLoadText
(
message
)
}
progressDialog
?.
show
()
setProgressOnTouchOutside
(
false
)
setProgressNoDismiss
()
}
}
}
/**
* 设置Progress是否手触消失
*
* @param onTouchOutside
*/
open
fun
setProgressOnTouchOutside
(
onTouchOutside
:
Boolean
)
{
if
(
progressDialog
!=
null
)
progressDialog
!!
.
setCanceledOnTouchOutside
(
onTouchOutside
)
}
/**
* 设置点击返回是否消失加载进度条
*/
fun
setProgressNoDismiss
()
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
setOnKeyListener
(
DialogInterface
.
OnKeyListener
{
dialog
,
keyCode
,
event
->
keyCode
==
KeyEvent
.
KEYCODE_BACK
})
}
}
/**
* 消失加载进度条
*/
override
fun
hideLoading
()
{
try
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
dismiss
()
progressDialog
=
null
}
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
finally
{
progressDialog
=
null
}
}
override
fun
showToast
(
msg
:
String
?)
{
if
(!
TextUtils
.
isEmpty
(
msg
))
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
msg
)
}
/**
* 激励视频请求接口封装
*/
fun
getAdMapVO
(
carrierType
:
String
,
adsource
:
String
,
extraId
:
String
?,
curCoin
:
Int
):
HashMap
<
String
,
Any
>
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"adtype"
]
=
Constant
.
ADTYPE_VEDIO
vo
[
"adsource"
]
=
adsource
var
tempExtraId
=
""
if
(
extraId
!=
null
)
{
tempExtraId
=
extraId
}
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_HOMEWATER
->
vo
[
"waterCoin"
]
=
curCoin
Constant
.
CARRIER_OFFLINE_DOUBLE
->
vo
[
"offline_income"
]
=
curCoin
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
->
vo
[
"turntableKey"
]
=
tempExtraId
}
return
vo
}
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{}
open
fun
onDestroy
()
{}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/CsjFullVideoAdManager.java
View file @
1c2147fd
...
@@ -7,19 +7,20 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
...
@@ -7,19 +7,20 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import
com.bytedance.sdk.openadsdk.TTAdNative
;
import
com.bytedance.sdk.openadsdk.TTAdNative
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
import
com.bytedance.sdk.openadsdk.TTFullScreenVideoAd
;
import
com.bytedance.sdk.openadsdk.TTFullScreenVideoAd
;
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
;
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
;
/**
/**
* 穿山甲全屏广告
* 穿山甲全屏广告
*/
*/
public
class
CsjFullVideoAdManager
extends
BaseVideoAd
implements
VideoAdManagerView
{
public
class
CsjFullVideoAdManager
extends
BaseVideoAd
{
private
static
CsjFullVideoAdManager
_inst
;
private
static
CsjFullVideoAdManager
_inst
;
private
CsjFullVedioAdListener
csjFullVedioAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
private
TTAdNative
ttAdNative
;
...
@@ -37,7 +38,6 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
...
@@ -37,7 +38,6 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
}
private
CsjFullVideoAdManager
(
Activity
activity
)
{
private
CsjFullVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
init
(
activity
);
}
}
...
@@ -68,8 +68,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
...
@@ -68,8 +68,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
public
void
onError
(
int
code
,
String
message
)
{
public
void
onError
(
int
code
,
String
message
)
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
...
@@ -92,16 +92,16 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
...
@@ -92,16 +92,16 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedio
Download
();
vedioAdStatusListener
.
ad
Download
();
}
}
}
}
@Override
@Override
public
void
onAdClose
()
{
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dSuccess
();
vedioAdStatusListener
.
a
dSuccess
();
}
}
if
(
activity
!=
null
)
{
if
(
activity
!=
null
)
{
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJFULL
,
extraId
,
curCoin
));
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJFULL
,
extraId
,
curCoin
));
...
@@ -129,8 +129,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
...
@@ -129,8 +129,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
else
{
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
}
}
...
@@ -146,15 +146,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
...
@@ -146,15 +146,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
activity
=
null
;
activity
=
null
;
}
}
public
void
set
CsjFullVedioAdListener
(
CsjFullVedioAdListener
csjFullVedioAd
Listener
)
{
public
void
set
VedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatus
Listener
)
{
this
.
csjFullVedioAdListener
=
csjFullVedioAd
Listener
;
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
;
}
}
public
interface
CsjFullVedioAdListener
{
void
csjFullVedioAdFail
();
void
csjFullVedioAdSuccess
();
void
csjFullVedioDownload
();
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/CsjVideoAdManager.java
View file @
1c2147fd
...
@@ -8,6 +8,8 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
...
@@ -8,6 +8,8 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import
com.bytedance.sdk.openadsdk.TTAppDownloadListener
;
import
com.bytedance.sdk.openadsdk.TTAppDownloadListener
;
import
com.bytedance.sdk.openadsdk.TTRewardVideoAd
;
import
com.bytedance.sdk.openadsdk.TTRewardVideoAd
;
import
com.mints.goodmoney.BuildConfig
;
import
com.mints.goodmoney.BuildConfig
;
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
;
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.TTNativeExpressManager
;
import
com.mints.goodmoney.manager.TTNativeExpressManager
;
...
@@ -31,7 +33,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -31,7 +33,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
private
AppPreferences
ps
;
private
AppPreferences
ps
;
private
int
curCoin
;
private
int
curCoin
;
private
String
extraId
;
private
String
extraId
;
private
CsjVideoAdListener
csjVideoAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
private
TTAdNative
ttAdNative
;
...
@@ -48,7 +50,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -48,7 +50,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
}
private
CsjVideoAdManager
(
Activity
activity
)
{
private
CsjVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
init
(
activity
);
}
}
...
@@ -66,7 +67,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -66,7 +67,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
if
(
mttRewardVideoAd
!=
null
)
{
if
(
mttRewardVideoAd
!=
null
)
{
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
}
}
ps
=
null
;
activity
=
null
;
activity
=
null
;
}
}
...
@@ -81,7 +82,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -81,7 +82,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
isClickScreen
=
true
;
isClickScreen
=
true
;
this
.
curCoin
=
curCoin
;
this
.
curCoin
=
curCoin
;
this
.
extraId
=
extraId
;
this
.
extraId
=
extraId
;
String
codeId
=
TtCsjAdManager
.
TT_AD_VEDIO_MAIN_DEV
;
String
codeId
=
TtCsjAdManager
.
TT_AD_VEDIO_MAIN_DEV
;
if
(!
BuildConfig
.
DEBUG
)
{
if
(!
BuildConfig
.
DEBUG
)
{
switch
(
carrierType
)
{
switch
(
carrierType
)
{
...
@@ -150,9 +150,9 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -150,9 +150,9 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
LogUtil
.
d
(
"
csjVideoAd
Listener"
,
"onError "
+
code
+
message
);
LogUtil
.
d
(
"
vedioAdStatus
Listener"
,
"onError "
+
code
+
message
);
if
(
csjVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
...
@@ -165,8 +165,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -165,8 +165,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
else
{
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
}
}
...
@@ -197,8 +197,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -197,8 +197,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
isClickScreen
=
false
;
}
}
if
(
csjVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideo
Download
();
vedioAdStatusListener
.
ad
Download
();
}
}
}
}
...
@@ -206,8 +206,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -206,8 +206,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onAdClose
()
{
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dSuccess
();
vedioAdStatusListener
.
a
dSuccess
();
}
}
}
}
...
@@ -219,8 +219,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -219,8 +219,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onVideoError
()
{
public
void
onVideoError
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
if
(
csjVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
...
@@ -299,15 +299,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -299,15 +299,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
return
vo
;
return
vo
;
}
}
public
void
set
CsjVideoAdListener
(
CsjVideoAdListener
csjVideoAd
Listener
)
{
public
void
set
VedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatus
Listener
)
{
this
.
csjVideoAdListener
=
csjVideoAd
Listener
;
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
;
}
}
public
interface
CsjVideoAdListener
{
void
csjVideoAdFail
();
void
csjVideoAdSuccess
();
void
csjVideoDownload
();
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
View file @
1c2147fd
...
@@ -5,13 +5,13 @@ import com.kwad.sdk.api.KsAdSDK
...
@@ -5,13 +5,13 @@ import com.kwad.sdk.api.KsAdSDK
import
com.kwad.sdk.api.KsLoadManager
import
com.kwad.sdk.api.KsLoadManager
import
com.kwad.sdk.api.KsRewardVideoAd
import
com.kwad.sdk.api.KsRewardVideoAd
import
com.kwad.sdk.api.KsScene
import
com.kwad.sdk.api.KsScene
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.KsManager
import
com.mints.goodmoney.manager.KsManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.ToastUtil
private
val
TAG
=
KsVideoAdManager
::
class
.
java
.
simpleName
private
val
TAG
=
KsVideoAdManager
::
class
.
java
.
simpleName
...
@@ -20,13 +20,13 @@ private val TAG = KsVideoAdManager::class.java.simpleName
...
@@ -20,13 +20,13 @@ private val TAG = KsVideoAdManager::class.java.simpleName
* 快手广告视频
* 快手广告视频
*/
*/
class
KsVideoAdManager
private
constructor
(
activity
:
Activity
)
:
class
KsVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VideoAdManagerView
{
BaseVideoAd
(
)
{
private
var
ksVideoAdListener
:
KsVideoAd
Listener
?
=
null
private
var
vedioAdStatusListener
:
VedioAdStatus
Listener
?
=
null
private
var
mRewardVideoAd
:
KsRewardVideoAd
?
=
null
private
var
mRewardVideoAd
:
KsRewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
private
var
isClickScreen
:
Boolean
=
true
override
var
activity
:
Activity
?
=
null
var
activity
:
Activity
?
=
null
companion
object
{
companion
object
{
private
var
_inst
:
KsVideoAdManager
?
=
null
private
var
_inst
:
KsVideoAdManager
?
=
null
...
@@ -55,8 +55,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
...
@@ -55,8 +55,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
val
scene
=
KsScene
.
Builder
(
KsManager
.
KS_AD_VEDIO_POSTID
).
build
()
val
scene
=
KsScene
.
Builder
(
KsManager
.
KS_AD_VEDIO_POSTID
).
build
()
KsAdSDK
.
getLoadManager
().
loadRewardVideoAd
(
scene
,
object
:
KsLoadManager
.
RewardVideoAdListener
{
KsAdSDK
.
getLoadManager
().
loadRewardVideoAd
(
scene
,
object
:
KsLoadManager
.
RewardVideoAdListener
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
if
(
ksVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dFail
()
vedioAdStatusListener
?.
a
dFail
()
}
}
}
}
...
@@ -79,8 +79,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
...
@@ -79,8 +79,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
isClickScreen
=
false
}
}
if
(
ksVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dDownload
()
vedioAdStatusListener
?.
a
dDownload
()
}
}
}
}
...
@@ -91,8 +91,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
...
@@ -91,8 +91,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
ksVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dSuccess
()
vedioAdStatusListener
?.
a
dSuccess
()
}
}
}
}
...
@@ -101,8 +101,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
...
@@ -101,8 +101,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
ksVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dFail
()
vedioAdStatusListener
?.
a
dFail
()
}
}
}
}
...
@@ -131,15 +131,10 @@ class KsVideoAdManager private constructor(activity: Activity) :
...
@@ -131,15 +131,10 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
}
fun
set
KsVideoAdListener
(
ksVideoAdListener
:
KsVideoAd
Listener
?)
{
fun
set
VedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatus
Listener
?)
{
this
.
ksVideoAdListener
=
ksVideoAd
Listener
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
}
}
interface
KsVideoAdListener
{
fun
ksVideoAdSuccess
()
fun
ksVideoAdFail
()
fun
ksVideoAdDownload
()
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
mRewardVideoAd
=
null
mRewardVideoAd
=
null
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/MhVideoAdManager.kt
View file @
1c2147fd
...
@@ -2,11 +2,12 @@ package com.mints.goodmoney.ad.video
...
@@ -2,11 +2,12 @@ package com.mints.goodmoney.ad.video
import
android.app.Activity
import
android.app.Activity
import
com.maplehaze.adsdk.video.RewardVideoAd
import
com.maplehaze.adsdk.video.RewardVideoAd
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MhManager
import
com.mints.goodmoney.manager.MhManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
private
val
TAG
=
MhVideoAdManager
::
class
.
java
.
simpleName
private
val
TAG
=
MhVideoAdManager
::
class
.
java
.
simpleName
...
@@ -15,13 +16,13 @@ private val TAG = MhVideoAdManager::class.java.simpleName
...
@@ -15,13 +16,13 @@ private val TAG = MhVideoAdManager::class.java.simpleName
* 枫岚广告视频
* 枫岚广告视频
*/
*/
class
MhVideoAdManager
private
constructor
(
activity
:
Activity
)
:
class
MhVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VideoAdManagerView
{
BaseVideoAd
(
)
{
private
var
mhVideoAdListener
:
MhVideoAd
Listener
?
=
null
private
var
vedioAdStatusListener
:
VedioAdStatus
Listener
?
=
null
private
var
mRewardVideoAd
:
RewardVideoAd
?
=
null
private
var
mRewardVideoAd
:
RewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
private
var
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
companion
object
{
private
var
_inst
:
MhVideoAdManager
?
=
null
private
var
_inst
:
MhVideoAdManager
?
=
null
...
@@ -84,8 +85,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
...
@@ -84,8 +85,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
isClickScreen
=
false
}
}
if
(
mhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dDownload
()
vedioAdStatusListener
?.
a
dDownload
()
}
}
}
}
...
@@ -100,8 +101,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
...
@@ -100,8 +101,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
mhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dSuccess
()
vedioAdStatusListener
?.
a
dSuccess
()
}
}
}
}
...
@@ -110,8 +111,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
...
@@ -110,8 +111,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
mhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dFail
()
vedioAdStatusListener
?.
a
dFail
()
}
}
}
}
...
@@ -120,15 +121,10 @@ class MhVideoAdManager private constructor(activity: Activity) :
...
@@ -120,15 +121,10 @@ class MhVideoAdManager private constructor(activity: Activity) :
mRewardVideoAd
?.
loadAd
()
mRewardVideoAd
?.
loadAd
()
}
}
fun
set
MhVideoAdListener
(
mhVideoAdListener
:
MhVideoAd
Listener
?)
{
fun
set
VedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatus
Listener
?)
{
this
.
mhVideoAdListener
=
mhVideoAd
Listener
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
}
}
interface
MhVideoAdListener
{
fun
mhVideoAdSuccess
()
fun
mhVideoAdFail
()
fun
mhVideoAdDownload
()
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
mRewardVideoAd
=
null
mRewardVideoAd
=
null
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
View file @
1c2147fd
...
@@ -4,6 +4,8 @@ import android.app.Activity
...
@@ -4,6 +4,8 @@ import android.app.Activity
import
android.text.TextUtils
import
android.text.TextUtils
import
androidx.annotation.Nullable
import
androidx.annotation.Nullable
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.TrackManager
...
@@ -25,11 +27,12 @@ private val TAG = ShVideoAdManager::class.java.simpleName
...
@@ -25,11 +27,12 @@ private val TAG = ShVideoAdManager::class.java.simpleName
* 天卓珊瑚广告视频
* 天卓珊瑚广告视频
*/
*/
class
ShVideoAdManager
private
constructor
(
activity
:
Activity
)
:
class
ShVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
)
{
BaseVideoAd
()
{
private
var
isClickScreen
:
Boolean
=
true
private
var
isClickScreen
:
Boolean
=
true
private
var
activity
:
Activity
?
=
null
private
var
shVideoAdListener
:
ShVideoAd
Listener
?
=
null
private
var
vedioAdStatusListener
:
VedioAdStatus
Listener
?
=
null
private
lateinit
var
ps
:
AppPreferences
private
lateinit
var
ps
:
AppPreferences
companion
object
{
companion
object
{
...
@@ -103,8 +106,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
...
@@ -103,8 +106,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
if
(
shVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dFail
()
vedioAdStatusListener
?.
a
dFail
()
}
}
}
}
...
@@ -127,8 +130,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
...
@@ -127,8 +130,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
isClickScreen
=
false
}
}
if
(
shVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dDownload
()
vedioAdStatusListener
?.
a
dDownload
()
}
}
return
super
.
onAdClicked
(
ad
)
return
super
.
onAdClicked
(
ad
)
...
@@ -168,8 +171,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
...
@@ -168,8 +171,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
shVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dSuccess
()
vedioAdStatusListener
?.
a
dSuccess
()
}
}
return
super
.
onVideoClosed
(
coralAD
,
s
)
return
super
.
onVideoClosed
(
coralAD
,
s
)
...
@@ -178,14 +181,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
...
@@ -178,14 +181,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
}
}
fun
setShVideoAdListener
(
shVideoAdListener
:
ShVideoAdListener
?)
{
fun
setVedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatusListener
?)
{
this
.
shVideoAdListener
=
shVideoAdListener
this
.
vedioAdStatusListener
=
vedioAdStatusListener
}
interface
ShVideoAdListener
{
fun
shVideoAdSuccess
()
fun
shVideoAdFail
()
fun
shVideoAdDownload
()
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
1c2147fd
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/WnVideoAdManager.kt
View file @
1c2147fd
package
com.mints.goodmoney.ad.video
package
com.mints.goodmoney.ad.video
import
android.app.Activity
import
android.app.Activity
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
import
com.wannuosili.sdk.*
import
com.wannuosili.sdk.*
...
@@ -15,13 +16,13 @@ private val TAG = WnVideoAdManager::class.java.simpleName
...
@@ -15,13 +16,13 @@ private val TAG = WnVideoAdManager::class.java.simpleName
* 闪电盒子视频
* 闪电盒子视频
*/
*/
class
WnVideoAdManager
private
constructor
(
activity
:
Activity
)
:
class
WnVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VideoAdManagerView
{
BaseVideoAd
(
)
{
private
var
wnVideoAdListener
:
WnVideoAd
Listener
?
=
null
private
var
vedioAdStatusListener
:
VedioAdStatus
Listener
?
=
null
private
var
mRewardVideoAd
:
WNRewardVideoAd
?
=
null
private
var
mRewardVideoAd
:
WNRewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
private
var
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
companion
object
{
private
var
_inst
:
WnVideoAdManager
?
=
null
private
var
_inst
:
WnVideoAdManager
?
=
null
...
@@ -65,8 +66,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
...
@@ -65,8 +66,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
if
(
wnVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dFail
()
vedioAdStatusListener
?.
a
dFail
()
}
}
}
}
...
@@ -88,8 +89,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
...
@@ -88,8 +89,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
isClickScreen
=
false
}
}
if
(
wnVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dDownload
()
vedioAdStatusListener
?.
a
dDownload
()
}
}
}
}
...
@@ -98,8 +99,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
...
@@ -98,8 +99,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
wnVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dSuccess
()
vedioAdStatusListener
?.
a
dSuccess
()
}
}
}
}
...
@@ -112,7 +113,6 @@ class WnVideoAdManager private constructor(activity: Activity) :
...
@@ -112,7 +113,6 @@ class WnVideoAdManager private constructor(activity: Activity) :
if
(
ad
.
type
==
WNAdConstant
.
AD_TYPE_DOWNLOAD
)
{
if
(
ad
.
type
==
WNAdConstant
.
AD_TYPE_DOWNLOAD
)
{
ad
.
downloadListener
=
object
:
WNAdDownloadListener
{
ad
.
downloadListener
=
object
:
WNAdDownloadListener
{
override
fun
onDownloadStarted
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{
override
fun
onDownloadStarted
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{
showToast
(
"开始下载"
)
}
}
override
fun
onDownloadFinished
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{}
override
fun
onDownloadFinished
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{}
...
@@ -126,14 +126,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
...
@@ -126,14 +126,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
})
})
}
}
fun
setWnVideoAdListener
(
wnVideoAdListener
:
WnVideoAdListener
?)
{
fun
setVedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatusListener
?)
{
this
.
wnVideoAdListener
=
wnVideoAdListener
this
.
vedioAdStatusListener
=
vedioAdStatusListener
}
interface
WnVideoAdListener
{
fun
wnVideoAdSuccess
()
fun
wnVideoAdFail
()
fun
wnVideoAdDownload
()
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/YlhVideoAdManager.java
View file @
1c2147fd
...
@@ -3,14 +3,13 @@ package com.mints.goodmoney.ad.video;
...
@@ -3,14 +3,13 @@ package com.mints.goodmoney.ad.video;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.os.SystemClock
;
import
android.os.SystemClock
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
;
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.ToastUtil
;
import
com.qq.e.ads.rewardvideo.RewardVideoAD
;
import
com.qq.e.ads.rewardvideo.RewardVideoAD
;
import
com.qq.e.ads.rewardvideo.RewardVideoADListener
;
import
com.qq.e.ads.rewardvideo.RewardVideoADListener
;
import
com.qq.e.comm.util.AdError
;
import
com.qq.e.comm.util.AdError
;
...
@@ -20,16 +19,16 @@ import java.lang.ref.WeakReference;
...
@@ -20,16 +19,16 @@ import java.lang.ref.WeakReference;
/**
/**
* 优量汇视频
* 优量汇视频
*/
*/
public
class
YlhVideoAdManager
extends
BaseVideoAd
implements
VideoAdManagerView
{
public
class
YlhVideoAdManager
extends
BaseVideoAd
{
private
static
YlhVideoAdManager
_inst
;
private
static
YlhVideoAdManager
_inst
;
// 优量汇激励视频
// 优量汇激励视频
private
RewardVideoAD
rewardVideoAD
;
private
RewardVideoAD
rewardVideoAD
;
private
YlhVideoAdListener
ylhVideoAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
private
Activity
activity
;
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
...
@@ -44,7 +43,6 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -44,7 +43,6 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
}
}
private
YlhVideoAdManager
(
WeakReference
<
Activity
>
activity
)
{
private
YlhVideoAdManager
(
WeakReference
<
Activity
>
activity
)
{
super
(
activity
.
get
());
init
(
activity
.
get
());
init
(
activity
.
get
());
}
}
...
@@ -144,17 +142,17 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -144,17 +142,17 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
if
(
SystemClock
.
elapsedRealtime
()
<
(
rewardVideoAD
.
getExpireTimestamp
()
-
delta
))
{
if
(
SystemClock
.
elapsedRealtime
()
<
(
rewardVideoAD
.
getExpireTimestamp
()
-
delta
))
{
rewardVideoAD
.
showAD
();
rewardVideoAD
.
showAD
();
}
else
{
}
else
{
showToast
(
"广告已过期,请再次请求广告后进行广告展示!"
);
//
showToast("广告已过期,请再次请求广告后进行广告展示!");
}
}
}
else
{
}
else
{
showToast
(
"此条广告已经展示过,请再次请求广告后进行广告展示!"
);
//
showToast("此条广告已经展示过,请再次请求广告后进行广告展示!");
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Load Fail"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Load Fail"
);
if
(
ylhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
}
}
...
@@ -195,8 +193,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -195,8 +193,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
isClickScreen
=
false
;
}
}
if
(
ylhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dDownload
();
vedioAdStatusListener
.
a
dDownload
();
}
}
}
}
...
@@ -211,8 +209,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -211,8 +209,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
if
(
ylhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dSuccess
();
vedioAdStatusListener
.
a
dSuccess
();
}
}
}
}
...
@@ -225,8 +223,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -225,8 +223,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
// 0 成功 1失败 2点击 3-有效展示
// 0 成功 1失败 2点击 3-有效展示
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
getErrorCode
()),
adError
.
getErrorMsg
());
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
getErrorCode
()),
adError
.
getErrorMsg
());
}
}
if
(
ylhVideoAd
Listener
!=
null
)
{
if
(
vedioAdStatus
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
vedioAdStatusListener
.
a
dFail
();
}
}
}
}
});
});
...
@@ -234,15 +232,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
...
@@ -234,15 +232,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
rewardVideoAD
.
loadAD
();
rewardVideoAD
.
loadAD
();
}
}
public
void
setYlhVideoAdListener
(
YlhVideoAdListener
ylhVideoAdListener
)
{
public
void
setVedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatusListener
)
{
this
.
ylhVideoAdListener
=
ylhVideoAdListener
;
this
.
vedioAdStatusListener
=
vedioAdStatusListener
;
}
public
interface
YlhVideoAdListener
{
void
ylhVideoAdFail
();
void
ylhVideoAdSuccess
();
void
ylhVideoAdDownload
();
}
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/base/BaseVideoAd.kt
0 → 100644
View file @
1c2147fd
package
com.mints.goodmoney.ad.video.base
import
android.app.Activity
import
com.mints.goodmoney.common.Constant
import
java.util.*
open
class
BaseVideoAd
{
/**
* 激励视频请求接口封装
*/
fun
getAdMapVO
(
carrierType
:
String
,
adsource
:
String
,
extraId
:
String
?,
curCoin
:
Int
):
HashMap
<
String
,
Any
>
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"adtype"
]
=
Constant
.
ADTYPE_VEDIO
vo
[
"adsource"
]
=
adsource
var
tempExtraId
=
""
if
(
extraId
!=
null
)
{
tempExtraId
=
extraId
}
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_HOMEWATER
->
vo
[
"waterCoin"
]
=
curCoin
Constant
.
CARRIER_OFFLINE_DOUBLE
->
vo
[
"offline_income"
]
=
curCoin
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
->
vo
[
"turntableKey"
]
=
tempExtraId
}
return
vo
}
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{}
open
fun
onDestroy
()
{}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/base/ChannelRuleEnum.java
0 → 100644
View file @
1c2147fd
package
com
.
mints
.
goodmoney
.
ad
.
video
.
base
;
//package com.example.rule;
public
enum
ChannelRuleEnum
{
/**
* 头条
*/
// CSJ_FULL_AD(Constant.CSJ_FULL_AD, CsjFullVideoAdManager.getInstance()),
// CSJ_VEDIO_AD(Constant.CSJ_VEDIO_AD, CsjVideoAdManager.getInstance()),
;
public
String
name
;
public
BaseVideoAd
channel
;
ChannelRuleEnum
(
String
name
,
BaseVideoAd
channel
)
{
this
.
name
=
name
;
this
.
channel
=
channel
;
}
//匹配
public
static
ChannelRuleEnum
match
(
String
name
)
{
ChannelRuleEnum
[]
values
=
ChannelRuleEnum
.
values
();
for
(
ChannelRuleEnum
value
:
values
)
{
if
(
value
.
name
.
equals
(
name
))
{
return
value
;
}
}
return
null
;
}
public
String
getName
()
{
return
name
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/base/VedioAdStatusListener.kt
0 → 100644
View file @
1c2147fd
package
com.mints.goodmoney.ad.video.base
/**
* 广告状态触发事件
*/
interface
VedioAdStatusListener
{
/**
* 广告加载失败
*/
fun
adFail
()
/**
* 广告加载成功
*/
fun
adSuccess
()
/**
* 点击广告
*/
fun
adDownload
()
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
View file @
1c2147fd
...
@@ -25,7 +25,9 @@ import com.mints.goodmoney.ui.widgets.dialog.DrawcashVideoDialog
...
@@ -25,7 +25,9 @@ import com.mints.goodmoney.ui.widgets.dialog.DrawcashVideoDialog
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.json.JsonUtil
import
com.mints.library.utils.json.JsonUtil
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_drawcash.*
import
kotlinx.android.synthetic.main.activity_drawcash.*
import
kotlinx.android.synthetic.main.fragment_main_my.*
import
kotlinx.android.synthetic.main.header_layout.*
import
kotlinx.android.synthetic.main.header_layout.*
import
kotlinx.android.synthetic.main.view_title.*
import
kotlinx.android.synthetic.main.view_title.*
import
java.math.BigDecimal
import
java.math.BigDecimal
...
@@ -381,6 +383,8 @@ class DrawcashActivity : BaseActivity(),
...
@@ -381,6 +383,8 @@ class DrawcashActivity : BaseActivity(),
}
}
override
fun
userFrequently
()
{
override
fun
userFrequently
()
{
if
(
AntiShake
.
check
(
tvDrawcashExplain
?.
id
))
return
readyGoThenKill
(
DrawcashRecordActivity
::
class
.
java
)
readyGoThenKill
(
DrawcashRecordActivity
::
class
.
java
)
}
}
...
...
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