Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fairyland_pro
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_fairyland_pro
Commits
fbfb6e54
Commit
fbfb6e54
authored
May 24, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b4be1133
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
27 deletions
+34
-27
VideoAdingManager.java
.../java/com/mints/fairyland/ad/video/VideoAdingManager.java
+30
-27
AwardActivity.kt
...in/java/com/mints/fairyland/ui/activitys/AwardActivity.kt
+3
-0
MyFragment.kt
...c/main/java/com/mints/fairyland/ui/fragment/MyFragment.kt
+1
-0
No files found.
app/src/main/java/com/mints/fairyland/ad/video/VideoAdingManager.java
View file @
fbfb6e54
...
@@ -183,7 +183,7 @@ public class VideoAdingManager {
...
@@ -183,7 +183,7 @@ public class VideoAdingManager {
*/
*/
private
String
getNextFailAdType
()
{
private
String
getNextFailAdType
()
{
// 高额任务时 会为空
// 高额任务时 会为空
if
(
adList
==
null
||
currentRandomAdList
==
null
)
{
if
(
isHighWeight
||
adList
==
null
||
currentRandomAdList
==
null
)
{
return
getHighWeight
();
return
getHighWeight
();
}
}
...
@@ -298,7 +298,7 @@ public class VideoAdingManager {
...
@@ -298,7 +298,7 @@ public class VideoAdingManager {
weightList
.
clear
();
weightList
.
clear
();
}
}
int
weight
=
0
;
int
weight
=
0
;
//
若没有视频完成数,不加入权重计算范围内
//
穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
if
(
AppConfig
.
csjVideoAdCount
>
0
)
{
if
(
AppConfig
.
csjVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
csjVideoWeight
,
Constant
.
CSJ_VEDIO_AD
));
weightList
.
add
(
new
WeightBean
(
csjVideoWeight
,
Constant
.
CSJ_VEDIO_AD
));
weight
=
weight
+
csjVideoWeight
;
weight
=
weight
+
csjVideoWeight
;
...
@@ -311,35 +311,35 @@ public class VideoAdingManager {
...
@@ -311,35 +311,35 @@ public class VideoAdingManager {
LogUtil
.
d
(
TAG
,
"权重值:ylhWeight:"
+
ylhWeight
);
LogUtil
.
d
(
TAG
,
"权重值:ylhWeight:"
+
ylhWeight
);
adList
.
add
(
"b"
);
adList
.
add
(
"b"
);
}
}
if
(
AppConfig
.
csjFullVedi
oAdCount
>
0
)
{
if
(
AppConfig
.
ksVide
oAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
csjFullVideoWeight
,
Constant
.
CSJ_FULL
_AD
));
weightList
.
add
(
new
WeightBean
(
ksVideoWeight
,
Constant
.
KS_VEDIO
_AD
));
weight
=
weight
+
csjFull
VideoWeight
;
weight
=
weight
+
ks
VideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:
csjFullVideoWeight:"
+
csjFull
VideoWeight
);
LogUtil
.
d
(
TAG
,
"权重值:
ksWeight:"
+
ks
VideoWeight
);
adList
.
add
(
"c"
);
adList
.
add
(
"c"
);
}
}
if
(
AppConfig
.
wnVideoAdCount
>
0
)
{
if
(
AppConfig
.
wnVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
wnWeight
,
Constant
.
SDHZ_VEDIO_AD
));
weightList
.
add
(
new
WeightBean
(
wnWeight
,
Constant
.
SDHZ_VEDIO_AD
));
weight
=
weight
+
wnWeight
;
weight
=
weight
+
wnWeight
;
LogUtil
.
d
(
TAG
,
"权重值:sdhzWeight:"
+
wnWeight
);
LogUtil
.
d
(
TAG
,
"权重值:sdhzWeight:"
+
wnWeight
);
adList
.
add
(
"d"
);
adList
.
add
(
"e"
);
}
if
(
AppConfig
.
csjFullVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
csjFullVideoWeight
,
Constant
.
CSJ_FULL_AD
));
weight
=
weight
+
csjFullVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:csjFullVideoWeight:"
+
csjFullVideoWeight
);
adList
.
add
(
"f"
);
}
}
if
(
AppConfig
.
shVideoAdCount
>
0
)
{
if
(
AppConfig
.
shVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
shVideoWeight
,
Constant
.
SH_VEDIO_AD
));
weightList
.
add
(
new
WeightBean
(
shVideoWeight
,
Constant
.
SH_VEDIO_AD
));
weight
=
weight
+
shVideoWeight
;
weight
=
weight
+
shVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:shWeight:"
+
shVideoWeight
);
LogUtil
.
d
(
TAG
,
"权重值:shWeight:"
+
shVideoWeight
);
adList
.
add
(
"e"
);
adList
.
add
(
"g"
);
}
if
(
AppConfig
.
ksVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
ksVideoWeight
,
Constant
.
KS_VEDIO_AD
));
weight
=
weight
+
ksVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:ksWeight:"
+
ksVideoWeight
);
adList
.
add
(
"f"
);
}
}
if
(
AppConfig
.
flVideoAdCount
>
0
)
{
if
(
AppConfig
.
flVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
flVideoWeight
,
Constant
.
FL_VEDIO_AD
));
weightList
.
add
(
new
WeightBean
(
flVideoWeight
,
Constant
.
FL_VEDIO_AD
));
weight
=
weight
+
flVideoWeight
;
weight
=
weight
+
flVideoWeight
;
LogUtil
.
d
(
TAG
,
"权重值:flVideoWeight:"
+
flVideoWeight
);
LogUtil
.
d
(
TAG
,
"权重值:flVideoWeight:"
+
flVideoWeight
);
adList
.
add
(
"
g
"
);
adList
.
add
(
"
h
"
);
}
}
// 权重随机
// 权重随机
...
@@ -745,7 +745,8 @@ public class VideoAdingManager {
...
@@ -745,7 +745,8 @@ public class VideoAdingManager {
}
}
private
String
getCode
(
String
adtype
)
{
private
String
getCode
(
String
adtype
)
{
String
code
=
"g"
;
// 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
String
code
=
"h"
;
switch
(
adtype
)
{
switch
(
adtype
)
{
case
Constant
.
CSJ_VEDIO_AD
:
case
Constant
.
CSJ_VEDIO_AD
:
code
=
"a"
;
code
=
"a"
;
...
@@ -753,23 +754,25 @@ public class VideoAdingManager {
...
@@ -753,23 +754,25 @@ public class VideoAdingManager {
case
Constant
.
YLH_VEDIO_AD
:
case
Constant
.
YLH_VEDIO_AD
:
code
=
"b"
;
code
=
"b"
;
break
;
break
;
case
Constant
.
CSJ_FULL
_AD
:
case
Constant
.
KS_VEDIO
_AD
:
code
=
"c"
;
code
=
"c"
;
break
;
break
;
case
Constant
.
SDHZ_VEDIO_AD
:
case
Constant
.
SDHZ_VEDIO_AD
:
code
=
"d"
;
break
;
case
Constant
.
SH_VEDIO_AD
:
code
=
"e"
;
code
=
"e"
;
break
;
break
;
case
Constant
.
KS_VEDIO
_AD
:
case
Constant
.
CSJ_FULL
_AD
:
code
=
"f"
;
code
=
"f"
;
break
;
break
;
case
Constant
.
SH_VEDIO_AD
:
code
=
"g"
;
break
;
}
}
return
code
;
return
code
;
}
}
private
String
getAdtype
(
String
code
)
{
private
String
getAdtype
(
String
code
)
{
//// 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
String
adtype
=
Constant
.
FL_VEDIO_AD
;
String
adtype
=
Constant
.
FL_VEDIO_AD
;
switch
(
code
)
{
switch
(
code
)
{
case
"a"
:
case
"a"
:
...
@@ -779,16 +782,16 @@ public class VideoAdingManager {
...
@@ -779,16 +782,16 @@ public class VideoAdingManager {
adtype
=
Constant
.
YLH_VEDIO_AD
;
adtype
=
Constant
.
YLH_VEDIO_AD
;
break
;
break
;
case
"c"
:
case
"c"
:
adtype
=
Constant
.
CSJ_FULL_AD
;
adtype
=
Constant
.
KS_VEDIO_AD
;
break
;
case
"d"
:
adtype
=
Constant
.
SDHZ_VEDIO_AD
;
break
;
break
;
case
"e"
:
case
"e"
:
adtype
=
Constant
.
S
H
_VEDIO_AD
;
adtype
=
Constant
.
S
DHZ
_VEDIO_AD
;
break
;
break
;
case
"f"
:
case
"f"
:
adtype
=
Constant
.
KS_VEDIO_AD
;
adtype
=
Constant
.
CSJ_FULL_AD
;
break
;
case
"g"
:
adtype
=
Constant
.
SH_VEDIO_AD
;
break
;
break
;
}
}
return
adtype
;
return
adtype
;
...
...
app/src/main/java/com/mints/fairyland/ui/activitys/AwardActivity.kt
View file @
fbfb6e54
...
@@ -466,6 +466,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -466,6 +466,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
readyGoThenKill
(
DrawcashActivity
::
class
.
java
)
readyGoThenKill
(
DrawcashActivity
::
class
.
java
)
}
}
4
->
{
showToast
(
"视频加载异常,请稍后重试~"
)
}
}
}
}
}
R
.
id
.
tvAwardNext
->
{
R
.
id
.
tvAwardNext
->
{
...
...
app/src/main/java/com/mints/fairyland/ui/fragment/MyFragment.kt
View file @
fbfb6e54
...
@@ -1113,6 +1113,7 @@ class MyFragment : BaseFragment(),
...
@@ -1113,6 +1113,7 @@ class MyFragment : BaseFragment(),
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
)
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
)
{
// 高额任务
// 高额任务
if
(
TextUtils
.
equals
(
carrierType
,
Constant
.
CARRIER_HIGH_ACTIVITY
))
{
if
(
TextUtils
.
equals
(
carrierType
,
Constant
.
CARRIER_HIGH_ACTIVITY
))
{
onDestroyBroadcastReceiver
()
return
return
}
}
...
...
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