Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold
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_highgold
Commits
45d235f3
Commit
45d235f3
authored
Jul 23, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.1.9发版
parent
d343b3fa
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
17 deletions
+129
-17
build.gradle
highgold/app/build.gradle
+2
-2
InsertScreenAdManager.java
...com/mints/highgold/ad/inscreen/InsertScreenAdManager.java
+96
-15
AppConfig.java
...pp/src/main/java/com/mints/highgold/common/AppConfig.java
+4
-0
Constant.java
...app/src/main/java/com/mints/highgold/common/Constant.java
+5
-0
UserTaskMsgBean.java
...in/java/com/mints/highgold/mvp/model/UserTaskMsgBean.java
+17
-0
MainFragment.java
...ain/java/com/mints/highgold/ui/fragment/MainFragment.java
+5
-0
No files found.
highgold/app/build.gradle
View file @
45d235f3
...
@@ -11,8 +11,8 @@ android {
...
@@ -11,8 +11,8 @@ android {
applicationId
"com.mints.highgold"
applicationId
"com.mints.highgold"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
19
versionCode
20
versionName
"1.1.
8
"
versionName
"1.1.
9
"
flavorDimensions
"default"
flavorDimensions
"default"
// dex突破65535的限制
// dex突破65535的限制
...
...
highgold/app/src/main/java/com/mints/highgold/ad/inscreen/InsertScreenAdManager.java
View file @
45d235f3
package
com
.
mints
.
highgold
.
ad
.
inscreen
;
package
com
.
mints
.
highgold
.
ad
.
inscreen
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.os.Build
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.View
;
import
com.bytedance.sdk.openadsdk.AdSlot
;
import
com.bytedance.sdk.openadsdk.AdSlot
;
...
@@ -8,23 +10,33 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
...
@@ -8,23 +10,33 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
;
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
;
import
com.lechuan.midunovel.view.FoxListener
;
import
com.lechuan.midunovel.view.FoxListener
;
import
com.lechuan.midunovel.view.FoxTbScreen
;
import
com.lechuan.midunovel.view.FoxTbScreen
;
import
com.mints.highgold.ad.VedioAdingManager
;
import
com.mints.highgold.common.AppConfig
;
import
com.mints.highgold.common.AppConfig
;
import
com.mints.highgold.common.Constant
;
import
com.mints.highgold.common.Constant
;
import
com.mints.highgold.manager.TTAdManagerHolder
;
import
com.mints.highgold.manager.TTAdManagerHolder
;
import
com.mints.highgold.manager.TaAdManager
;
import
com.mints.highgold.manager.TaAdManager
;
import
com.mints.highgold.manager.UserManager
;
import
com.mints.highgold.manager.UserManager
;
import
com.mints.highgold.manager.YlhAdManager
;
import
com.mints.highgold.manager.YlhAdManager
;
import
com.mints.highgold.mvp.model.WeightBean
;
import
com.mints.highgold.utils.LogUtil
;
import
com.mints.highgold.utils.ToastUtil
;
import
com.qq.e.ads.interstitial2.UnifiedInterstitialAD
;
import
com.qq.e.ads.interstitial2.UnifiedInterstitialAD
;
import
com.qq.e.ads.interstitial2.UnifiedInterstitialADListener
;
import
com.qq.e.ads.interstitial2.UnifiedInterstitialADListener
;
import
com.qq.e.comm.util.AdError
;
import
com.qq.e.comm.util.AdError
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Random
;
/**
/**
* 插屏广告
* 插屏广告
*/
*/
public
class
InsertScreenAdManager
{
public
class
InsertScreenAdManager
{
private
static
final
String
TAG
=
VedioAdingManager
.
class
.
getSimpleName
();
private
Activity
activity
;
private
Activity
activity
;
private
ArrayList
<
WeightBean
>
weightList
;
// 穿山甲
// 穿山甲
private
TTAdNative
mTTAdNative
;
private
TTAdNative
mTTAdNative
;
...
@@ -43,6 +55,7 @@ public class InsertScreenAdManager {
...
@@ -43,6 +55,7 @@ public class InsertScreenAdManager {
public
void
showInsertScreenAd
(
String
carrierType
)
{
public
void
showInsertScreenAd
(
String
carrierType
)
{
if
(
UserManager
.
getInstance
().
getAdShowFlag
())
{
if
(
UserManager
.
getInstance
().
getAdShowFlag
())
{
if
(!
AppConfig
.
interactionAdFlag
)
{
if
(!
AppConfig
.
interactionAdFlag
)
{
weightList
=
new
ArrayList
<>();
AppConfig
.
interactionAdFlag
=
true
;
AppConfig
.
interactionAdFlag
=
true
;
initInsertScreenAd
(
carrierType
);
initInsertScreenAd
(
carrierType
);
}
}
...
@@ -59,6 +72,9 @@ public class InsertScreenAdManager {
...
@@ -59,6 +72,9 @@ public class InsertScreenAdManager {
if
(
mTMItAd
!=
null
)
{
if
(
mTMItAd
!=
null
)
{
mTMItAd
.
destroy
();
mTMItAd
.
destroy
();
}
}
if
(
weightList
!=
null
)
{
weightList
=
null
;
}
}
}
/**
/**
...
@@ -67,17 +83,33 @@ public class InsertScreenAdManager {
...
@@ -67,17 +83,33 @@ public class InsertScreenAdManager {
* @param carrierType
* @param carrierType
*/
*/
private
void
initInsertScreenAd
(
String
carrierType
)
{
private
void
initInsertScreenAd
(
String
carrierType
)
{
if
(
AppConfig
.
interactionAdType
==
0
)
{
String
adType
=
getRandomWeight
();
if
(
TextUtils
.
isEmpty
(
adType
))
{
//推啊
loadTaInteractionAd
(
carrierType
);
}
else
{
if
(
TextUtils
.
equals
(
adType
,
Constant
.
CSJ_INSERTSCREEN_AD
))
{
//穿山甲
//穿山甲
loadCsjInteractionAd
(
carrierType
);
loadCsjInteractionAd
(
carrierType
);
}
else
if
(
AppConfig
.
interactionAdType
==
1
)
{
}
else
if
(
TextUtils
.
equals
(
adType
,
Constant
.
YLH_INSERTSCREEN_AD
)
)
{
//优量汇
//优量汇
loadYlhInteractionAd
(
carrierType
);
loadYlhInteractionAd
(
carrierType
);
}
else
if
(
AppConfig
.
interactionAdType
==
2
)
{
}
else
{
//推啊
//推啊
loadTaInteractionAd
(
carrierType
);
loadTaInteractionAd
(
carrierType
);
}
}
}
// if (AppConfig.interactionAdType == 0) {
// //穿山甲
// loadCsjInteractionAd(carrierType);
// } else if (AppConfig.interactionAdType == 1) {
// //优量汇
// loadYlhInteractionAd(carrierType);
// } else if (AppConfig.interactionAdType == 2) {
// //推啊
// loadTaInteractionAd(carrierType);
// }
}
}
/**
/**
...
@@ -121,7 +153,7 @@ public class InsertScreenAdManager {
...
@@ -121,7 +153,7 @@ public class InsertScreenAdManager {
@Override
@Override
public
void
onError
(
int
code
,
String
message
)
{
public
void
onError
(
int
code
,
String
message
)
{
//当前播放完成换下一个类型 1-优量汇
//当前播放完成换下一个类型 1-优量汇
AppConfig
.
interactionAdType
=
1
;
//
AppConfig.interactionAdType = 1;
setNextShowInteractionAd
();
setNextShowInteractionAd
();
}
}
...
@@ -152,7 +184,7 @@ public class InsertScreenAdManager {
...
@@ -152,7 +184,7 @@ public class InsertScreenAdManager {
@Override
@Override
public
void
onAdShow
(
View
view
,
int
type
)
{
public
void
onAdShow
(
View
view
,
int
type
)
{
//当前播放完成换下一个类型 1-优量汇
//当前播放完成换下一个类型 1-优量汇
AppConfig
.
interactionAdType
=
1
;
//
AppConfig.interactionAdType = 1;
}
}
...
@@ -160,7 +192,7 @@ public class InsertScreenAdManager {
...
@@ -160,7 +192,7 @@ public class InsertScreenAdManager {
@Override
@Override
public
void
onRenderFail
(
View
view
,
String
msg
,
int
code
)
{
public
void
onRenderFail
(
View
view
,
String
msg
,
int
code
)
{
//当前播放完成换下一个类型 1-优量汇
//当前播放完成换下一个类型 1-优量汇
AppConfig
.
interactionAdType
=
1
;
//
AppConfig.interactionAdType = 1;
setNextShowInteractionAd
();
setNextShowInteractionAd
();
}
}
...
@@ -214,7 +246,7 @@ public class InsertScreenAdManager {
...
@@ -214,7 +246,7 @@ public class InsertScreenAdManager {
@Override
@Override
public
void
onADReceive
()
{
public
void
onADReceive
()
{
//当前优量汇播放完成换下一个类型
//当前优量汇播放完成换下一个类型
AppConfig
.
interactionAdType
=
2
;
//
AppConfig.interactionAdType = 2;
showAD
();
showAD
();
}
}
...
@@ -224,7 +256,7 @@ public class InsertScreenAdManager {
...
@@ -224,7 +256,7 @@ public class InsertScreenAdManager {
@Override
@Override
public
void
onNoAD
(
AdError
adError
)
{
public
void
onNoAD
(
AdError
adError
)
{
AppConfig
.
interactionAdType
=
2
;
//
AppConfig.interactionAdType = 2;
setNextShowInteractionAd
();
setNextShowInteractionAd
();
}
}
...
@@ -296,19 +328,19 @@ public class InsertScreenAdManager {
...
@@ -296,19 +328,19 @@ public class InsertScreenAdManager {
mTMItAd
.
setAdListener
(
new
FoxListener
()
{
mTMItAd
.
setAdListener
(
new
FoxListener
()
{
@Override
@Override
public
void
onReceiveAd
()
{
public
void
onReceiveAd
()
{
AppConfig
.
interactionAdType
=
0
;
//
AppConfig.interactionAdType = 0;
}
}
@Override
@Override
public
void
onFailedToReceiveAd
()
{
public
void
onFailedToReceiveAd
()
{
setNextShowInteractionAd
();
setNextShowInteractionAd
();
AppConfig
.
interactionAdType
=
0
;
//
AppConfig.interactionAdType = 0;
}
}
@Override
@Override
public
void
onLoadFailed
()
{
public
void
onLoadFailed
()
{
setNextShowInteractionAd
();
setNextShowInteractionAd
();
AppConfig
.
interactionAdType
=
0
;
//
AppConfig.interactionAdType = 0;
}
}
@Override
@Override
...
@@ -341,4 +373,53 @@ public class InsertScreenAdManager {
...
@@ -341,4 +373,53 @@ public class InsertScreenAdManager {
public
void
setNextShowInteractionAd
()
{
public
void
setNextShowInteractionAd
()
{
AppConfig
.
interactionAdFlag
=
false
;
AppConfig
.
interactionAdFlag
=
false
;
}
}
/**
* 根据权重获取广告类型
*
* @return
*/
private
String
getRandomWeight
()
{
if
(
weightList
!=
null
)
{
weightList
.
clear
();
}
int
weight
=
0
;
if
(
AppConfig
.
interactionTuiaWeight
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
interactionTuiaWeight
,
Constant
.
TUIA_INSERTSCREEN_AD
));
weight
=
weight
+
AppConfig
.
interactionTuiaWeight
;
LogUtil
.
d
(
TAG
,
"权重值:interactionTuiaWeight:"
+
AppConfig
.
interactionTuiaWeight
);
}
if
(
AppConfig
.
interactionCsjWeight
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
interactionCsjWeight
,
Constant
.
CSJ_INSERTSCREEN_AD
));
weight
=
weight
+
AppConfig
.
interactionCsjWeight
;
LogUtil
.
d
(
TAG
,
"权重值:interactionCsjWeight:"
+
AppConfig
.
interactionCsjWeight
);
}
if
(
AppConfig
.
interactionYlhWeight
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
interactionYlhWeight
,
Constant
.
YLH_INSERTSCREEN_AD
));
weight
=
weight
+
AppConfig
.
interactionYlhWeight
;
LogUtil
.
d
(
TAG
,
"权重值:interactionYlhWeight:"
+
AppConfig
.
interactionYlhWeight
);
}
// 权重随机
if
(
weightList
!=
null
&&
weightList
.
size
()
>
0
&&
weight
>
0
)
{
LogUtil
.
d
(
TAG
,
"1、权重总值:"
+
weight
);
Random
r
=
new
Random
();
int
randomWeight
=
r
.
nextInt
(
weight
)
+
1
;
LogUtil
.
d
(
TAG
,
"2、权重随机值:"
+
randomWeight
);
// ToastUtil.showLong(activity,"插屏权重随机值:" + randomWeight);
for
(
WeightBean
weightBean
:
weightList
)
{
randomWeight
-=
weightBean
.
getWeight
();
if
(
randomWeight
<=
0
)
{
LogUtil
.
d
(
TAG
,
"3、权重结果:"
+
weightBean
.
getType
());
return
weightBean
.
getType
();
}
}
}
return
""
;
}
}
}
highgold/app/src/main/java/com/mints/highgold/common/AppConfig.java
View file @
45d235f3
...
@@ -93,4 +93,8 @@ public class AppConfig {
...
@@ -93,4 +93,8 @@ public class AppConfig {
* MintegralInscreen true-加载成功
* MintegralInscreen true-加载成功
*/
*/
public
static
boolean
isMintegralInscreenFlag
=
false
;
public
static
boolean
isMintegralInscreenFlag
=
false
;
public
static
int
interactionTuiaWeight
=
0
;
public
static
int
interactionCsjWeight
=
0
;
public
static
int
interactionYlhWeight
=
0
;
}
}
highgold/app/src/main/java/com/mints/highgold/common/Constant.java
View file @
45d235f3
...
@@ -129,6 +129,11 @@ public interface Constant {
...
@@ -129,6 +129,11 @@ public interface Constant {
String
DUOMENT_VEDIO_AD
=
"DUOMENT_VEDIO_AD"
;
String
DUOMENT_VEDIO_AD
=
"DUOMENT_VEDIO_AD"
;
String
SDHZ_VEDIO_AD
=
"SDHZ_VEDIO_AD"
;
String
SDHZ_VEDIO_AD
=
"SDHZ_VEDIO_AD"
;
// 插屏广告
String
CSJ_INSERTSCREEN_AD
=
"CSJ_INSERTSCREEN_AD"
;
String
YLH_INSERTSCREEN_AD
=
"YLH_INSERTSCREEN_AD"
;
String
TUIA_INSERTSCREEN_AD
=
"TUIA_INSERTSCREEN_AD"
;
// 载体
// 载体
String
CARRIER_DRINK
=
"DRINK"
;
//喝水
String
CARRIER_DRINK
=
"DRINK"
;
//喝水
String
CARRIER_DRINK_PATCH
=
"DRINK_PATCH"
;
//喝水补卡
String
CARRIER_DRINK_PATCH
=
"DRINK_PATCH"
;
//喝水补卡
...
...
highgold/app/src/main/java/com/mints/highgold/mvp/model/UserTaskMsgBean.java
View file @
45d235f3
...
@@ -90,6 +90,11 @@ public class UserTaskMsgBean implements Serializable {
...
@@ -90,6 +90,11 @@ public class UserTaskMsgBean implements Serializable {
private
int
JPushLogin
;
private
int
JPushLogin
;
private
int
interactionplan_tuia_rate
;
private
int
interactionplan_csj_rate
;
private
int
interactionplan_ylh_rate
;
public
int
getVedioplan_hytech_vedio_rate
()
{
public
int
getVedioplan_hytech_vedio_rate
()
{
return
vedioplan_hytech_vedio_rate
;
return
vedioplan_hytech_vedio_rate
;
}
}
...
@@ -474,4 +479,16 @@ public class UserTaskMsgBean implements Serializable {
...
@@ -474,4 +479,16 @@ public class UserTaskMsgBean implements Serializable {
public
void
setVedioplan_sdhz_vedio_surplus
(
int
vedioplan_sdhz_vedio_surplus
)
{
public
void
setVedioplan_sdhz_vedio_surplus
(
int
vedioplan_sdhz_vedio_surplus
)
{
this
.
vedioplan_sdhz_vedio_surplus
=
vedioplan_sdhz_vedio_surplus
;
this
.
vedioplan_sdhz_vedio_surplus
=
vedioplan_sdhz_vedio_surplus
;
}
}
public
int
getInteractionTuiaWeight
()
{
return
interactionplan_tuia_rate
;
}
public
int
getInteractionCsjWeight
()
{
return
interactionplan_csj_rate
;
}
public
int
getInteractionYlhWeight
()
{
return
interactionplan_ylh_rate
;
}
}
}
highgold/app/src/main/java/com/mints/highgold/ui/fragment/MainFragment.java
View file @
45d235f3
...
@@ -480,6 +480,11 @@ public class MainFragment extends BaseFragment
...
@@ -480,6 +480,11 @@ public class MainFragment extends BaseFragment
spUtil
.
putString
(
Constant
.
CSJ_VEDIO_APPIP
,
data
.
getAppIp
());
spUtil
.
putString
(
Constant
.
CSJ_VEDIO_APPIP
,
data
.
getAppIp
());
spUtil
.
putInt
(
Constant
.
JIPUSH_FLAG
,
data
.
getJPushLogin
());
spUtil
.
putInt
(
Constant
.
JIPUSH_FLAG
,
data
.
getJPushLogin
());
AppConfig
.
interactionCsjWeight
=
data
.
getInteractionCsjWeight
();
AppConfig
.
interactionYlhWeight
=
data
.
getInteractionYlhWeight
();
AppConfig
.
interactionTuiaWeight
=
data
.
getInteractionTuiaWeight
();
LogUtil
.
d
(
TAG
,
"插屏权重值:interactionCsjWeight:"
+
data
.
getInteractionCsjWeight
()
+
" interactionYlhWeight:"
+
data
.
getInteractionYlhWeight
()
+
" interactionTuiaWeight:"
+
data
.
getInteractionTuiaWeight
());
//测试数据
//测试数据
// data.setVedioplan_csj_vedio_rate(0);
// data.setVedioplan_csj_vedio_rate(0);
...
...
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