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
a59bdf71
Commit
a59bdf71
authored
Jun 02, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加domob vedio
parent
a57db8f6
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
358 additions
and
70 deletions
+358
-70
build.gradle
highgold/app/build.gradle
+4
-0
domob_rvads_1.0.0.aar
highgold/app/libs/domob_rvads_1.0.0.aar
+0
-0
AndroidManifest.xml
highgold/app/src/main/AndroidManifest.xml
+5
-0
DomobVedioAdManager.kt
...rc/main/java/com/mints/highgold/ad/DomobVedioAdManager.kt
+162
-2
VedioAdingManager.java
...rc/main/java/com/mints/highgold/ad/VedioAdingManager.java
+71
-29
AppConfig.java
...pp/src/main/java/com/mints/highgold/common/AppConfig.java
+0
-10
Constant.java
...app/src/main/java/com/mints/highgold/common/Constant.java
+1
-1
DomobManager.kt
.../src/main/java/com/mints/highgold/manager/DomobManager.kt
+13
-0
UserTaskMsgBean.java
...in/java/com/mints/highgold/mvp/model/UserTaskMsgBean.java
+18
-0
DomobVedioAdPresenter.kt
...om/mints/highgold/mvp/presenters/DomobVedioAdPresenter.kt
+39
-0
DomobVedioAdView.kt
...ain/java/com/mints/highgold/mvp/views/DomobVedioAdView.kt
+4
-0
AwardActivity.java
...n/java/com/mints/highgold/ui/activitys/AwardActivity.java
+0
-6
MainFragment.java
...ain/java/com/mints/highgold/ui/fragment/MainFragment.java
+34
-21
VersusFragment.java
...n/java/com/mints/highgold/ui/fragment/VersusFragment.java
+4
-1
build.gradle
highgold/build.gradle
+3
-0
No files found.
highgold/app/build.gradle
View file @
a59bdf71
...
...
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
//apply plugin: 'com.tendcloud.codelessplugin'
apply
plugin:
'com.google.protobuf'
android
{
compileSdkVersion
rootProject
.
ext
.
androidCompileSdkVersion
...
...
@@ -299,6 +300,9 @@ dependencies {
implementation
(
name:
'shanhuAD-1.0.14'
,
ext:
'aar'
)
// 创神广告
implementation
(
name:
'ad_support_library_v2.1.4'
,
ext:
'aar'
)
// 多盟
implementation
(
name:
'domob_rvads_1.0.0'
,
ext:
'aar'
)
implementation
'com.google.protobuf:protobuf-lite:3.0.0'
testImplementation
'junit:junit:4.12'
...
...
highgold/app/libs/domob_rvads_1.0.0.aar
0 → 100644
View file @
a59bdf71
File added
highgold/app/src/main/AndroidManifest.xml
View file @
a59bdf71
...
...
@@ -176,6 +176,11 @@
<data
android:scheme=
"tencent1109991028"
/>
</intent-filter>
</activity>
<!-- 多盟 -->
<activity
android:name=
"com.dm.rvads.activity.DMPortraitADActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".wxapi.WXEntryActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
...
...
highgold/app/src/main/java/com/mints/highgold/ad/DomobVedioAdManager.kt
View file @
a59bdf71
package
com.mints.highgold.ad
import
android.app.Activity
import
com.dm.rvads.common.util.AdError
import
com.dm.rvads.rewardvideo.RewardVideoADListener
import
com.dm.rvads.rewardvideo.RewardVideoAd
import
com.mints.highgold.MintsApplication
import
com.mints.highgold.mvp.views.ShanhuVedioAdManagerView
import
com.mints.highgold.common.Constant
import
com.mints.highgold.manager.DomobManager
import
com.mints.highgold.mvp.presenters.DomobVedioAdPresenter
import
com.mints.highgold.mvp.views.DomobVedioAdView
import
com.mints.highgold.utils.LogUtil
import
java.util.*
/**
* 多盟视频
*/
class
DomobVedioAdManager
private
constructor
(
activity
:
Activity
)
:
ShanhuVedioAdManagerView
{
class
DomobVedioAdManager
private
constructor
(
activity
:
Activity
)
:
DomobVedioAdView
,
RewardVideoADListener
{
private
val
TAG
=
DomobVedioAdManager
::
class
.
java
.
simpleName
lateinit
var
rewardVideoAd
:
RewardVideoAd
lateinit
var
domobVedioAdPresenter
:
DomobVedioAdPresenter
private
var
domobVedioAdListener
:
DomobVedioAdListener
?
=
null
var
activity
:
Activity
?
=
null
...
...
@@ -19,6 +31,8 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
private
var
downloadCoin
=
10
private
var
carrierType
=
""
private
var
isClickScreen
:
Boolean
=
true
companion
object
{
private
var
_inst
:
DomobVedioAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
DomobVedioAdManager
?
{
...
...
@@ -37,14 +51,85 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
domobVedioAdPresenter
=
DomobVedioAdPresenter
()
domobVedioAdPresenter
.
attachView
(
this
)
}
fun
loadDomobAd
(
downloadCoin
:
Int
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
if
(
activity
==
null
)
{
return
}
isClickScreen
=
true
this
.
downloadCoin
=
downloadCoin
this
.
carrierType
=
carrierType
this
.
curCoin
=
curCoin
this
.
extraId
=
extraId
var
postId
:
String
when
(
carrierType
)
{
Constant
.
CARRIER_DAILY_VIDEO
->
postId
=
DomobManager
.
DOMOB_AD_VEDIO_MAIN_LOOK
Constant
.
CARRIER_VERSUS_VIDEO
->
postId
=
DomobManager
.
DOMOB_AD_VEDIO_VERSUS_LOOK
Constant
.
CARRIER_ONLINE_INCOME_DOUBLE
,
Constant
.
CARRIER_HOMEWATER_BUBBLE
->
postId
=
DomobManager
.
DOMOB_AD_VEDIO_MAIN_POP
Constant
.
CARRIER_REDENVELOPE_DOUBLE
,
Constant
.
CARRIER_REDENVELOPE
->
postId
=
DomobManager
.
DOMOB_AD_VEDIO_REDBOX
else
->
postId
=
DomobManager
.
DOMOB_AD_VEDIO_MAIN_LOOK
}
rewardVideoAd
=
RewardVideoAd
(
activity
,
DomobManager
.
DOMOB_AD_APPID
,
postId
,
this
)
rewardVideoAd
.
loadAD
()
}
override
fun
onADClick
()
{
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_TWO, "", "")
//
// if (isClickScreen) {
// // 防止重复
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_FOUR, "", "")
// isClickScreen = false
// }
if
(
domobVedioAdListener
!=
null
)
{
domobVedioAdListener
?.
domobVedioAdDownload
()
}
}
override
fun
onVideoCached
()
{
rewardVideoAd
.
showAd
()
LogUtil
.
d
(
TAG
,
"onVideoCached"
)
}
override
fun
onReward
()
{
LogUtil
.
d
(
TAG
,
"onReward"
)
}
override
fun
onADClose
()
{
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_THREE, "", "")
if
(
domobVedioAdListener
!=
null
)
{
domobVedioAdListener
?.
domobVedioAdSuccess
()
}
// domobVedioAdPresenter?.reportAddCoinMsg(activity, getAdMapVO())
LogUtil
.
d
(
TAG
,
"onADClose"
)
}
override
fun
onVideoComplete
()
{
LogUtil
.
d
(
TAG
,
"onVideoComplete"
)
}
override
fun
onError
(
error
:
AdError
?)
{
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CHUANGSHEN, Constant.EVENT_TYPE_ONE, (error?.errorCode).toString(), error?.errorMsg)
if
(
domobVedioAdListener
!=
null
)
{
domobVedioAdListener
?.
domobVedioAdFail
()
}
LogUtil
.
d
(
TAG
,
"onError code:${error?.errorCode} msg:${error?.errorMsg}"
)
}
override
fun
onADShow
()
{
LogUtil
.
d
(
TAG
,
"onADShow"
)
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_ZERO, "", "")
}
fun
setDomobVedioAdListener
(
domobVedioAdListener
:
DomobVedioAdListener
?)
{
...
...
@@ -70,4 +155,79 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
}
override
fun
getBaseApplication
()
=
activity
?.
application
as
MintsApplication
private
fun
getAdMapVO
():
HashMap
<
String
,
Any
>
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"adtype"
]
=
Constant
.
ADTYPE_VEDIO
vo
[
"adsource"
]
=
Constant
.
AD_SOURCE_DOMOB
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_DAILY_DOWNLOAD
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_DAILY_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_HOMEWATER_BUBBLE
->
vo
[
"waterCoin"
]
=
curCoin
Constant
.
CARRIER_ONLINE_INCOME_DOUBLE
->
vo
[
"online_income"
]
=
curCoin
Constant
.
CARRIER_OFFLINE_DOUBLE
->
{
vo
[
"offline_income"
]
=
curCoin
vo
[
"page"
]
=
Constant
.
PAGE_TWO
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_ONE
}
Constant
.
CARRIER_SIGNIN_HOMEPAGE_CARD
->
{
vo
[
"page"
]
=
Constant
.
PAGE_TWO
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_ONE
}
Constant
.
CARRIER_DRINK
,
Constant
.
CARRIER_DRINK_PATCH
->
{
vo
[
"page"
]
=
Constant
.
PAGE_ONE
vo
[
"block"
]
=
Constant
.
BLOCK_FOUR
vo
[
"order"
]
=
Constant
.
ORDER_ONE
vo
[
"critId"
]
=
extraId
!!
}
Constant
.
CARRIER_VERSUS_DRINKTEA
->
{
vo
[
"page"
]
=
Constant
.
PAGE_TWO
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_THREE
vo
[
"critId"
]
=
extraId
!!
}
Constant
.
CARRIER_DAILY_TURN
->
{
vo
[
"page"
]
=
Constant
.
PAGE_ONE
vo
[
"block"
]
=
Constant
.
BLOCK_THREE
vo
[
"order"
]
=
Constant
.
ORDER_THREE
vo
[
"turntableKey"
]
=
extraId
!!
}
Constant
.
CARRIER_CHALLENGE_TURN
->
{
vo
[
"page"
]
=
Constant
.
PAGE_TWO
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_FOUR
vo
[
"turntableKey"
]
=
extraId
!!
}
Constant
.
CARRIER_CHALLENGE_CARD
->
{
vo
[
"page"
]
=
Constant
.
PAGE_TWO
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_FIVE
vo
[
"turntableKey"
]
=
extraId
!!
}
Constant
.
CARRIER_REDENVELOPE_DOUBLE
,
Constant
.
CARRIER_REDENVELOPE
->
{
vo
[
"page"
]
=
Constant
.
PAGE_ONE
vo
[
"block"
]
=
Constant
.
BLOCK_ONE
vo
[
"order"
]
=
Constant
.
ORDER_ONE
vo
[
"numKey"
]
=
extraId
!!
}
else
->
{
vo
[
"page"
]
=
Constant
.
PAGE_ONE
if
(
curCoin
!=
-
1
)
{
vo
[
"online_income"
]
=
curCoin
}
}
}
return
vo
}
fun
destory
()
{
domobVedioAdPresenter
?.
let
{
domobVedioAdPresenter
.
dispose
()
domobVedioAdPresenter
.
detachView
()
}
}
}
\ No newline at end of file
highgold/app/src/main/java/com/mints/highgold/ad/VedioAdingManager.java
View file @
a59bdf71
...
...
@@ -36,6 +36,7 @@ public class VedioAdingManager {
private
HytechVedioAdManager
hytechVedioAdManager
;
private
ShanhuVedioAdManager
shanhuVedioAdManager
;
private
ChuangshenVedioAdManager
chuangshenVedioAdManager
;
private
DomobVedioAdManager
domobVedioAdManager
;
private
int
ylhWeight
;
private
int
csjFullWeight
;
...
...
@@ -44,6 +45,7 @@ public class VedioAdingManager {
private
int
mintegralWeight
;
private
int
shanhuWeight
;
private
int
chuangshenWeight
;
private
int
domobWeight
;
private
ArrayList
<
WeightBean
>
weightList
;
private
Activity
activity
;
...
...
@@ -77,13 +79,15 @@ public class VedioAdingManager {
mintegralVedioAdManager
=
MintegralVedioAdManager
.
getInstance
(
activity
);
shanhuVedioAdManager
=
ShanhuVedioAdManager
.
getInstance
(
activity
);
chuangshenVedioAdManager
=
ChuangshenVedioAdManager
.
Companion
.
getInstance
(
activity
);
domobVedioAdManager
=
DomobVedioAdManager
.
Companion
.
getInstance
(
activity
);
weightList
=
new
ArrayList
<>();
}
/**
* 初始化广告权重
*/
public
void
initAdWeight
(
int
csjVedioWeight
,
int
ylhWeight
,
int
csjFullWeight
,
int
hytechVedioWeight
,
int
mintegralWeight
,
int
shanhuWeight
,
int
chuangshenWeight
)
{
public
void
initAdWeight
(
int
csjVedioWeight
,
int
ylhWeight
,
int
csjFullWeight
,
int
hytechVedioWeight
,
int
mintegralWeight
,
int
shanhuWeight
,
int
chuangshenWeight
,
int
domobWeight
)
{
this
.
csjVedioWeight
=
csjVedioWeight
;
this
.
ylhWeight
=
ylhWeight
;
this
.
csjFullWeight
=
csjFullWeight
;
...
...
@@ -91,6 +95,7 @@ public class VedioAdingManager {
this
.
mintegralWeight
=
mintegralWeight
;
this
.
shanhuWeight
=
shanhuWeight
;
this
.
chuangshenWeight
=
chuangshenWeight
;
this
.
domobWeight
=
domobWeight
;
}
/**
...
...
@@ -115,17 +120,21 @@ public class VedioAdingManager {
/**
* 根据广告优先级获取下一个
* <p>
* 珊瑚>穿山甲激励> 优量汇>多盟>mintegral>东方网>全屏>创神
*/
private
String
getNextAdType
()
{
String
nextAdType
=
""
;
if
(
AppConfig
.
ylh
AdCount
>
0
)
{
nextAdType
=
Constant
.
YLH
_VEDIO_AD
;
if
(
AppConfig
.
shanhu
AdCount
>
0
)
{
nextAdType
=
Constant
.
SHANHU
_VEDIO_AD
;
}
else
if
(
AppConfig
.
csjVedioAdCount
>
0
)
{
nextAdType
=
Constant
.
CSJ_VEDIO_AD
;
}
else
if
(
AppConfig
.
ylhAdCount
>
0
)
{
nextAdType
=
Constant
.
YLH_VEDIO_AD
;
}
else
if
(
AppConfig
.
duomentVedioAdCount
>
0
)
{
nextAdType
=
Constant
.
DUOMENT_VEDIO_AD
;
}
else
if
(
AppConfig
.
mintegralAdCount
>
0
)
{
nextAdType
=
Constant
.
MINTEGRAL_VEDIO_AD
;
}
else
if
(
AppConfig
.
shanhuAdCount
>
0
)
{
nextAdType
=
Constant
.
SHANHU_VEDIO_AD
;
}
else
if
(
AppConfig
.
csjFullAdCount
>
0
)
{
nextAdType
=
Constant
.
CSJ_FULL_AD
;
}
else
if
(
AppConfig
.
chuangshenVedioAdCount
>
0
)
{
...
...
@@ -159,26 +168,32 @@ public class VedioAdingManager {
int
weight
=
0
;
// 若没有视频完成数,不加入权重计算范围内
if
(
AppConfig
.
ylhAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
ylhWeight
,
Constant
.
YLH_VEDIO_AD
));
weight
=
weight
+
ylhWeight
;
LogUtil
.
d
(
TAG
,
"权重值:ylhWeight:"
+
ylhWeight
);
// 珊瑚>穿山甲激励>优量汇>多盟>mintegral>东方网>全屏>创神
if
(
AppConfig
.
shanhuAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
shanhuWeight
,
Constant
.
SHANHU_VEDIO_AD
));
weight
=
weight
+
shanhuWeight
;
LogUtil
.
d
(
TAG
,
"权重值:shanhuWeight:"
+
shanhuWeight
);
}
if
(
AppConfig
.
csjVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
csjVedioWeight
,
Constant
.
CSJ_VEDIO_AD
));
weight
=
weight
+
csjVedioWeight
;
LogUtil
.
d
(
TAG
,
"权重值:csjVedioWeight:"
+
csjVedioWeight
);
}
if
(
AppConfig
.
ylhAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
ylhWeight
,
Constant
.
YLH_VEDIO_AD
));
weight
=
weight
+
ylhWeight
;
LogUtil
.
d
(
TAG
,
"权重值:ylhWeight:"
+
ylhWeight
);
}
if
(
AppConfig
.
duomentVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
domobWeight
,
Constant
.
DUOMENT_VEDIO_AD
));
weight
=
weight
+
domobWeight
;
LogUtil
.
d
(
TAG
,
"权重值:domobWeight:"
+
domobWeight
);
}
if
(
AppConfig
.
mintegralAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
mintegralWeight
,
Constant
.
MINTEGRAL_VEDIO_AD
));
weight
=
weight
+
mintegralWeight
;
LogUtil
.
d
(
TAG
,
"权重值:mintegralWeight:"
+
mintegralWeight
);
}
if
(
AppConfig
.
shanhuAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
shanhuWeight
,
Constant
.
SHANHU_VEDIO_AD
));
weight
=
weight
+
shanhuWeight
;
LogUtil
.
d
(
TAG
,
"权重值:shanhuWeight:"
+
shanhuWeight
);
}
if
(
AppConfig
.
hytechVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
hytechVedioWeight
,
Constant
.
HYTECH_VEDIO_AD
));
weight
=
weight
+
hytechVedioWeight
;
...
...
@@ -194,6 +209,7 @@ public class VedioAdingManager {
weight
=
weight
+
chuangshenWeight
;
LogUtil
.
d
(
TAG
,
"权重值:chuangshenWeight:"
+
chuangshenWeight
);
}
// 权重随机
if
(
weightList
!=
null
&&
weightList
.
size
()
>
0
&&
weight
>
0
)
{
...
...
@@ -237,10 +253,11 @@ public class VedioAdingManager {
int
mintegralAdCount
=
AppConfig
.
mintegralAdCount
;
int
shanhuAdCount
=
AppConfig
.
shanhuAdCount
;
int
chuangshenVedioAdCount
=
AppConfig
.
chuangshenVedioAdCount
;
int
duomentVedioAdCount
=
AppConfig
.
duomentVedioAdCount
;
if
(
csjFullAdCount
<=
0
&&
ylhAdCount
<=
0
&&
csjVedioAdCount
<=
0
&&
hytechVedioAdCount
<=
0
&&
mintegralAdCount
<=
0
&&
shanhuAdCount
<=
0
&&
chuangshenVedioAdCount
<=
0
)
{
chuangshenVedioAdCount
<=
0
&&
duomentVedioAdCount
<=
0
)
{
// showToast("今日视频已看完,请明天再来吧");
return
true
;
}
...
...
@@ -281,6 +298,11 @@ public class VedioAdingManager {
chuangshenVedioAdManager
.
destory
();
chuangshenVedioAdManager
=
null
;
}
if
(
domobVedioAdManager
!=
null
)
{
domobVedioAdManager
.
destory
();
domobVedioAdManager
=
null
;
}
}
public
void
setVedioAdingListener
(
VedioAdingListener
vedioAdingListener
)
{
...
...
@@ -334,8 +356,6 @@ public class VedioAdingManager {
@Override
public
void
ylhVedioAdSuccess
()
{
AppConfig
.
ylhAdCount
--;
AppConfig
.
preAdType
=
Constant
.
YLH_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
YLH_VEDIO_AD
);
}
...
...
@@ -370,8 +390,6 @@ public class VedioAdingManager {
@Override
public
void
csjFullVedioAdSuccess
()
{
AppConfig
.
csjFullAdCount
--;
AppConfig
.
preAdType
=
Constant
.
CSJ_FULL_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
CSJ_FULL_AD
);
}
...
...
@@ -407,8 +425,6 @@ public class VedioAdingManager {
@Override
public
void
csjVedioAdSuccess
()
{
AppConfig
.
csjVedioAdCount
--;
AppConfig
.
preAdType
=
Constant
.
CSJ_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
CSJ_VEDIO_AD
);
}
...
...
@@ -444,8 +460,6 @@ public class VedioAdingManager {
@Override
public
void
hytechVedioAdSuccess
()
{
AppConfig
.
hytechVedioAdCount
--;
AppConfig
.
preAdType
=
Constant
.
HYTECH_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
HYTECH_VEDIO_AD
);
}
...
...
@@ -475,8 +489,6 @@ public class VedioAdingManager {
@Override
public
void
mintegralVedioAdAdSuccess
()
{
AppConfig
.
mintegralAdCount
--;
AppConfig
.
preAdType
=
Constant
.
MINTEGRAL_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
MINTEGRAL_VEDIO_AD
);
}
...
...
@@ -511,8 +523,6 @@ public class VedioAdingManager {
@Override
public
void
shanhuVedioAdAdSuccess
()
{
AppConfig
.
shanhuAdCount
--;
AppConfig
.
preAdType
=
Constant
.
SHANHU_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
SHANHU_VEDIO_AD
);
}
...
...
@@ -540,14 +550,46 @@ public class VedioAdingManager {
@Override
public
void
chuangshenVedioAdSuccess
()
{
AppConfig
.
chuangshenVedioAdCount
--;
AppConfig
.
preAdType
=
Constant
.
CHUANGSHEN_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
CHUANGSHEN_VEDIO_AD
);
}
}
});
chuangshenVedioAdManager
.
loadChuangshenAd
(
bean
.
getDownloadCoin
(),
bean
.
getCurCoin
(),
bean
.
getCarrierType
(),
bean
.
getExtraId
());
}
else
if
(
TextUtils
.
equals
(
vedioAdType
,
Constant
.
DUOMENT_VEDIO_AD
))
{
// 多盟激励视频
if
(
domobVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
DUOMENT_VEDIO_AD
);
}
return
;
}
domobVedioAdManager
=
DomobVedioAdManager
.
Companion
.
getInstance
(
activity
);
}
domobVedioAdManager
.
setDomobVedioAdListener
(
new
DomobVedioAdManager
.
DomobVedioAdListener
()
{
@Override
public
void
domobVedioAdSuccess
()
{
AppConfig
.
duomentVedioAdCount
--;
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
DUOMENT_VEDIO_AD
);
}
}
@Override
public
void
domobVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
DUOMENT_VEDIO_AD
);
}
}
@Override
public
void
domobVedioAdDownload
()
{
isVedioAdDownload
=
true
;
}
});
domobVedioAdManager
.
loadDomobAd
(
bean
.
getDownloadCoin
(),
bean
.
getCurCoin
(),
bean
.
getCarrierType
(),
bean
.
getExtraId
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
highgold/app/src/main/java/com/mints/highgold/common/AppConfig.java
View file @
a59bdf71
...
...
@@ -33,16 +33,6 @@ public class AppConfig {
*/
public
static
boolean
mainWaterviewStatus
=
false
;
/**
* 上一个播放的广告类型
*/
public
static
String
preAdType
=
""
;
/**
* 上一个播放的广告时间
*/
public
static
long
preAdTime
=
0
;
/**
* ylh 剩余广告播放数
*/
...
...
highgold/app/src/main/java/com/mints/highgold/common/Constant.java
View file @
a59bdf71
...
...
@@ -193,7 +193,7 @@ public interface Constant {
String
AD_SOURCE_HYTECH
=
"HYTECH"
;
//东方网
String
AD_SOURCE_SHANHU
=
"CORAL"
;
//珊瑚
String
AD_SOURCE_CHUANGSHEN
=
"CHUANGSHEN"
;
//创神
String
AD_SOURCE_D
UOMENT
=
"DUOMENT
"
;
//多盟
String
AD_SOURCE_D
OMOB
=
"DOMOB
"
;
//多盟
// 页面
int
PAGE_ONE
=
1
;
...
...
highgold/app/src/main/java/com/mints/highgold/manager/DomobManager.kt
0 → 100644
View file @
a59bdf71
package
com.mints.highgold.manager
/**
* 多盟
*/
object
DomobManager
{
const
val
DOMOB_AD_APPID
=
"96AgVZwg0XNR8oOBqU"
const
val
DOMOB_AD_VEDIO_MAIN_LOOK
=
"A0104601332"
//首页看视频
const
val
DOMOB_AD_VEDIO_REDBOX
=
"A0204601331"
//抢红包
const
val
DOMOB_AD_VEDIO_VERSUS_LOOK
=
"A0304601330"
//任务赚看视频
const
val
DOMOB_AD_VEDIO_MAIN_POP
=
"A1104601329"
//汽泡
}
\ No newline at end of file
highgold/app/src/main/java/com/mints/highgold/mvp/model/UserTaskMsgBean.java
View file @
a59bdf71
...
...
@@ -74,6 +74,7 @@ public class UserTaskMsgBean implements Serializable {
private
int
vedioplan_mintegral_vedio_rate
;
private
int
vedioplan_coral_vedio_rate
;
private
int
vedioplan_chuangshen_vedio_rate
;
private
int
vedioplan_domob_vedio_rate
;
private
int
vedioplan_csj_vedio_surplus
;
private
int
vedioplan_liyan_vedio_surplus
;
...
...
@@ -83,6 +84,7 @@ public class UserTaskMsgBean implements Serializable {
private
int
vedioplan_mintegral_vedio_surplus
;
private
int
vedioplan_coral_vedio_surplus
;
private
int
vedioplan_chuangshen_vedio_surplus
;
private
int
vedioplan_domob_vedio_surplus
;
public
int
getVedioplan_hytech_vedio_rate
()
{
return
vedioplan_hytech_vedio_rate
;
...
...
@@ -428,4 +430,20 @@ public class UserTaskMsgBean implements Serializable {
public
void
setVedioplan_chuangshen_vedio_surplus
(
int
vedioplan_chuangshen_vedio_surplus
)
{
this
.
vedioplan_chuangshen_vedio_surplus
=
vedioplan_chuangshen_vedio_surplus
;
}
public
int
getVedioplan_domob_vedio_rate
()
{
return
vedioplan_domob_vedio_rate
;
}
public
void
setVedioplan_domob_vedio_rate
(
int
vedioplan_domob_vedio_rate
)
{
this
.
vedioplan_domob_vedio_rate
=
vedioplan_domob_vedio_rate
;
}
public
int
getVedioplan_domob_vedio_surplus
()
{
return
vedioplan_domob_vedio_surplus
;
}
public
void
setVedioplan_domob_vedio_surplus
(
int
vedioplan_domob_vedio_surplus
)
{
this
.
vedioplan_domob_vedio_surplus
=
vedioplan_domob_vedio_surplus
;
}
}
highgold/app/src/main/java/com/mints/highgold/mvp/presenters/DomobVedioAdPresenter.kt
0 → 100644
View file @
a59bdf71
package
com.mints.highgold.mvp.presenters
import
android.app.Activity
import
com.mints.highgold.MintsApplication
import
com.mints.highgold.mvp.model.BaseResponse
import
com.mints.highgold.mvp.views.DomobVedioAdView
import
com.mints.highgold.net.LoanService
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
rx.Subscription
import
rx.android.schedulers.AndroidSchedulers
import
java.util.*
class
DomobVedioAdPresenter
:
BasePresenter
<
DomobVedioAdView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
loanApplication
=
activity
.
application
as
MintsApplication
loanService
=
loanApplication
.
getLoanService
()
subscription
=
loanService
.
reportAddCoinMsg
(
vo
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
loanApplication
.
defaultSubscribeScheduler
())
.
subscribe
(
object
:
BaseSubscriber
<
BaseResponse
<
Any
?>?>()
{
override
fun
onCompleted
()
{}
override
fun
onError
(
e
:
Throwable
)
{
}
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
?
>)
{}
})
}
fun
dispose
()
{
loanService
=
null
loanApplication
=
null
if
(
subscription
!=
null
&&
!
subscription
.
isUnsubscribed
())
{
subscription
.
unsubscribe
()
}
}
}
\ No newline at end of file
highgold/app/src/main/java/com/mints/highgold/mvp/views/DomobVedioAdView.kt
0 → 100644
View file @
a59bdf71
package
com.mints.highgold.mvp.views
interface
DomobVedioAdView
:
BaseView
{
}
\ No newline at end of file
highgold/app/src/main/java/com/mints/highgold/ui/activitys/AwardActivity.java
View file @
a59bdf71
...
...
@@ -794,8 +794,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
//广告展示检查3:展示广告前判断广告数据未过期
if
(
SystemClock
.
elapsedRealtime
()
<
(
rewardVideoAD
.
getExpireTimestamp
()
-
delta
))
{
AppConfig
.
ylhAdCount
--;
AppConfig
.
preAdType
=
Constant
.
YLH_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
rewardVideoAD
.
showAD
();
}
else
{
...
...
@@ -985,8 +983,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
@Override
public
void
onAdShow
()
{
//视频广告展示回调
AppConfig
.
csjVedioAdCount
--;
AppConfig
.
preAdType
=
Constant
.
CSJ_VEDIO_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
isloadTTVedio
=
true
;
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
);
...
...
@@ -1113,8 +1109,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
hideLoading
();
AppConfig
.
csjFullAdCount
--;
AppConfig
.
preAdType
=
Constant
.
CSJ_FULL_AD
;
AppConfig
.
preAdTime
=
Calendar
.
getInstance
().
getTimeInMillis
();
}
@Override
...
...
highgold/app/src/main/java/com/mints/highgold/ui/fragment/MainFragment.java
View file @
a59bdf71
...
...
@@ -26,6 +26,7 @@ import com.google.gson.JsonObject;
import
com.google.gson.JsonParser
;
import
com.mints.highgold.BuildConfig
;
import
com.mints.highgold.R
;
import
com.mints.highgold.ad.DomobVedioAdManager
;
import
com.mints.highgold.ad.VedioAdingManager
;
import
com.mints.highgold.ad.inscreenvedio.MintegralInscreenVedioAdManager
;
import
com.mints.highgold.common.AppConfig
;
...
...
@@ -356,9 +357,7 @@ public class MainFragment extends BaseFragment
Bundle
bundle
;
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_fragment_main_whatgold
:
// 如何赚金币
// readyGo(ReadActivity.class);
readyGo
(
WhatGoldActivity
.
class
);
// DomobVedioAdManager.Companion.getInstance(getActivity()).loadDomobAd(10,20,"main","abc");
break
;
case
R
.
id
.
rl_fragment_main_redbox
:
// 红包
readyGo
(
RedboxActivity
.
class
);
...
...
@@ -475,27 +474,34 @@ public class MainFragment extends BaseFragment
//测试数据
// data.setVedioplan_csj_vedio_rate(0);
// data.setVedioplan_lyh_vedio_rate(0);
// data.setVedioplan_csj_full_screen_video_rate(0);
// data.setVedioplan_hytech_vedio_rate(0);
// data.setVedioplan_mintegral_vedio_rate(0);
// data.setVedioplan_coral_vedio_rate(0);
// data.setVedioplan_chuangshen_vedio_rate(10);
//
// data.setVedioplan_csj_vedio_surplus(0);
// data.setVedioplan_lyh_vedio_surplus(0);
// data.setVedioplan_csj_full_screen_video_surplus(0);
// data.setVedioplan_hytech_vedio_surplus(0);
// data.setVedioplan_mintegral_vedio_surplus(0);
// data.setVedioplan_coral_vedio_surplus(0);
// data.setVedioplan_chuangshen_vedio_surplus(10);
data
.
setVedioplan_csj_vedio_rate
(
0
);
data
.
setVedioplan_lyh_vedio_rate
(
0
);
data
.
setVedioplan_csj_full_screen_video_rate
(
0
);
data
.
setVedioplan_hytech_vedio_rate
(
0
);
data
.
setVedioplan_mintegral_vedio_rate
(
0
);
data
.
setVedioplan_coral_vedio_rate
(
0
);
data
.
setVedioplan_domob_vedio_rate
(
10
);
data
.
setVedioplan_chuangshen_vedio_rate
(
0
);
data
.
setVedioplan_csj_vedio_surplus
(
0
);
data
.
setVedioplan_lyh_vedio_surplus
(
0
);
data
.
setVedioplan_csj_full_screen_video_surplus
(
0
);
data
.
setVedioplan_hytech_vedio_surplus
(
0
);
data
.
setVedioplan_mintegral_vedio_surplus
(
0
);
data
.
setVedioplan_coral_vedio_surplus
(
0
);
data
.
setVedioplan_domob_vedio_surplus
(
10
);
data
.
setVedioplan_chuangshen_vedio_surplus
(
0
);
// 设置随机广告权重
if
(
vedioAdingManager
!=
null
)
{
vedioAdingManager
.
initAdWeight
(
data
.
getVedioplan_csj_vedio_rate
(),
data
.
getVedioplan_lyh_vedio_rate
(),
data
.
getVedioplan_csj_full_screen_video_rate
(),
data
.
getVedioplan_hytech_vedio_rate
(),
data
.
getVedioplan_mintegral_vedio_rate
(),
data
.
getVedioplan_coral_vedio_rate
(),
data
.
getVedioplan_chuangshen_vedio_rate
());
vedioAdingManager
.
initAdWeight
(
data
.
getVedioplan_csj_vedio_rate
(),
data
.
getVedioplan_lyh_vedio_rate
(),
data
.
getVedioplan_csj_full_screen_video_rate
(),
data
.
getVedioplan_hytech_vedio_rate
(),
data
.
getVedioplan_mintegral_vedio_rate
(),
data
.
getVedioplan_coral_vedio_rate
(),
data
.
getVedioplan_chuangshen_vedio_rate
(),
data
.
getVedioplan_domob_vedio_rate
());
}
LogUtil
.
d
(
TAG
,
"首页权重值:csjVedioWeight:"
+
data
.
getVedioplan_csj_vedio_rate
()
+
" ylhWeight:"
+
data
.
getVedioplan_lyh_vedio_rate
()
+
" csjFullWeight:"
+
data
.
getVedioplan_csj_full_screen_video_rate
()
+
" hytechVedioAdWeight:"
+
data
.
getVedioplan_hytech_vedio_rate
()
+
" mintegralVedioAdWeight:"
+
data
.
getVedioplan_mintegral_vedio_rate
()
+
" shanhuVedioAdWeight:"
+
data
.
getVedioplan_coral_vedio_rate
()+
" chuangshenVedioAdWeight:"
+
data
.
getVedioplan_chuangshen_vedio_rate
());
LogUtil
.
d
(
TAG
,
"首页权重值:csjVedioWeight:"
+
data
.
getVedioplan_csj_vedio_rate
()
+
" ylhWeight:"
+
data
.
getVedioplan_lyh_vedio_rate
()
+
" csjFullWeight:"
+
data
.
getVedioplan_csj_full_screen_video_rate
()
+
" hytechVedioAdWeight:"
+
data
.
getVedioplan_hytech_vedio_rate
()
+
" mintegralVedioAdWeight:"
+
data
.
getVedioplan_mintegral_vedio_rate
()
+
" shanhuVedioAdWeight:"
+
data
.
getVedioplan_coral_vedio_rate
()+
" chuangshenVedioAdWeight:"
+
data
.
getVedioplan_chuangshen_vedio_rate
()+
" domobVedioAdWeight:"
+
data
.
getVedioplan_domob_vedio_rate
());
// 广告视频数
AppConfig
.
csjVedioAdCount
=
data
.
getVedioplan_csj_vedio_surplus
();
AppConfig
.
ylhAdCount
=
data
.
getVedioplan_lyh_vedio_surplus
();
...
...
@@ -504,7 +510,11 @@ public class MainFragment extends BaseFragment
AppConfig
.
mintegralAdCount
=
data
.
getVedioplan_mintegral_vedio_surplus
();
AppConfig
.
shanhuAdCount
=
data
.
getVedioplan_coral_vedio_surplus
();
AppConfig
.
chuangshenVedioAdCount
=
data
.
getVedioplan_chuangshen_vedio_surplus
();
LogUtil
.
d
(
TAG
,
"首页视频数:csjVedioAdCount:"
+
data
.
getVedioplan_csj_vedio_surplus
()
+
" ylhAdCount:"
+
data
.
getVedioplan_lyh_vedio_surplus
()
+
" csjFullAdCount:"
+
data
.
getVedioplan_csj_full_screen_video_surplus
()
+
" hytechVedioAdCount:"
+
data
.
getVedioplan_hytech_vedio_surplus
()
+
" mintegralVedioAdCount:"
+
data
.
getVedioplan_mintegral_vedio_surplus
()
+
" shanhuVedioAdCount:"
+
data
.
getVedioplan_coral_vedio_surplus
()+
" chuangshenVedioAdCount:"
+
data
.
getVedioplan_chuangshen_vedio_surplus
());
AppConfig
.
duomentVedioAdCount
=
data
.
getVedioplan_domob_vedio_surplus
();
LogUtil
.
d
(
TAG
,
"首页视频数:csjVedioAdCount:"
+
data
.
getVedioplan_csj_vedio_surplus
()
+
" ylhAdCount:"
+
data
.
getVedioplan_lyh_vedio_surplus
()
+
" csjFullAdCount:"
+
data
.
getVedioplan_csj_full_screen_video_surplus
()
+
" hytechVedioAdCount:"
+
data
.
getVedioplan_hytech_vedio_surplus
()
+
" mintegralVedioAdCount:"
+
data
.
getVedioplan_mintegral_vedio_surplus
()
+
" shanhuVedioAdCount:"
+
data
.
getVedioplan_coral_vedio_surplus
()+
" chuangshenVedioAdCount:"
+
data
.
getVedioplan_chuangshen_vedio_surplus
()+
" domobVedioAdCount:"
+
data
.
getVedioplan_domob_vedio_surplus
());
AppConfig
.
yilanVedioTime
=
data
.
getRedPacketSecond
();
userManager
.
setAdShowFlag
(
data
.
isAdFlag
());
...
...
@@ -1434,7 +1444,8 @@ public class MainFragment extends BaseFragment
TextUtils
.
equals
(
adType
,
Constant
.
CSJ_VEDIO_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
CSJ_FULL_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
SHANHU_VEDIO_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
MINTEGRAL_VEDIO_AD
))
{
TextUtils
.
equals
(
adType
,
Constant
.
MINTEGRAL_VEDIO_AD
)||
TextUtils
.
equals
(
adType
,
Constant
.
DUOMENT_VEDIO_AD
))
{
if
(
TextUtils
.
equals
(
adType
,
Constant
.
YLH_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_YLH
;
...
...
@@ -1442,6 +1453,8 @@ public class MainFragment extends BaseFragment
AD_SOURCE
=
Constant
.
AD_SOURCE_MINTEGRAL
;
}
else
if
(
TextUtils
.
equals
(
adType
,
Constant
.
SHANHU_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_SHANHU
;
}
else
if
(
TextUtils
.
equals
(
adType
,
Constant
.
DUOMENT_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_SHANHU
;
}
else
{
AD_SOURCE
=
Constant
.
AD_SOURCE_CSJ
;
}
...
...
highgold/app/src/main/java/com/mints/highgold/ui/fragment/VersusFragment.java
View file @
a59bdf71
...
...
@@ -2243,7 +2243,8 @@ public class VersusFragment extends BaseFragment
TextUtils
.
equals
(
adType
,
Constant
.
CSJ_VEDIO_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
CSJ_FULL_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
SHANHU_VEDIO_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
MINTEGRAL_VEDIO_AD
))
{
TextUtils
.
equals
(
adType
,
Constant
.
MINTEGRAL_VEDIO_AD
)
||
TextUtils
.
equals
(
adType
,
Constant
.
DUOMENT_VEDIO_AD
))
{
if
(
TextUtils
.
equals
(
adType
,
Constant
.
YLH_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_YLH
;
...
...
@@ -2251,6 +2252,8 @@ public class VersusFragment extends BaseFragment
AD_SOURCE
=
Constant
.
AD_SOURCE_MINTEGRAL
;
}
else
if
(
TextUtils
.
equals
(
adType
,
Constant
.
SHANHU_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_SHANHU
;
}
else
if
(
TextUtils
.
equals
(
adType
,
Constant
.
DUOMENT_VEDIO_AD
))
{
AD_SOURCE
=
Constant
.
AD_SOURCE_DOMOB
;
}
else
{
AD_SOURCE
=
Constant
.
AD_SOURCE_CSJ
;
}
...
...
highgold/build.gradle
View file @
a59bdf71
...
...
@@ -18,6 +18,9 @@ buildscript {
// maven { url 'https://raw.githubusercontent.com/TalkingData/SDKMaven/master/' }
}
dependencies
{
// domob广告
classpath
'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
classpath
'com.android.tools.build:gradle:3.5.1'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// TalkingDada 灵动事件
...
...
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