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
5190f2a5
Commit
5190f2a5
authored
Nov 23, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加穿山甲ip校验
parent
896814b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
65 deletions
+63
-65
UserTaskMsgBean.java
...n/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
+6
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+57
-65
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
View file @
5190f2a5
...
...
@@ -9,6 +9,8 @@ public class UserTaskMsgBean implements Serializable {
private
UserMsgBean
userMsg
;
private
VedioRulesBean
vedioRules
;
private
String
ip
;
public
OfflineBean
getOfflineBean
()
{
return
offline
;
}
...
...
@@ -20,4 +22,8 @@ public class UserTaskMsgBean implements Serializable {
public
VedioRulesBean
getVedioRules
()
{
return
vedioRules
;
}
public
String
getIp
()
{
return
ip
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
5190f2a5
...
...
@@ -58,13 +58,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
var
isToCreateReward
=
true
// 是否还有剩余红包 服务器返回
private
var
isFirstLoadVedio
=
true
// 首次加载视频初始化 本地判断
private
var
isAward
=
false
// 是否可以领金币 本地判断
private
var
isFirstWatchVideo
=
true
// 是否是第一次观看完视频
// 广告权重相关
private
var
vedioAdingManager
:
VedioAdingManager
?
=
null
// 是否是第一次观看完视频
private
var
isFirstWatchVideo
=
true
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_first
override
fun
initViewsAndEvents
()
{
...
...
@@ -82,67 +80,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
initListener
()
}
private
fun
initListener
()
{
cdvvYilanTime
.
setOnClickListener
(
this
)
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onSuccess"
)
}
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
}
override
fun
onRenderError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
}
override
fun
onShow
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onShow"
)
resumeAdTime
()
}
override
fun
onClick
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onSkip
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onTimeOver
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onClose
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onAdEmpty
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onVideoStart
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onVideoStart"
)
}
override
fun
onVideoPause
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoPause"
)
pauseDownloadTime
()
}
override
fun
onVideoResume
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoResume"
)
resumeAdTime
()
}
override
fun
onVideoComplete
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoComplete"
)
pauseDownloadTime
()
}
override
fun
onVideoError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
})
}
private
fun
resumeAdTime
()
{
// 视频未转满 且 界面切换时可继续加进度
if
(!
isAward
)
{
cdvvYilanTime
?.
resume
()
}
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
littleVideoFragment
?.
onHiddenChanged
(
hidden
)
...
...
@@ -211,7 +148,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
userMsgBean
=
data
// 保存Ip,用于穿山甲回调校验
ps
.
put
(
Constant
.
CSJ_VEDIO_APPIP
,
""
)
ps
.
put
(
Constant
.
CSJ_VEDIO_APPIP
,
data
.
ip
)
// 放到个人中心展示 防止首页红包转动异常
// 新人福利
...
...
@@ -356,6 +293,61 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
})
}
private
fun
initListener
()
{
cdvvYilanTime
.
setOnClickListener
(
this
)
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
}
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
}
override
fun
onRenderError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
}
override
fun
onShow
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
resumeAdTime
()
}
override
fun
onClick
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onSkip
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onTimeOver
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onClose
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onAdEmpty
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onVideoStart
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
}
override
fun
onVideoPause
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
pauseDownloadTime
()
}
override
fun
onVideoResume
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
resumeAdTime
()
}
override
fun
onVideoComplete
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
pauseDownloadTime
()
}
override
fun
onVideoError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
})
}
private
fun
resumeAdTime
()
{
// 视频未转满 且 界面切换时可继续加进度
if
(!
isAward
)
{
cdvvYilanTime
?.
resume
()
}
}
/**
* 将播放的id记录到list中
*/
...
...
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