Commit 5190f2a5 authored by mengcuiguang's avatar mengcuiguang

添加穿山甲ip校验

parent 896814b5
......@@ -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;
}
}
......@@ -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中
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment