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
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 {
// implementation(name: 'ks_3.3.5.3', 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
'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;
import
com.bytedance.sdk.openadsdk.TTAdNative
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
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.manager.TrackManager
;
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
CsjFullVedioAdListener
csjFullVedioAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
...
...
@@ -37,7 +38,6 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
private
CsjFullVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
...
...
@@ -68,8 +68,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
public
void
onError
(
int
code
,
String
message
)
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -92,16 +92,16 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedio
Download
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
ad
Download
();
}
}
@Override
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dSuccess
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dSuccess
();
}
if
(
activity
!=
null
)
{
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJFULL
,
extraId
,
curCoin
));
...
...
@@ -129,8 +129,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -146,15 +146,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
activity
=
null
;
}
public
void
set
CsjFullVedioAdListener
(
CsjFullVedioAdListener
csjFullVedioAd
Listener
)
{
this
.
csjFullVedioAdListener
=
csjFullVedioAd
Listener
;
public
void
set
VedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatus
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;
import
com.bytedance.sdk.openadsdk.TTAppDownloadListener
;
import
com.bytedance.sdk.openadsdk.TTRewardVideoAd
;
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.Constant
;
import
com.mints.goodmoney.manager.TTNativeExpressManager
;
...
...
@@ -31,7 +33,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
private
AppPreferences
ps
;
private
int
curCoin
;
private
String
extraId
;
private
CsjVideoAdListener
csjVideoAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
...
...
@@ -48,7 +50,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
private
CsjVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
...
...
@@ -66,7 +67,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
if
(
mttRewardVideoAd
!=
null
)
{
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
}
ps
=
null
;
activity
=
null
;
}
...
...
@@ -81,7 +82,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
isClickScreen
=
true
;
this
.
curCoin
=
curCoin
;
this
.
extraId
=
extraId
;
String
codeId
=
TtCsjAdManager
.
TT_AD_VEDIO_MAIN_DEV
;
if
(!
BuildConfig
.
DEBUG
)
{
switch
(
carrierType
)
{
...
...
@@ -150,9 +150,9 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
LogUtil
.
d
(
"
csjVideoAd
Listener"
,
"onError "
+
code
+
message
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
LogUtil
.
d
(
"
vedioAdStatus
Listener"
,
"onError "
+
code
+
message
);
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -165,8 +165,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -197,8 +197,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideo
Download
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
ad
Download
();
}
}
...
...
@@ -206,8 +206,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dSuccess
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dSuccess
();
}
}
...
...
@@ -219,8 +219,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onVideoError
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -299,15 +299,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
return
vo
;
}
public
void
set
CsjVideoAdListener
(
CsjVideoAdListener
csjVideoAd
Listener
)
{
this
.
csjVideoAdListener
=
csjVideoAd
Listener
;
public
void
set
VedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatus
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
import
com.kwad.sdk.api.KsLoadManager
import
com.kwad.sdk.api.KsRewardVideoAd
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.Constant
import
com.mints.goodmoney.manager.KsManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.ToastUtil
private
val
TAG
=
KsVideoAdManager
::
class
.
java
.
simpleName
...
...
@@ -20,13 +20,13 @@ private val TAG = KsVideoAdManager::class.java.simpleName
* 快手广告视频
*/
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
isClickScreen
:
Boolean
=
true
override
var
activity
:
Activity
?
=
null
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
KsVideoAdManager
?
=
null
...
...
@@ -55,8 +55,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
val
scene
=
KsScene
.
Builder
(
KsManager
.
KS_AD_VEDIO_POSTID
).
build
()
KsAdSDK
.
getLoadManager
().
loadRewardVideoAd
(
scene
,
object
:
KsLoadManager
.
RewardVideoAdListener
{
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
if
(
ksVideoAd
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dFail
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dFail
()
}
}
...
...
@@ -79,8 +79,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
ksVideoAd
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dDownload
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dDownload
()
}
}
...
...
@@ -91,8 +91,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
ksVideoAd
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dSuccess
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dSuccess
()
}
}
...
...
@@ -101,8 +101,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
ksVideoAd
Listener
!=
null
)
{
ksVideoAdListener
?.
ksVideoA
dFail
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dFail
()
}
}
...
...
@@ -131,15 +131,10 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
fun
set
KsVideoAdListener
(
ksVideoAdListener
:
KsVideoAd
Listener
?)
{
this
.
ksVideoAdListener
=
ksVideoAd
Listener
fun
set
VedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatus
Listener
?)
{
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
}
interface
KsVideoAdListener
{
fun
ksVideoAdSuccess
()
fun
ksVideoAdFail
()
fun
ksVideoAdDownload
()
}
override
fun
onDestroy
()
{
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
import
android.app.Activity
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.Constant
import
com.mints.goodmoney.manager.MhManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
private
val
TAG
=
MhVideoAdManager
::
class
.
java
.
simpleName
...
...
@@ -15,13 +16,13 @@ private val TAG = MhVideoAdManager::class.java.simpleName
* 枫岚广告视频
*/
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
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
MhVideoAdManager
?
=
null
...
...
@@ -84,8 +85,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
mhVideoAd
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dDownload
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dDownload
()
}
}
...
...
@@ -100,8 +101,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
mhVideoAd
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dSuccess
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dSuccess
()
}
}
...
...
@@ -110,8 +111,8 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
mhVideoAd
Listener
!=
null
)
{
mhVideoAdListener
?.
mhVideoA
dFail
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dFail
()
}
}
...
...
@@ -120,15 +121,10 @@ class MhVideoAdManager private constructor(activity: Activity) :
mRewardVideoAd
?.
loadAd
()
}
fun
set
MhVideoAdListener
(
mhVideoAdListener
:
MhVideoAd
Listener
?)
{
this
.
mhVideoAdListener
=
mhVideoAd
Listener
fun
set
VedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatus
Listener
?)
{
this
.
vedioAdStatusListener
=
vedioAdStatus
Listener
}
interface
MhVideoAdListener
{
fun
mhVideoAdSuccess
()
fun
mhVideoAdFail
()
fun
mhVideoAdDownload
()
}
override
fun
onDestroy
()
{
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
import
android.text.TextUtils
import
androidx.annotation.Nullable
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.Constant
import
com.mints.goodmoney.manager.TrackManager
...
...
@@ -25,11 +27,12 @@ private val TAG = ShVideoAdManager::class.java.simpleName
* 天卓珊瑚广告视频
*/
class
ShVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
)
{
BaseVideoAd
()
{
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
companion
object
{
...
...
@@ -103,8 +106,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
if
(
shVideoAd
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dFail
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dFail
()
}
}
...
...
@@ -127,8 +130,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
shVideoAd
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dDownload
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dDownload
()
}
return
super
.
onAdClicked
(
ad
)
...
...
@@ -168,8 +171,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
shVideoAd
Listener
!=
null
)
{
shVideoAdListener
?.
shVideoA
dSuccess
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dSuccess
()
}
return
super
.
onVideoClosed
(
coralAD
,
s
)
...
...
@@ -178,14 +181,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
}
fun
setShVideoAdListener
(
shVideoAdListener
:
ShVideoAdListener
?)
{
this
.
shVideoAdListener
=
shVideoAdListener
}
interface
ShVideoAdListener
{
fun
shVideoAdSuccess
()
fun
shVideoAdFail
()
fun
shVideoAdDownload
()
fun
setVedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatusListener
?)
{
this
.
vedioAdStatusListener
=
vedioAdStatusListener
}
override
fun
onDestroy
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
1c2147fd
...
...
@@ -7,7 +7,9 @@ import android.content.Intent;
import
android.content.IntentFilter
;
import
android.text.TextUtils
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.ad.video.base.BaseVideoAd
;
import
com.mints.goodmoney.ad.video.base.ChannelRuleEnum
;
import
com.mints.goodmoney.ad.video.base.VedioAdStatusListener
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.TrackManager
;
...
...
@@ -16,7 +18,6 @@ import com.mints.goodmoney.mvp.model.WeightBean;
import
com.mints.goodmoney.service.AppInstallService
;
import
com.mints.goodmoney.utils.AppUtil
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.ToastUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
...
...
@@ -362,37 +363,37 @@ public class VideoAdingManager {
*/
public
void
onDestory
()
{
if
(
csjVideoAdManager
!=
null
)
{
csjVideoAdManager
.
set
CsjVideoAd
Listener
(
null
);
csjVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
csjVideoAdManager
.
onDestroy
();
csjVideoAdManager
=
null
;
}
if
(
ylhVideoAdManager
!=
null
)
{
ylhVideoAdManager
.
set
YlhVideoAd
Listener
(
null
);
ylhVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
ylhVideoAdManager
.
onDestroy
();
ylhVideoAdManager
=
null
;
}
if
(
wnVideoAdManager
!=
null
)
{
wnVideoAdManager
.
set
WnVideoAd
Listener
(
null
);
wnVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
wnVideoAdManager
.
onDestroy
();
wnVideoAdManager
=
null
;
}
if
(
mhVideoAdManager
!=
null
)
{
mhVideoAdManager
.
set
MhVideoAd
Listener
(
null
);
mhVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
mhVideoAdManager
.
onDestroy
();
mhVideoAdManager
=
null
;
}
if
(
csjFullVideoAdManager
!=
null
)
{
csjFullVideoAdManager
.
set
CsjFullVedioAd
Listener
(
null
);
csjFullVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
csjFullVideoAdManager
.
onDestroy
();
csjFullVideoAdManager
=
null
;
}
if
(
shVideoAdManager
!=
null
)
{
shVideoAdManager
.
set
ShVideoAd
Listener
(
null
);
shVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
shVideoAdManager
.
onDestroy
();
shVideoAdManager
=
null
;
}
if
(
ksVideoAdManager
!=
null
)
{
ksVideoAdManager
.
set
KsVideoAd
Listener
(
null
);
ksVideoAdManager
.
set
VedioAdStatus
Listener
(
null
);
ksVideoAdManager
.
onDestroy
();
ksVideoAdManager
=
null
;
}
...
...
@@ -441,16 +442,16 @@ public class VideoAdingManager {
ylhVideoAdManager
=
YlhVideoAdManager
.
getInstance
(
activity
);
}
ylhVideoAdManager
.
set
YlhVideoAdListener
(
new
YlhVideoAdManager
.
YlhVideoAd
Listener
()
{
ylhVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
ylhVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
YLH_VEDIO_AD
);
}
}
@Override
public
void
ylhVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
ylhAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
YLH_VEDIO_AD
);
...
...
@@ -458,7 +459,7 @@ public class VideoAdingManager {
}
@Override
public
void
ylhVideoA
dDownload
()
{
public
void
a
dDownload
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -476,19 +477,20 @@ public class VideoAdingManager {
return
;
}
csjVideoAdManager
=
CsjVideoAdManager
.
getInstance
(
activity
);
// csjVideoAdManager = CsjVideoAdManager.getInstance();
}
csjVideoAdManager
.
set
CsjVideoAdListener
(
new
CsjVideoAdManager
.
CsjVideoAd
Listener
()
{
csjVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
csjVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
CSJ_VEDIO_AD
);
}
}
@Override
public
void
csjVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
csjVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
CSJ_VEDIO_AD
);
...
...
@@ -496,7 +498,7 @@ public class VideoAdingManager {
}
@Override
public
void
csjVideo
Download
()
{
public
void
ad
Download
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -515,9 +517,9 @@ public class VideoAdingManager {
}
wnVideoAdManager
=
WnVideoAdManager
.
Companion
.
getInstance
(
activity
);
}
wnVideoAdManager
.
set
WnVideoAdListener
(
new
WnVideoAdManager
.
WnVideoAd
Listener
()
{
wnVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
wnVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
wnVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
SDHZ_VEDIO_AD
);
...
...
@@ -525,14 +527,14 @@ public class VideoAdingManager {
}
@Override
public
void
wnVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
@Override
public
void
wnVideoA
dDownload
()
{
public
void
a
dDownload
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -551,9 +553,9 @@ public class VideoAdingManager {
}
mhVideoAdManager
=
MhVideoAdManager
.
Companion
.
getInstance
(
activity
);
}
mhVideoAdManager
.
set
MhVideoAdListener
(
new
MhVideoAdManager
.
MhVideoAd
Listener
()
{
mhVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
mhVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
flVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
FL_VEDIO_AD
);
...
...
@@ -561,14 +563,14 @@ public class VideoAdingManager {
}
@Override
public
void
mhVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
FL_VEDIO_AD
);
}
}
@Override
public
void
mhVideoA
dDownload
()
{
public
void
a
dDownload
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -588,9 +590,9 @@ public class VideoAdingManager {
}
csjFullVideoAdManager
=
CsjFullVideoAdManager
.
getInstance
(
activity
);
}
csjFullVideoAdManager
.
set
CsjFullVedioAdListener
(
new
CsjFullVideoAdManager
.
CsjFullVedioAdListener
()
{
csjFullVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatusListener
()
{
@Override
public
void
csjFullVedioA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
csjFullVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
CSJ_FULL_AD
);
...
...
@@ -598,14 +600,14 @@ public class VideoAdingManager {
}
@Override
public
void
csjFullVedioA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
CSJ_FULL_AD
);
}
}
@Override
public
void
csjFullVedio
Download
()
{
public
void
ad
Download
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -625,9 +627,9 @@ public class VideoAdingManager {
}
shVideoAdManager
=
ShVideoAdManager
.
Companion
.
getInstance
(
activity
);
}
shVideoAdManager
.
set
ShVideoAdListener
(
new
ShVideoAdManager
.
ShVideoAd
Listener
()
{
shVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
shVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
shVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
SH_VEDIO_AD
);
...
...
@@ -635,14 +637,14 @@ public class VideoAdingManager {
}
@Override
public
void
shVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
SH_VEDIO_AD
);
}
}
@Override
public
void
shVideoA
dDownload
()
{
public
void
a
dDownload
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -662,9 +664,9 @@ public class VideoAdingManager {
}
ksVideoAdManager
=
KsVideoAdManager
.
Companion
.
getInstance
(
activity
);
}
ksVideoAdManager
.
set
KsVideoAdListener
(
new
KsVideoAdManager
.
KsVideoAd
Listener
()
{
ksVideoAdManager
.
set
VedioAdStatusListener
(
new
VedioAdStatus
Listener
()
{
@Override
public
void
ksVideoA
dSuccess
()
{
public
void
a
dSuccess
()
{
AppConfig
.
ksVideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
KS_VEDIO_AD
);
...
...
@@ -672,14 +674,14 @@ public class VideoAdingManager {
}
@Override
public
void
ksVideoA
dFail
()
{
public
void
a
dFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
KS_VEDIO_AD
);
}
}
@Override
public
void
ksVideoA
dDownload
()
{
public
void
a
dDownload
()
{
isVideoAdDownload
=
true
;
// 注册下载任务监听
...
...
@@ -689,6 +691,12 @@ public class VideoAdingManager {
ksVideoAdManager
.
loadAd
(
activity
,
bean
.
getCurCoin
(),
bean
.
getCarrierType
(),
bean
.
getExtraId
());
}
// ChannelRuleEnum channelRule = ChannelRuleEnum.match(videoAdType);
// BaseVideoAd rule = channelRule.channel;
// if (rule != null) {
// rule.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
// }
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
if
(
videoAdingListener
!=
null
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/WnVideoAdManager.kt
View file @
1c2147fd
package
com.mints.goodmoney.ad.video
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.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.wannuosili.sdk.*
...
...
@@ -15,13 +16,13 @@ private val TAG = WnVideoAdManager::class.java.simpleName
* 闪电盒子视频
*/
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
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
WnVideoAdManager
?
=
null
...
...
@@ -65,8 +66,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
if
(
wnVideoAd
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dFail
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dFail
()
}
}
...
...
@@ -88,8 +89,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
wnVideoAd
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dDownload
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dDownload
()
}
}
...
...
@@ -98,8 +99,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
wnVideoAd
Listener
!=
null
)
{
wnVideoAdListener
?.
wnVideoA
dSuccess
()
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
?.
a
dSuccess
()
}
}
...
...
@@ -112,7 +113,6 @@ class WnVideoAdManager private constructor(activity: Activity) :
if
(
ad
.
type
==
WNAdConstant
.
AD_TYPE_DOWNLOAD
)
{
ad
.
downloadListener
=
object
:
WNAdDownloadListener
{
override
fun
onDownloadStarted
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{
showToast
(
"开始下载"
)
}
override
fun
onDownloadFinished
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{}
...
...
@@ -126,14 +126,8 @@ class WnVideoAdManager private constructor(activity: Activity) :
})
}
fun
setWnVideoAdListener
(
wnVideoAdListener
:
WnVideoAdListener
?)
{
this
.
wnVideoAdListener
=
wnVideoAdListener
}
interface
WnVideoAdListener
{
fun
wnVideoAdSuccess
()
fun
wnVideoAdFail
()
fun
wnVideoAdDownload
()
fun
setVedioAdStatusListener
(
vedioAdStatusListener
:
VedioAdStatusListener
?)
{
this
.
vedioAdStatusListener
=
vedioAdStatusListener
}
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;
import
android.app.Activity
;
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.Constant
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.mvp.views.VideoAdManagerView
;
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.RewardVideoADListener
;
import
com.qq.e.comm.util.AdError
;
...
...
@@ -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
RewardVideoAD
rewardVideoAD
;
private
YlhVideoAdListener
ylhVideoAd
Listener
;
private
VedioAdStatusListener
vedioAdStatus
Listener
;
Activity
activity
;
private
Activity
activity
;
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
...
...
@@ -44,7 +43,6 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
}
private
YlhVideoAdManager
(
WeakReference
<
Activity
>
activity
)
{
super
(
activity
.
get
());
init
(
activity
.
get
());
}
...
...
@@ -144,17 +142,17 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
if
(
SystemClock
.
elapsedRealtime
()
<
(
rewardVideoAD
.
getExpireTimestamp
()
-
delta
))
{
rewardVideoAD
.
showAD
();
}
else
{
showToast
(
"广告已过期,请再次请求广告后进行广告展示!"
);
//
showToast("广告已过期,请再次请求广告后进行广告展示!");
}
}
else
{
showToast
(
"此条广告已经展示过,请再次请求广告后进行广告展示!"
);
//
showToast("此条广告已经展示过,请再次请求广告后进行广告展示!");
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Load Fail"
);
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -195,8 +193,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dDownload
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dDownload
();
}
}
...
...
@@ -211,8 +209,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dSuccess
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dSuccess
();
}
}
...
...
@@ -225,8 +223,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
// 0 成功 1失败 2点击 3-有效展示
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
getErrorCode
()),
adError
.
getErrorMsg
());
}
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
if
(
vedioAdStatus
Listener
!=
null
)
{
vedioAdStatusListener
.
a
dFail
();
}
}
});
...
...
@@ -234,15 +232,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
rewardVideoAD
.
loadAD
();
}
public
void
setYlhVideoAdListener
(
YlhVideoAdListener
ylhVideoAdListener
)
{
this
.
ylhVideoAdListener
=
ylhVideoAdListener
;
}
public
interface
YlhVideoAdListener
{
void
ylhVideoAdFail
();
void
ylhVideoAdSuccess
();
void
ylhVideoAdDownload
();
public
void
setVedioAdStatusListener
(
VedioAdStatusListener
vedioAdStatusListener
)
{
this
.
vedioAdStatusListener
=
vedioAdStatusListener
;
}
}
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
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.utils.CommonUtils
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.fragment_main_my.*
import
kotlinx.android.synthetic.main.header_layout.*
import
kotlinx.android.synthetic.main.view_title.*
import
java.math.BigDecimal
...
...
@@ -381,6 +383,8 @@ class DrawcashActivity : BaseActivity(),
}
override
fun
userFrequently
()
{
if
(
AntiShake
.
check
(
tvDrawcashExplain
?.
id
))
return
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