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
dea0f819
Commit
dea0f819
authored
Feb 05, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
03432d7e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
19 deletions
+26
-19
KsVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
+6
-6
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+18
-12
KsManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/KsManager.kt
+2
-1
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
View file @
dea0f819
...
...
@@ -63,7 +63,7 @@ class KsVideoAdManager private constructor(activity: Activity) :
mRewardVideoAd
!!
.
setRewardAdInteractionListener
(
object
:
KsRewardVideoAd
.
RewardAdInteractionListener
{
override
fun
onAdClicked
()
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告点击"
)
//
ToastUtil.show(activity, "快手激励视频⼴告点击")
if
(
AppConfig
.
needReportClickAdEvent
)
{
TrackManager
.
getInstance
().
reportClickAdEvent
()
...
...
@@ -82,7 +82,7 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
override
fun
onPageDismiss
()
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告关闭"
)
//
ToastUtil.show(activity, "快手激励视频⼴告关闭")
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_KS
,
extraId
,
curCoin
))
...
...
@@ -94,7 +94,7 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
override
fun
onVideoPlayError
(
p0
:
Int
,
p1
:
Int
)
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告播放出错"
)
//
ToastUtil.show(activity, "快手激励视频⼴告播放出错")
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
...
...
@@ -104,15 +104,15 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
override
fun
onVideoPlayEnd
()
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告播放完成"
)
//
ToastUtil.show(activity, "快手激励视频⼴告播放完成")
}
override
fun
onVideoPlayStart
()
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告播放开始"
)
//
ToastUtil.show(activity, "快手激励视频⼴告播放开始")
}
override
fun
onRewardVerify
()
{
ToastUtil
.
show
(
activity
,
"快手激励视频⼴告获取激励"
)
//
ToastUtil.show(activity, "快手激励视频⼴告获取激励")
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_KS
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
)
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
dea0f819
...
...
@@ -31,6 +31,9 @@ public class VideoAdingManager {
private
static
VideoAdingManager
_inst
;
// APP下载回调广播
private
BroadcastReceiver
mReceiverBroadcastReceiver
=
null
;
private
VideoAdingListener
videoAdingListener
;
private
WnVideoAdManager
wnVideoAdManager
;
...
...
@@ -87,9 +90,6 @@ public class VideoAdingManager {
weightList
=
new
ArrayList
<>();
}
// APP下载回调广播
private
BroadcastReceiver
mReceiverBroadcastReceiver
=
null
;
private
void
registerBroad
()
{
if
(
AppConfig
.
isSuperTask
)
{
return
;
...
...
@@ -208,6 +208,8 @@ public class VideoAdingManager {
nextAdType
=
Constant
.
YLH_VEDIO_AD
;
}
else
if
(
AppConfig
.
csjFullVideoAdCount
>
0
)
{
nextAdType
=
Constant
.
CSJ_FULL_AD
;
}
else
if
(
AppConfig
.
ksVideoAdCount
>
0
)
{
nextAdType
=
Constant
.
KS_VEDIO_AD
;
}
else
if
(
AppConfig
.
shVideoAdCount
>
0
)
{
nextAdType
=
Constant
.
SH_VEDIO_AD
;
}
else
{
...
...
@@ -277,6 +279,11 @@ public class VideoAdingManager {
weight
=
weight
+
csjFullVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:csjFullVedioWeight:"
+
csjFullVideoWeight
);
}
if
(
AppConfig
.
ksVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
ksVideoWeight
,
Constant
.
KS_VEDIO_AD
));
weight
=
weight
+
ksVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:ksWeight:"
+
ksVideoWeight
);
}
if
(
AppConfig
.
flVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
flVideoWeight
,
Constant
.
FL_VEDIO_AD
));
weight
=
weight
+
flVideoWeight
;
...
...
@@ -292,11 +299,7 @@ public class VideoAdingManager {
weight
=
weight
+
shVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:shWeight:"
+
shVideoWeight
);
}
if
(
AppConfig
.
ksVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
ksVideoWeight
,
Constant
.
KS_VEDIO_AD
));
weight
=
weight
+
ksVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:ksWeight:"
+
ksVideoWeight
);
}
// 权重随机
if
(
weightList
!=
null
&&
weightList
.
size
()
>
0
&&
weight
>
0
)
{
...
...
@@ -338,8 +341,11 @@ public class VideoAdingManager {
int
wnAdCount
=
AppConfig
.
wnVideoAdCount
;
int
flVideoAdCount
=
AppConfig
.
flVideoAdCount
;
int
tzVideoAdCount
=
AppConfig
.
shVideoAdCount
;
int
ksVideoAdCount
=
AppConfig
.
ksVideoAdCount
;
if
(
ylhAdCount
<=
0
&&
csjVideoAdCount
<=
0
&&
wnAdCount
<=
0
&&
flVideoAdCount
<=
0
&&
tzVideoAdCount
<=
0
)
{
if
(
ylhAdCount
<=
0
&&
csjVideoAdCount
<=
0
&&
wnAdCount
<=
0
&&
flVideoAdCount
<=
0
&&
tzVideoAdCount
<=
0
&&
ksVideoAdCount
<=
0
)
{
// showToast("今日视频已看完,请明天再来吧");
return
true
;
}
...
...
@@ -654,16 +660,16 @@ public class VideoAdingManager {
ksVideoAdManager
.
setKsVideoAdListener
(
new
KsVideoAdManager
.
KsVideoAdListener
()
{
@Override
public
void
ksVideoAdSuccess
()
{
AppConfig
.
sh
VideoAdCount
--;
AppConfig
.
ks
VideoAdCount
--;
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
SH
_VEDIO_AD
);
videoAdingListener
.
videoAdingListenerSuccess
(
Constant
.
KS
_VEDIO_AD
);
}
}
@Override
public
void
ksVideoAdFail
()
{
if
(
videoAdingListener
!=
null
)
{
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
SH
_VEDIO_AD
);
videoAdingListener
.
videoAdingListenerFail
(
Constant
.
KS
_VEDIO_AD
);
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/KsManager.kt
View file @
dea0f819
...
...
@@ -3,6 +3,7 @@ package com.mints.goodmoney.manager
import
android.app.Application
import
com.kwad.sdk.api.KsAdSDK
import
com.kwad.sdk.api.SdkConfig
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.R
/**
...
...
@@ -31,7 +32,7 @@ object KsManager {
.
appId
(
KS_APP_ID
)
// 测试aapId,请联系快⼿平台申请正式AppId,必填
.
appName
(
application
.
getString
(
R
.
string
.
app_name
))
// 测试appName,请填写您应⽤的名称,⾮必填
.
showNotification
(
true
)
// 是否展示下载通知栏
.
debug
(
true
)
// 是否开启sdk 调试⽇志 可选
.
debug
(
BuildConfig
.
DEBUG
)
// 是否开启sdk 调试⽇志 可选
.
build
())
}
...
...
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