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
2abf2287
Commit
2abf2287
authored
Feb 26, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加信息流权重bean
parent
a12406bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
5 deletions
+48
-5
PreLoadExpressManager.kt
...a/com/mints/goodmoney/ad/express/PreLoadExpressManager.kt
+4
-5
FlowAdRulesBean.java
...n/java/com/mints/goodmoney/mvp/model/FlowAdRulesBean.java
+25
-0
UserTaskMsgBean.java
...n/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
+5
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+8
-0
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+6
-0
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/PreLoadExpressManager.kt
View file @
2abf2287
...
...
@@ -7,6 +7,7 @@ import com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.model.WeightBean
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.ToastUtil
import
com.qq.e.ads.nativ.NativeExpressADView
import
java.util.*
...
...
@@ -72,9 +73,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
* 根据权重获取广告类型
*/
private
fun
getRandomWeight
():
String
{
if
(
weightList
!=
null
)
{
weightList
.
clear
()
}
weightList
.
clear
()
var
weight
=
0
// 若没有视频完成数,不加入权重计算范围内
if
(
csjWeight
>
0
)
{
...
...
@@ -94,13 +93,13 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
}
// 权重随机
if
(
weightList
!=
null
&&
weightList
.
size
>
0
&&
weight
>
0
)
{
if
(
weightList
.
size
>
0
&&
weight
>
0
)
{
LogUtil
.
d
(
TAG
,
"1、权重总值EXPRESS:$weight"
)
val
r
=
Random
()
var
randomWeight
=
r
.
nextInt
(
weight
)
+
1
LogUtil
.
d
(
TAG
,
"2、权重随机值EXPRESS:$randomWeight"
)
// ToastUtil.show(MintsApplication.getContext(), "权重随机值
:" + randomWeight);
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
"权重随机值EXPRESS
:"
+
randomWeight
);
for
(
weightBean
in
weightList
)
{
randomWeight
-=
weightBean
.
weight
if
(
randomWeight
<=
0
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/FlowAdRulesBean.java
0 → 100644
View file @
2abf2287
package
com
.
mints
.
goodmoney
.
mvp
.
model
;
import
java.io.Serializable
;
/**
* 用户渠道对应代码位
*/
public
class
FlowAdRulesBean
implements
Serializable
{
private
int
YLH
;
private
int
KS
;
private
int
CSJ
;
public
int
getYLH
()
{
return
YLH
;
}
public
int
getKS
()
{
return
KS
;
}
public
int
getCSJ
()
{
return
CSJ
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
View file @
2abf2287
...
...
@@ -12,6 +12,7 @@ public class UserTaskMsgBean implements Serializable {
private
BlessingBigMsgBean
blessingBigMsg
;
private
UserRiskAppsBean
userRiskApps
;
private
AdcodeBean
adcode_v1
=
null
;
private
FlowAdRulesBean
flowAdRules
;
private
String
ip
;
private
String
channel
;
...
...
@@ -120,4 +121,8 @@ public class UserTaskMsgBean implements Serializable {
public
String
getChannel
()
{
return
channel
;
}
public
FlowAdRulesBean
getFlowAdRules
()
{
return
flowAdRules
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
2abf2287
...
...
@@ -21,6 +21,7 @@ import com.mints.goodmoney.ad.video.VideoAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.*
import
com.mints.goodmoney.mvp.model.FlowAdRulesBean
import
com.mints.goodmoney.mvp.model.MainVideoMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.presenters.HomePresenter
...
...
@@ -233,6 +234,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 设置视频权重
initAdWeight
(
data
)
initExpress
(
data
.
flowAdRules
)
// 调用金币视频信息接口
homePresenter
.
getHomeVedioMsg
()
...
...
@@ -258,6 +260,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
override
fun
getHomeVedioMsgSuc
(
data
:
MainVideoMsgBean
)
{
if
(
activity
==
null
||
requireActivity
().
isFinishing
)
{
return
...
...
@@ -601,6 +605,10 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
}
/**
* 手机号登录未绑定微信 弹出界面不能关闭
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
2abf2287
...
...
@@ -18,6 +18,7 @@ import com.fly.scenemodule.SceneUtil
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.banner.BannerManager
import
com.mints.goodmoney.ad.express.PreLoadExpressManager
import
com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import
com.mints.goodmoney.ad.video.VideoAdingManager
...
...
@@ -258,6 +259,7 @@ class MyFragment : BaseFragment(),
// 更新权重
initAdWeight
(
data
)
initExpress
(
data
.
flowAdRules
)
AppConfig
.
app_black_name
=
data
.
userRiskApps
.
userRiskAppName
AppConfig
.
app_black_pkg
=
data
.
userRiskApps
.
userRiskAppPkg
AppConfig
.
flVideoFlag
=
data
.
vedioRules
.
isFlVideoFlag
...
...
@@ -1154,6 +1156,10 @@ class MyFragment : BaseFragment(),
)
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
}
/**
* 跳转QQ群弹框
*/
...
...
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