Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
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_flowbox
Commits
87a86926
Commit
87a86926
authored
Jul 16, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有含有gromore激励视频场景预加载修改,打开激活调整,大转盘优化
parent
059be960
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
288 additions
and
85 deletions
+288
-85
PreCsjGroMoreVideoAdManager.java
...m/mints/flowbox/ad/video/PreCsjGroMoreVideoAdManager.java
+60
-52
TrackManager.java
...src/main/java/com/mints/flowbox/manager/TrackManager.java
+12
-0
TrackPresenter.java
...java/com/mints/flowbox/mvp/presenters/TrackPresenter.java
+32
-0
AboutusActivity.kt
...in/java/com/mints/flowbox/ui/activitys/AboutusActivity.kt
+2
-0
AwardActivity.kt
...main/java/com/mints/flowbox/ui/activitys/AwardActivity.kt
+21
-0
DrawcashActivity.kt
...n/java/com/mints/flowbox/ui/activitys/DrawcashActivity.kt
+2
-1
MainActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
+9
-1
BonusFragment.kt
.../main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
+21
-0
GetPacketFragment.kt
...n/java/com/mints/flowbox/ui/fragment/GetPacketFragment.kt
+4
-0
HomeFragment.kt
...c/main/java/com/mints/flowbox/ui/fragment/HomeFragment.kt
+4
-19
MyFragment.kt
...src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
+25
-1
TurnTableFragment.kt
...n/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
+30
-4
VideoFragment.kt
.../main/java/com/mints/flowbox/ui/fragment/VideoFragment.kt
+0
-6
WifiFragment.kt
...c/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
+18
-0
DrawcashVideoDialog.kt
...om/mints/flowbox/ui/widgets/dialog/DrawcashVideoDialog.kt
+29
-1
TimeRender.java
app/src/main/java/com/mints/flowbox/utils/TimeRender.java
+19
-0
No files found.
app/src/main/java/com/mints/flowbox/ad/video/PreCsjGroMoreVideoAdManager.java
View file @
87a86926
...
...
@@ -13,8 +13,6 @@ import com.bytedance.msdk.api.reward.TTRewardAd;
import
com.bytedance.msdk.api.reward.TTRewardedAdListener
;
import
com.bytedance.msdk.api.reward.TTRewardedAdLoadCallback
;
import
com.mints.flowbox.BuildConfig
;
import
com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
;
import
com.mints.flowbox.ad.express.TTPreLoadExpressManager
;
import
com.mints.flowbox.ad.video.base.BaseVideoAd
;
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
;
import
com.mints.flowbox.common.AppConfig
;
...
...
@@ -23,11 +21,11 @@ import com.mints.flowbox.manager.CsjGroMoreManager;
import
com.mints.flowbox.manager.TrackManager
;
import
com.mints.flowbox.manager.UserManager
;
import
com.mints.flowbox.utils.LogUtil
;
import
com.mints.flowbox.utils.TimeRender
;
import
com.mints.flowbox.utils.ToastUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* GroMore激励视频广告 预加载
...
...
@@ -36,18 +34,17 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
private
static
final
String
TAG
=
PreCsjGroMoreVideoAdManager
.
class
.
getSimpleName
();
private
int
curCoin
;
private
String
extraId
;
private
String
carrierType
;
private
VideoAdStatusListener
videoAdStatusListener
;
private
static
PreCsjGroMoreVideoAdManager
_inst
;
private
VideoAdStatusListener
videoAdStatusListener
;
private
TTRewardAd
mttRewardAd
;
private
WeakReference
<
Activity
>
activity
;
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
private
int
isLoadSuccess
=
0
;
//0-加载失败/未加载 1-加载中 2-加载成功
private
int
curCoin
;
//金币
private
String
extraId
;
//id
private
String
carrierType
;
// 载体
private
long
adLoadTime
=
0
;
// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private
long
adPreingTime
=
0
;
// 防止预加载超时 2分钟
public
static
PreCsjGroMoreVideoAdManager
getInstance
()
{
if
(
_inst
==
null
)
{
...
...
@@ -78,27 +75,43 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
/**
* 预加载
* @param activity
*/
public
void
preLoadAd
(
Activity
activity
)
{
// 只有加载失败/未加载时才预加载
if
(
isLoadSuccess
==
0
)
{
this
.
activity
=
new
WeakReference
<>(
activity
);
boolean
isOversped
=
TimeRender
.
isOversped45Min
(
adLoadTime
,
45
);
boolean
isPreingOversped
=
TimeRender
.
isOversped45Min
(
adPreingTime
,
2
);
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"1、进入预加载 isLoadSuccess="
+
isLoadSuccess
+
" isOversped="
+
isOversped
+
" activity="
+
this
.
activity
.
get
()+
" isPreingOversped="
+
isPreingOversped
);
}
// 加载失败/未加载时 或 预加载广告超过45分钟 或预加载超时 才预加载
// 加载失败/未加载时 ==== isLoadSuccess == 0
// (adLoadTime>0&&TimeRender.isOversped45Min(adLoadTime,45) ==== 预加载广告超过45分钟
// (adPreingTime>0&&isPreingOversped&&isLoadSuccess==1) ==== 预加载超时
if
((
isLoadSuccess
==
0
||(
adLoadTime
>
0
&&
isOversped
)||(
adPreingTime
>
0
&&
isPreingOversped
&&
isLoadSuccess
==
1
))
&&
this
.
activity
.
get
()!=
null
)
{
LogUtil
.
d
(
TAG
,
"2、执行预加载去了="
+
isLoadSuccess
);
adPreingTime
=
System
.
currentTimeMillis
();
isLoadSuccess
=
1
;
this
.
activity
=
new
WeakReference
<>(
activity
);
/**
* 判断当前是否存在config 配置 ,如果存在直接加载广告 ,如果不存在则注册config加载回调
*/
if
(
TTMediationAdSdk
.
configLoadSuccess
())
{
loadAd
(
CsjGroMoreManager
.
INSTANCE
.
getAPP_IN_MAIN_AD_UNIT_VIDEO_ID
(),
TTAdConstant
.
VERTICAL
);
}
else
{
TTMediationAdSdk
.
registerConfigCallback
(
mSettingConfigCallback
);
//不用使用内部类,否则在ondestory中无法移除该回调
TTMediationAdSdk
.
registerConfigCallback
(
mSettingConfigCallback
);
}
}
}
/**
* 展示广告
*
* @param activity
* @param curCoin
* @param carrierType
* @param extraId
*/
public
void
showAd
(
Activity
activity
,
int
curCoin
,
String
carrierType
,
String
extraId
)
{
this
.
activity
=
new
WeakReference
<>(
activity
);
boolean
isOversped
=
TimeRender
.
isOversped45Min
(
adLoadTime
,
45
);
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
ToastUtil
.
show
(
this
.
activity
.
get
(),
"加载太快了,请休息一下吧"
);
...
...
@@ -107,10 +120,13 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"
showAd isLoadSuccess="
+
isLoadSuccess
+
" isReady="
+
mttRewardAd
.
isReady
());
LogUtil
.
d
(
TAG
,
"
4、展示广告LoadSuccess="
+
isLoadSuccess
+
" isReady="
+
mttRewardAd
.
isReady
()
+
" isOversped="
+
isOversped
+
" activity="
+
this
.
activity
.
get
());
}
if
(
isLoadSuccess
==
2
&&
mttRewardAd
!=
null
&&
mttRewardAd
.
isReady
()
&&
this
.
activity
!=
null
)
{
// 预加载广告成功 且 预加载广告时长未超过45分钟
if
(
isLoadSuccess
==
2
&&
!
isOversped
&&
mttRewardAd
!=
null
&&
mttRewardAd
.
isReady
()
&&
this
.
activity
!=
null
)
{
isClickScreen
=
true
;
this
.
curCoin
=
curCoin
;
this
.
extraId
=
extraId
;
...
...
@@ -127,10 +143,16 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
vo
.
put
(
"adSource"
,
mttRewardAd
.
getAdNetworkPlatformId
());
vo
.
put
(
"carrierType"
,
carrierType
);
TrackManager
.
getInstance
().
reporGromeEcpm
(
vo
);
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
LogUtil
.
d
(
TAG
,
"5、展示广告时失败了,广告可能超时45分钟 onError "
);
LogUtil
.
d
(
TAG
,
"adNetworkPlatformId: "
+
mttRewardAd
.
getAdNetworkPlatformId
());
//获取展示广告对应的adn的值 具体值见NetworkPlatformConst类 -3: 无权限 -2: 暂无数据
LogUtil
.
d
(
TAG
,
"adNetworkRitId:"
+
mttRewardAd
.
getAdNetworkRitId
());
//获取展示广告对应的代码位 具体值见NetworkPlatformConst类 "-3": 无权限 "-2"
LogUtil
.
d
(
TAG
,
"preEcpm: "
+
mttRewardAd
.
getPreEcpm
());
//获取展示广告预估ecpm价格,单位是分 具体值见NetworkPlatformConst类 "-3": 无权限 "-2": 暂无数据 "-1":平台未有填写的预估ecpm价格
if
(
videoAdStatusListener
!=
null
)
{
videoAdStatusListener
.
adFail
();
}
ToastUtil
.
show
(
this
.
activity
.
get
(),
"加载太快了,请休息一下吧!"
);
preLoadAd
(
this
.
activity
.
get
());
}
// 状态重置
...
...
@@ -176,7 +198,7 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
code
),
adError
.
message
);
LogUtil
.
d
(
TAG
,
"onError "
+
String
.
valueOf
(
adError
.
code
)
+
adError
.
message
);
LogUtil
.
d
(
TAG
,
"
3、onRewardVideoLoadFail
onError "
+
String
.
valueOf
(
adError
.
code
)
+
adError
.
message
);
if
(
videoAdStatusListener
!=
null
)
{
videoAdStatusListener
.
adFail
();
}
...
...
@@ -185,21 +207,18 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
@Override
public
void
onRewardVideoAdLoad
()
{
isLoadSuccess
=
2
;
adLoadTime
=
System
.
currentTimeMillis
();
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"3、AdLoad onRewardVideoAdLoad="
+
isLoadSuccess
+
" isReady="
+
mttRewardAd
.
isReady
());
}
}
@Override
public
void
onRewardVideoCached
()
{
isLoadSuccess
=
2
;
if
(
mttRewardAd
!=
null
)
{
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
LogUtil
.
d
(
TAG
,
" onRewardVideoCached onError "
);
if
(
videoAdStatusListener
!=
null
)
{
videoAdStatusListener
.
adFail
();
}
adLoadTime
=
System
.
currentTimeMillis
();
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"3、Cacheeee onRewardVideoCached="
+
isLoadSuccess
+
" isReady="
+
mttRewardAd
.
isReady
());
}
}
});
...
...
@@ -214,10 +233,9 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 广告的展示回调 每个广告仅回调一次
*/
public
void
onRewardedAdShow
()
{
LogUtil
.
d
(
TAG
,
"onRewardedAdShow"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
);
preLoadAd
(
activity
.
get
());
}
/**
...
...
@@ -225,8 +243,6 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
*/
@Override
public
void
onRewardClick
()
{
LogUtil
.
d
(
TAG
,
"onRewardClick"
);
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"ecpmId"
,
AppConfig
.
gromoreId
);
TrackManager
.
getInstance
().
reportGromoreAdClick
(
vo
);
...
...
@@ -251,8 +267,6 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 广告关闭的回调
*/
public
void
onRewardedAdClosed
()
{
LogUtil
.
d
(
TAG
,
"onRewardedAdClosed"
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
HashMap
<
String
,
Object
>
voTemp
=
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_GROMORE
,
extraId
,
curCoin
);
...
...
@@ -306,7 +320,6 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 视频播放完毕的回调 Admob广告不存在该回调
*/
public
void
onVideoComplete
()
{
LogUtil
.
d
(
TAG
,
"onVideoComplete"
);
}
...
...
@@ -314,27 +327,22 @@ public class PreCsjGroMoreVideoAdManager extends BaseVideoAd {
* 视频播放失败的回调 - Mintegral GDT Admob广告不存在该回调
*/
public
void
onVideoError
()
{
LogUtil
.
d
(
TAG
,
"onVideoError"
);
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"7、播放 onVideoError"
);
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_GROMORE
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
if
(
videoAdStatusListener
!=
null
)
{
videoAdStatusListener
.
adFail
();
}
preLoadAd
(
activity
.
get
());
}
/**
* 激励视频播放完毕,验证是否有效发放奖励的回调
*/
public
void
onRewardVerify
(
RewardItem
rewardItem
)
{
Map
<
String
,
Object
>
customData
=
rewardItem
.
getCustomData
();
if
(
customData
!=
null
)
{
String
adnName
=
(
String
)
customData
.
get
(
RewardItem
.
KEY_ADN_NAME
);
switch
(
adnName
)
{
case
RewardItem
.
KEY_GDT
:
LogUtil
.
d
(
TAG
,
"rewardItem gdt: "
+
customData
.
get
(
RewardItem
.
KEY_GDT_TRANS_ID
));
break
;
}
}
}
/**
...
...
app/src/main/java/com/mints/flowbox/manager/TrackManager.java
View file @
87a86926
...
...
@@ -177,4 +177,16 @@ public class TrackManager {
trackPresenter
.
getOuterAdConfig
();
}
}
public
void
comSaveTerminalInfo
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
comSaveTerminalInfo
();
}
}
public
void
getAdWeight
()
{
if
(
trackPresenter
!=
null
&&
!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
getUserID
()))
{
trackPresenter
.
getAdWeight
();
}
}
}
app/src/main/java/com/mints/flowbox/mvp/presenters/TrackPresenter.java
View file @
87a86926
...
...
@@ -550,4 +550,36 @@ public class TrackPresenter extends BaseTrackPresenter {
});
}
public
void
comSaveTerminalInfo
()
{
DeviceInfo
deviceInfo
=
DeviceInfo
.
Companion
.
getInstance
();
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"androidid"
,
deviceInfo
.
getAndroidId
(
null
));
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
().
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
vo
.
put
(
"imei"
,
deviceInfo
.
getIMEI
());
vo
.
put
(
"oaid"
,
MintsApplication
.
OAID
);
String
macAddress
=
deviceInfo
.
getMacAddress
();
String
mac
=
macAddress
.
replace
(
":"
,
""
);
vo
.
put
(
"mac"
,
mac
);
vo
.
put
(
"mac1"
,
macAddress
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
comSaveTerminalInfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
}
});
}
}
app/src/main/java/com/mints/flowbox/ui/activitys/AboutusActivity.kt
View file @
87a86926
...
...
@@ -6,8 +6,10 @@ import android.view.View
import
com.bytedance.hume.readapk.HumeSDK
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.utils.TimeRender
import
com.mints.flowbox.utils.ToastUtil
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.ConstantUtil
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/AwardActivity.kt
View file @
87a86926
...
...
@@ -13,7 +13,9 @@ import androidx.core.content.ContextCompat
import
com.bumptech.glide.Glide
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.common.DeviceInfo.Companion.instance
...
...
@@ -471,6 +473,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
flAwardAd
?.
removeAllViews
()
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDestroy
()
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
null
)
if
(
ivRootAwardAd
!=
null
)
{
Glide
.
with
(
applicationContext
).
clear
(
ivRootAwardAd
)
...
...
@@ -593,6 +596,24 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
return
}
// gromore预加载
if
(
AppConfig
.
groMoreVideoAdCount
>
0
){
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
object
:
VideoAdStatusListener
{
override
fun
adFail
()
{
}
override
fun
adSuccess
()
{
videoAdingSuccess
(
""
)
}
override
fun
adDownload
()
{
}
})
PreCsjGroMoreVideoAdManager
.
getInstance
().
showAd
(
this
,
curCoin
,
carrierType
,
extraId
)
return
}
showLoading
(
"加载中..."
)
val
bean
=
VideoAdingBean
()
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/DrawcashActivity.kt
View file @
87a86926
...
...
@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.login.LoginApi
...
...
@@ -86,7 +87,7 @@ class DrawcashActivity : BaseActivity(),
loginApi
.
setOnLoginListener
(
null
)
drawcashVideoDialog
?.
setOnClickListener
(
null
)
drawcashVideoDialog
?.
onDestory
()
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
null
)
drawcashPresenter
.
detachView
()
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
87a86926
...
...
@@ -14,6 +14,7 @@ import com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.express.PreLoadExpressManager
import
com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
...
...
@@ -101,12 +102,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
onResume
()
{
super
.
onResume
()
TrackManager
.
getInstance
().
getAdWeight
()
}
public
override
fun
onDestroy
()
{
mainPresenter
.
detachView
()
TTPreLoadCarrierExpressManager
.
getInstance
().
onDestroy
()
VideoAdingManager
.
getInstance
(
this
).
setVideoAdingListener
(
null
)
VideoAdingManager
.
getInstance
(
this
).
onDestroy
()
WifiUtils
.
getInstance
(
this
).
destroy
()
PreCsjGroMoreVideoAdManager
.
getInstance
().
onDestroy
()
super
.
onDestroy
()
}
...
...
@@ -453,7 +461,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
CsjGroMoreManager
.
updataIdByChannel
(
data
.
gromoreAdcodes
)
// 更新权重
UserWeight
.
initAdWeight
(
data
)
//
UserWeight.initAdWeight(data)
initExpress
(
data
.
flowAdRules
)
// 是否上报点击广告
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
View file @
87a86926
...
...
@@ -8,7 +8,9 @@ import android.text.TextUtils
import
android.view.View
import
androidx.core.content.ContextCompat
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.UserManager
...
...
@@ -262,6 +264,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
override
fun
onDestroy
()
{
super
.
onDestroy
()
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
null
)
bonusPresenter
.
detachView
()
}
...
...
@@ -285,6 +288,24 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
return
}
// gromore预加载
if
(
AppConfig
.
groMoreVideoAdCount
>
0
){
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
object
:
VideoAdStatusListener
{
override
fun
adFail
()
{
}
override
fun
adSuccess
()
{
videoAdingSuccess
()
}
override
fun
adDownload
()
{
}
})
PreCsjGroMoreVideoAdManager
.
getInstance
().
showAd
(
requireActivity
(),
coin
,
carrierType
,
""
)
return
}
loadVideoFailCount
=
0
showLoading
(
"加载中..."
)
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/GetPacketFragment.kt
View file @
87a86926
...
...
@@ -5,6 +5,7 @@ import android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.UserManager
...
...
@@ -40,6 +41,9 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_FOUR
)
{
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager
.
getInstance
().
preLoadAd
(
requireActivity
())
refreshData
()
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/HomeFragment.kt
View file @
87a86926
...
...
@@ -9,7 +9,7 @@ import android.widget.AdapterView
import
android.widget.GridView
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.video.
VideoAding
Manager
import
com.mints.flowbox.ad.video.
PreCsjGroMoreVideoAd
Manager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.*
...
...
@@ -45,9 +45,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
WifiUtils
.
getInstance
(
requireActivity
())
}
// 广告权重相关
private
var
videoAdingManager
:
VideoAdingManager
?
=
null
// 热门活动数据
private
var
mCurrentIndex
=
0
private
val
hotList
:
MutableList
<
BannerBean
.
ListBean
>
=
mutableListOf
()
...
...
@@ -59,18 +56,10 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override
fun
initViewsAndEvents
()
{
homePresenter
.
attachView
(
this
)
videoAdingManager
=
VideoAdingManager
.
getInstance
(
requireActivity
())
init
()
initView
()
initListener
()
}
/** 初始化 */
private
fun
init
()
{
// 打开激活
uploadDeviceInfo
()
}
private
fun
initView
()
{
wifi_view
.
setCount
(
0
)
...
...
@@ -114,6 +103,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
refreshData
()
wifi_view
.
wifiOn
()
tvContent
.
text
=
"连续签到可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager
.
getInstance
().
preLoadAd
(
requireActivity
())
}
}
...
...
@@ -216,13 +208,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
}
}
private
fun
uploadDeviceInfo
()
{
homePresenter
.
comSaveTerminalInfo
()
UmengManager
.
initUm
()
homePresenter
.
getAdcodesInOpenApp
()
}
override
fun
getMyHotActivitySuc
(
data
:
BannerBean
?)
{
if
(!
requireActivity
().
isFinishing
)
{
data
?.
let
{
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
View file @
87a86926
...
...
@@ -19,7 +19,9 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.banner.BannerManager
import
com.mints.flowbox.ad.express.TTPreLoadExpressXmlyManager
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.*
...
...
@@ -114,6 +116,9 @@ class MyFragment : BaseFragment(),
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager
.
getInstance
().
loadTtFrameLayout
()
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager
.
getInstance
().
preLoadAd
(
requireActivity
())
}
}
...
...
@@ -152,7 +157,7 @@ class MyFragment : BaseFragment(),
fl_my_banner
?.
removeAllViews
()
BannerManager
.
instance
.
onDestroy
()
myPresenter
.
detachView
()
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
null
)
onDestroyBroadcastReceiver
()
}
...
...
@@ -614,6 +619,25 @@ class MyFragment : BaseFragment(),
return
}
// gromore预加载
if
(
AppConfig
.
groMoreVideoAdCount
>
0
){
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
object
:
VideoAdStatusListener
{
override
fun
adFail
()
{
}
override
fun
adSuccess
()
{
videoAdingSuccess
()
}
override
fun
adDownload
()
{
}
})
PreCsjGroMoreVideoAdManager
.
getInstance
().
showAd
(
requireActivity
(),
coin
,
carrierType
,
""
)
return
}
loadVideoFailCount
=
0
showLoading
(
"加载中..."
)
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
View file @
87a86926
...
...
@@ -22,12 +22,18 @@ import com.daimajia.androidanimations.library.YoYo
import
com.github.iielse.switchbutton.SwitchView
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.inscreen.InsertScreenAdManager
import
com.mints.flowbox.ad.
wifi.WifiAdStatusListen
er
import
com.mints.flowbox.ad.
video.PreCsjGroMoreVideoAdManag
er
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.ad.wifi.WifiAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.*
import
com.mints.flowbox.mvp.model.*
import
com.mints.flowbox.manager.AppPreferencesManager
import
com.mints.flowbox.manager.DownloadApkManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.mvp.model.ClickTurnBean
import
com.mints.flowbox.mvp.model.TurnBean
import
com.mints.flowbox.mvp.model.VideoAdingBean
import
com.mints.flowbox.mvp.presenters.TurnTablePresenter
import
com.mints.flowbox.mvp.views.TurnTableView
import
com.mints.flowbox.service.AppInstallService
...
...
@@ -49,7 +55,6 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import
com.umeng.analytics.MobclickAgent
import
kotlinx.android.synthetic.main.fragment_main_turntable.*
import
kotlinx.android.synthetic.main.layout_turn_btn.*
import
kotlin.collections.ArrayList
/**
* 描述:大转盘
...
...
@@ -565,6 +570,27 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
return
}
// gromore预加载
if
(
AppConfig
.
groMoreVideoAdCount
>
0
){
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
object
:
VideoAdStatusListener
{
override
fun
adFail
()
{
isTurnTable
=
true
turnTableView
.
stopAnim
()
}
override
fun
adSuccess
()
{
turnTableView
.
stopAnim
()
videoAdingSuccess
(
Constant
.
GROMORE_VEDIO_AD
)
}
override
fun
adDownload
()
{
}
})
PreCsjGroMoreVideoAdManager
.
getInstance
().
showAd
(
requireActivity
(),
0
,
carrierType
,
clickTurnData
?.
turntableKey
)
return
}
loadVedioFailCount
=
0
val
bean
=
VideoAdingBean
()
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/VideoFragment.kt
View file @
87a86926
...
...
@@ -13,7 +13,6 @@ import com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.daimajia.androidanimations.library.YoYo.YoYoString
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.AppPreferencesManager
import
com.mints.flowbox.mvp.model.MainVideoMsgBean
...
...
@@ -57,9 +56,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
private
var
isAward
=
false
// 是否可以领金币 本地判断
private
var
isFirstWatchVideo
=
true
// 是否是第一次观看完视频
// 广告权重相关
private
var
videoAdingManager
:
VideoAdingManager
?
=
null
// 福袋相关
private
var
rope
:
YoYoString
?
=
null
private
var
mRedBoxTimer
:
CountDownTimerSupport
?
=
null
...
...
@@ -71,8 +67,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
override
fun
initViewsAndEvents
()
{
videoPresenter
.
attachView
(
this
)
videoAdingManager
=
VideoAdingManager
.
getInstance
(
activity
)
// 初始化视频
showLittle
()
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
View file @
87a86926
...
...
@@ -21,8 +21,11 @@ import com.daimajia.androidanimations.library.YoYo
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.manager.UmengManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.manager.wifi.WifiStateManager
import
com.mints.flowbox.mvp.model.WifiListBean
...
...
@@ -96,6 +99,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
else
{
(
requireActivity
()
as
MainActivity
).
userLogin
(
Constant
.
FRAGMENT_CLICK_THREE
)
}
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager
.
getInstance
().
preLoadAd
(
requireActivity
())
}
}
...
...
@@ -105,6 +111,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
initRecy
()
initView
()
initData
()
initListener
()
}
...
...
@@ -319,6 +326,17 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
WifiStateManager
.
instance
.
setWifiStateCallback
(
this
)
}
/** 初始化 */
private
fun
initData
()
{
// 打开激活
uploadDeviceInfo
()
}
private
fun
uploadDeviceInfo
()
{
TrackManager
.
getInstance
().
comSaveTerminalInfo
()
UmengManager
.
initUm
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_wifi
override
fun
onClick
(
v
:
View
?)
{
...
...
app/src/main/java/com/mints/flowbox/ui/widgets/dialog/DrawcashVideoDialog.kt
View file @
87a86926
...
...
@@ -8,7 +8,10 @@ import android.view.View
import
android.view.WindowManager
import
android.widget.TextView
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.mvp.model.VideoAdingBean
...
...
@@ -30,6 +33,8 @@ class DrawcashVideoDialog(activity: Activity) :
private
var
tvNext
:
TextView
private
var
activity
:
Activity
?
=
null
private
var
isGroDownloadFlag
=
false
init
{
setContentView
(
R
.
layout
.
dialog_drawcash
)
// 设置window属性
...
...
@@ -85,10 +90,33 @@ class DrawcashVideoDialog(activity: Activity) :
*/
private
fun
awardVideo
()
{
if
(
activity
==
null
)
return
isGroDownloadFlag
=
false
loadVideoFailCount
=
0
ToastUtil
.
show
(
activity
,
"加载中..."
)
// gromore预加载
if
(
AppConfig
.
groMoreVideoAdCount
>
0
){
PreCsjGroMoreVideoAdManager
.
getInstance
().
setVideoAdStatusListener
(
object
:
VideoAdStatusListener
{
override
fun
adFail
()
{
}
override
fun
adSuccess
()
{
if
(
isGroDownloadFlag
)
{
TrackManager
.
getInstance
().
drawcashVideo
()
}
}
override
fun
adDownload
()
{
isGroDownloadFlag
=
true
}
})
PreCsjGroMoreVideoAdManager
.
getInstance
().
showAd
(
activity
,
0
,
Constant
.
CARRIER_DRAWCASH
,
""
)
return
}
loadVideoFailCount
=
0
val
bean
=
VideoAdingBean
()
bean
.
carrierType
=
Constant
.
CARRIER_DRAWCASH
...
...
app/src/main/java/com/mints/flowbox/utils/TimeRender.java
View file @
87a86926
...
...
@@ -6,6 +6,8 @@ import android.content.Context;
import
android.widget.DatePicker
;
import
android.widget.EditText
;
import
com.mints.flowbox.MintsApplication
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
...
...
@@ -288,6 +290,23 @@ public class TimeRender {
return
(
curTime
-
lastTime
)
/
(
1000
*
60
);
}
/**
* 是否超过outMin分钟
*
* @param adPreLoadTime 广告预加载时间
* @return true-超过outMin分钟
*/
public
static
boolean
isOversped45Min
(
long
adPreLoadTime
,
int
outMin
)
{
long
time
=
(
System
.
currentTimeMillis
()
-
adPreLoadTime
)
/
(
1000
*
60
);
// LogUtil.d("PreCsjGroMoreVideoAdManager","adPreLoadTime="+adPreLoadTime+"time="+time);
if
(
time
>
outMin
&&
adPreLoadTime
>
0
){
return
true
;
}
return
false
;
}
/**
* 根据时间戳 计算秒间隔
*
...
...
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