Commit 87a86926 authored by mengcuiguang2's avatar mengcuiguang2

所有含有gromore激励视频场景预加载修改,打开激活调整,大转盘优化

parent 059be960
...@@ -177,4 +177,16 @@ public class TrackManager { ...@@ -177,4 +177,16 @@ public class TrackManager {
trackPresenter.getOuterAdConfig(); trackPresenter.getOuterAdConfig();
} }
} }
public void comSaveTerminalInfo() {
if (trackPresenter != null) {
trackPresenter.comSaveTerminalInfo();
}
}
public void getAdWeight() {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.getAdWeight();
}
}
} }
...@@ -550,4 +550,36 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -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) {
}
});
}
} }
...@@ -6,8 +6,10 @@ import android.view.View ...@@ -6,8 +6,10 @@ import android.view.View
import com.bytedance.hume.readapk.HumeSDK import com.bytedance.hume.readapk.HumeSDK
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.TimeRender
import com.mints.flowbox.utils.ToastUtil import com.mints.flowbox.utils.ToastUtil
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil import com.mints.library.utils.ConstantUtil
......
...@@ -13,7 +13,9 @@ import androidx.core.content.ContextCompat ...@@ -13,7 +13,9 @@ import androidx.core.content.ContextCompat
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager 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.VideoAdingManager
import com.mints.flowbox.ad.video.base.VideoAdStatusListener
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.common.DeviceInfo.Companion.instance import com.mints.flowbox.common.DeviceInfo.Companion.instance
...@@ -471,6 +473,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -471,6 +473,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
flAwardAd?.removeAllViews() flAwardAd?.removeAllViews()
videoAdingManager.setVideoAdingListener(null) videoAdingManager.setVideoAdingListener(null)
videoAdingManager.onDestroy() videoAdingManager.onDestroy()
PreCsjGroMoreVideoAdManager.getInstance().setVideoAdStatusListener(null)
if (ivRootAwardAd != null) { if (ivRootAwardAd != null) {
Glide.with(applicationContext).clear(ivRootAwardAd) Glide.with(applicationContext).clear(ivRootAwardAd)
...@@ -593,6 +596,24 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -593,6 +596,24 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
return 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("加载中...") showLoading("加载中...")
val bean = VideoAdingBean() val bean = VideoAdingBean()
......
...@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.GridLayoutManager ...@@ -8,6 +8,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import com.mints.flowbox.R 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.VideoAdingManager
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.login.LoginApi import com.mints.flowbox.login.LoginApi
...@@ -86,7 +87,7 @@ class DrawcashActivity : BaseActivity(), ...@@ -86,7 +87,7 @@ class DrawcashActivity : BaseActivity(),
loginApi.setOnLoginListener(null) loginApi.setOnLoginListener(null)
drawcashVideoDialog?.setOnClickListener(null) drawcashVideoDialog?.setOnClickListener(null)
drawcashVideoDialog?.onDestory() drawcashVideoDialog?.onDestory()
PreCsjGroMoreVideoAdManager.getInstance().setVideoAdStatusListener(null)
drawcashPresenter.detachView() drawcashPresenter.detachView()
} }
......
...@@ -14,6 +14,7 @@ import com.mints.flowbox.R ...@@ -14,6 +14,7 @@ import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.express.PreLoadExpressManager import com.mints.flowbox.ad.express.PreLoadExpressManager
import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager 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.ad.video.VideoAdingManager
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
...@@ -101,12 +102,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -101,12 +102,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun isApplyKitKatTranslucency() = false override fun isApplyKitKatTranslucency() = false
override fun onResume() {
super.onResume()
TrackManager.getInstance().getAdWeight()
}
public override fun onDestroy() { public override fun onDestroy() {
mainPresenter.detachView() mainPresenter.detachView()
TTPreLoadCarrierExpressManager.getInstance().onDestroy() TTPreLoadCarrierExpressManager.getInstance().onDestroy()
VideoAdingManager.getInstance(this).setVideoAdingListener(null) VideoAdingManager.getInstance(this).setVideoAdingListener(null)
VideoAdingManager.getInstance(this).onDestroy() VideoAdingManager.getInstance(this).onDestroy()
WifiUtils.getInstance(this).destroy() WifiUtils.getInstance(this).destroy()
PreCsjGroMoreVideoAdManager.getInstance().onDestroy()
super.onDestroy() super.onDestroy()
} }
...@@ -453,7 +461,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -453,7 +461,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
CsjGroMoreManager.updataIdByChannel(data.gromoreAdcodes) CsjGroMoreManager.updataIdByChannel(data.gromoreAdcodes)
// 更新权重 // 更新权重
UserWeight.initAdWeight(data) // UserWeight.initAdWeight(data)
initExpress(data.flowAdRules) initExpress(data.flowAdRules)
// 是否上报点击广告 // 是否上报点击广告
......
...@@ -8,7 +8,9 @@ import android.text.TextUtils ...@@ -8,7 +8,9 @@ import android.text.TextUtils
import android.view.View import android.view.View
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.mints.flowbox.R 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.VideoAdingManager
import com.mints.flowbox.ad.video.base.VideoAdStatusListener
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.UserManager import com.mints.flowbox.manager.UserManager
...@@ -262,6 +264,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View. ...@@ -262,6 +264,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
PreCsjGroMoreVideoAdManager.getInstance().setVideoAdStatusListener(null)
bonusPresenter.detachView() bonusPresenter.detachView()
} }
...@@ -285,6 +288,24 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View. ...@@ -285,6 +288,24 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
return 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 loadVideoFailCount = 0
showLoading("加载中...") showLoading("加载中...")
......
...@@ -5,6 +5,7 @@ import android.os.Looper ...@@ -5,6 +5,7 @@ import android.os.Looper
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.UserManager import com.mints.flowbox.manager.UserManager
...@@ -40,6 +41,9 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener { ...@@ -40,6 +41,9 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager.getInstance().preLoadAd(requireActivity())
refreshData() refreshData()
} }
} }
......
...@@ -9,7 +9,7 @@ import android.widget.AdapterView ...@@ -9,7 +9,7 @@ import android.widget.AdapterView
import android.widget.GridView import android.widget.GridView
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.video.VideoAdingManager import com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.* import com.mints.flowbox.manager.*
...@@ -45,9 +45,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -45,9 +45,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
WifiUtils.getInstance(requireActivity()) WifiUtils.getInstance(requireActivity())
} }
// 广告权重相关
private var videoAdingManager: VideoAdingManager? = null
// 热门活动数据 // 热门活动数据
private var mCurrentIndex = 0 private var mCurrentIndex = 0
private val hotList: MutableList<BannerBean.ListBean> = mutableListOf() private val hotList: MutableList<BannerBean.ListBean> = mutableListOf()
...@@ -59,18 +56,10 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -59,18 +56,10 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
homePresenter.attachView(this) homePresenter.attachView(this)
videoAdingManager = VideoAdingManager.getInstance(requireActivity())
init()
initView() initView()
initListener() initListener()
} }
/** 初始化 */
private fun init() {
// 打开激活
uploadDeviceInfo()
}
private fun initView() { private fun initView() {
wifi_view.setCount(0) wifi_view.setCount(0)
...@@ -114,6 +103,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -114,6 +103,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
refreshData() refreshData()
wifi_view.wifiOn() wifi_view.wifiOn()
tvContent.text = "连续签到可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包" tvContent.text = "连续签到可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager.getInstance().preLoadAd(requireActivity())
} }
} }
...@@ -216,13 +208,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -216,13 +208,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
} }
} }
private fun uploadDeviceInfo() {
homePresenter.comSaveTerminalInfo()
UmengManager.initUm()
homePresenter.getAdcodesInOpenApp()
}
override fun getMyHotActivitySuc(data: BannerBean?) { override fun getMyHotActivitySuc(data: BannerBean?) {
if (!requireActivity().isFinishing) { if (!requireActivity().isFinishing) {
data?.let { data?.let {
......
...@@ -19,7 +19,9 @@ import com.mints.library.utils.nodoubleclick.AntiShake ...@@ -19,7 +19,9 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.banner.BannerManager import com.mints.flowbox.ad.banner.BannerManager
import com.mints.flowbox.ad.express.TTPreLoadExpressXmlyManager 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.VideoAdingManager
import com.mints.flowbox.ad.video.base.VideoAdStatusListener
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.* import com.mints.flowbox.manager.*
...@@ -114,6 +116,9 @@ class MyFragment : BaseFragment(), ...@@ -114,6 +116,9 @@ class MyFragment : BaseFragment(),
// 刷新喜马拉雅信息流 // 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout() TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager.getInstance().preLoadAd(requireActivity())
} }
} }
...@@ -152,7 +157,7 @@ class MyFragment : BaseFragment(), ...@@ -152,7 +157,7 @@ class MyFragment : BaseFragment(),
fl_my_banner?.removeAllViews() fl_my_banner?.removeAllViews()
BannerManager.instance.onDestroy() BannerManager.instance.onDestroy()
myPresenter.detachView() myPresenter.detachView()
PreCsjGroMoreVideoAdManager.getInstance().setVideoAdStatusListener(null)
onDestroyBroadcastReceiver() onDestroyBroadcastReceiver()
} }
...@@ -614,6 +619,25 @@ class MyFragment : BaseFragment(), ...@@ -614,6 +619,25 @@ class MyFragment : BaseFragment(),
return 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 loadVideoFailCount = 0
showLoading("加载中...") showLoading("加载中...")
......
...@@ -22,12 +22,18 @@ import com.daimajia.androidanimations.library.YoYo ...@@ -22,12 +22,18 @@ import com.daimajia.androidanimations.library.YoYo
import com.github.iielse.switchbutton.SwitchView import com.github.iielse.switchbutton.SwitchView
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.inscreen.InsertScreenAdManager import com.mints.flowbox.ad.inscreen.InsertScreenAdManager
import com.mints.flowbox.ad.wifi.WifiAdStatusListener import com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import com.mints.flowbox.ad.video.VideoAdingManager 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.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.* import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.mvp.model.* 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.presenters.TurnTablePresenter
import com.mints.flowbox.mvp.views.TurnTableView import com.mints.flowbox.mvp.views.TurnTableView
import com.mints.flowbox.service.AppInstallService import com.mints.flowbox.service.AppInstallService
...@@ -49,7 +55,6 @@ import com.mints.library.utils.nodoubleclick.AntiShake ...@@ -49,7 +55,6 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import kotlinx.android.synthetic.main.fragment_main_turntable.* import kotlinx.android.synthetic.main.fragment_main_turntable.*
import kotlinx.android.synthetic.main.layout_turn_btn.* import kotlinx.android.synthetic.main.layout_turn_btn.*
import kotlin.collections.ArrayList
/** /**
* 描述:大转盘 * 描述:大转盘
...@@ -565,6 +570,27 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick ...@@ -565,6 +570,27 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
return 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 loadVedioFailCount = 0
val bean = VideoAdingBean() val bean = VideoAdingBean()
......
...@@ -13,7 +13,6 @@ import com.daimajia.androidanimations.library.Techniques ...@@ -13,7 +13,6 @@ import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.daimajia.androidanimations.library.YoYo.YoYoString import com.daimajia.androidanimations.library.YoYo.YoYoString
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.video.VideoAdingManager
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.AppPreferencesManager import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.mvp.model.MainVideoMsgBean import com.mints.flowbox.mvp.model.MainVideoMsgBean
...@@ -57,9 +56,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener { ...@@ -57,9 +56,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
private var isAward = false // 是否可以领金币 本地判断 private var isAward = false // 是否可以领金币 本地判断
private var isFirstWatchVideo = true// 是否是第一次观看完视频 private var isFirstWatchVideo = true// 是否是第一次观看完视频
// 广告权重相关
private var videoAdingManager: VideoAdingManager? = null
// 福袋相关 // 福袋相关
private var rope: YoYoString? = null private var rope: YoYoString? = null
private var mRedBoxTimer: CountDownTimerSupport? = null private var mRedBoxTimer: CountDownTimerSupport? = null
...@@ -71,8 +67,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener { ...@@ -71,8 +67,6 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
videoPresenter.attachView(this) videoPresenter.attachView(this)
videoAdingManager = VideoAdingManager.getInstance(activity)
// 初始化视频 // 初始化视频
showLittle() showLittle()
......
...@@ -21,8 +21,11 @@ import com.daimajia.androidanimations.library.YoYo ...@@ -21,8 +21,11 @@ import com.daimajia.androidanimations.library.YoYo
import com.hjq.toast.ToastUtils import com.hjq.toast.ToastUtils
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager 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.AppConfig
import com.mints.flowbox.common.Constant 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.UserManager
import com.mints.flowbox.manager.wifi.WifiStateManager import com.mints.flowbox.manager.wifi.WifiStateManager
import com.mints.flowbox.mvp.model.WifiListBean import com.mints.flowbox.mvp.model.WifiListBean
...@@ -96,6 +99,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -96,6 +99,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} else { } else {
(requireActivity() as MainActivity).userLogin(Constant.FRAGMENT_CLICK_THREE) (requireActivity() as MainActivity).userLogin(Constant.FRAGMENT_CLICK_THREE)
} }
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager.getInstance().preLoadAd(requireActivity())
} }
} }
...@@ -105,6 +111,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -105,6 +111,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
initRecy() initRecy()
initView() initView()
initData()
initListener() initListener()
} }
...@@ -319,6 +326,17 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -319,6 +326,17 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
WifiStateManager.instance.setWifiStateCallback(this) 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 getContentViewLayoutID() = R.layout.fragment_wifi
override fun onClick(v: View?) { override fun onClick(v: View?) {
......
...@@ -8,7 +8,10 @@ import android.view.View ...@@ -8,7 +8,10 @@ import android.view.View
import android.view.WindowManager import android.view.WindowManager
import android.widget.TextView import android.widget.TextView
import com.mints.flowbox.R 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.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.Constant
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.mvp.model.VideoAdingBean import com.mints.flowbox.mvp.model.VideoAdingBean
...@@ -30,6 +33,8 @@ class DrawcashVideoDialog(activity: Activity) : ...@@ -30,6 +33,8 @@ class DrawcashVideoDialog(activity: Activity) :
private var tvNext: TextView private var tvNext: TextView
private var activity: Activity? = null private var activity: Activity? = null
private var isGroDownloadFlag=false
init { init {
setContentView(R.layout.dialog_drawcash) setContentView(R.layout.dialog_drawcash)
// 设置window属性 // 设置window属性
...@@ -85,10 +90,33 @@ class DrawcashVideoDialog(activity: Activity) : ...@@ -85,10 +90,33 @@ class DrawcashVideoDialog(activity: Activity) :
*/ */
private fun awardVideo() { private fun awardVideo() {
if (activity == null) return if (activity == null) return
isGroDownloadFlag=false
loadVideoFailCount = 0
ToastUtil.show(activity, "加载中...") 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() val bean = VideoAdingBean()
bean.carrierType = Constant.CARRIER_DRAWCASH bean.carrierType = Constant.CARRIER_DRAWCASH
......
...@@ -6,6 +6,8 @@ import android.content.Context; ...@@ -6,6 +6,8 @@ import android.content.Context;
import android.widget.DatePicker; import android.widget.DatePicker;
import android.widget.EditText; import android.widget.EditText;
import com.mints.flowbox.MintsApplication;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
...@@ -288,6 +290,23 @@ public class TimeRender { ...@@ -288,6 +290,23 @@ public class TimeRender {
return (curTime - lastTime) / (1000 * 60); 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;
}
/** /**
* 根据时间戳 计算秒间隔 * 根据时间戳 计算秒间隔
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment