Commit 12f9ab31 authored by mengcuiguang2's avatar mengcuiguang2

添加gromore逻辑,修改激励视频,信息流,内存泄露优化。解决冲突

parents 4e210681 68c773e1
/build
mapping.txt
seeds.txt
unused.txt
local.properties
\ No newline at end of file
This diff is collapsed.
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
android:value="${JPUSH_CHANNEL}" /> android:value="${JPUSH_CHANNEL}" />
<activity <activity
android:name=".ui.activitys.SplashYlhActivity" android:name="com.mints.flowbox.ui.activitys.SplashGroMoreActivity"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:theme="@style/NormalSplash"> android:theme="@style/NormalSplash">
<intent-filter> <intent-filter>
...@@ -147,6 +147,9 @@ ...@@ -147,6 +147,9 @@
<activity android:name=".ui.activitys.Increasespeed2Activity" /> <activity android:name=".ui.activitys.Increasespeed2Activity" />
<activity android:name=".ui.activitys.IncreasespeedActivity" /> <activity android:name=".ui.activitys.IncreasespeedActivity" />
<activity android:name=".ui.activitys.BoostFastActivity" /> <activity android:name=".ui.activitys.BoostFastActivity" />
<activity android:name="com.mints.flowbox.ui.activitys.SplashGroMoreBackgroundActivity" />
<activity android:name="com.mints.flowbox.ui.activitys.RedboxEraseActivity" />
<activity <activity
android:name=".ui.activitys.ScreenActivity" android:name=".ui.activitys.ScreenActivity"
android:excludeFromRecents="true" android:excludeFromRecents="true"
...@@ -274,6 +277,7 @@ ...@@ -274,6 +277,7 @@
android:resource="@xml/ow_file_paths" /> android:resource="@xml/ow_file_paths" />
</provider> <!-- 常驻通知栏service --> </provider> <!-- 常驻通知栏service -->
<service android:name=".keepalive.NotificationService" /> <service android:name=".keepalive.NotificationService" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -47,8 +47,6 @@ import com.orhanobut.logger.AndroidLogAdapter; ...@@ -47,8 +47,6 @@ import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.FormatStrategy; import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger; import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy; import com.orhanobut.logger.PrettyFormatStrategy;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
import net.DebugConfig; import net.DebugConfig;
import net.analytics.AnalyticsLogger; import net.analytics.AnalyticsLogger;
...@@ -114,6 +112,7 @@ public class MintsApplication extends BaseApp { ...@@ -114,6 +112,7 @@ public class MintsApplication extends BaseApp {
System.out.println("mints ------------> umengConfig <------------"); System.out.println("mints ------------> umengConfig <------------");
// UmengHelper.init(this, channel); // UmengHelper.init(this, channel);
com.mints.flowbox.manager.UmengManager.INSTANCE.preInit();
} }
// TODO 这里可以设置外部模块的埋点统计功能 // TODO 这里可以设置外部模块的埋点统计功能
...@@ -265,7 +264,7 @@ public class MintsApplication extends BaseApp { ...@@ -265,7 +264,7 @@ public class MintsApplication extends BaseApp {
KeepAliveHelper.Companion.preInit(base, this, NotificationService.class); KeepAliveHelper.Companion.preInit(base, this, NotificationService.class);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前 // 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
androidPWebView(); // androidPWebView();
} }
/* /*
...@@ -281,26 +280,17 @@ public class MintsApplication extends BaseApp { ...@@ -281,26 +280,17 @@ public class MintsApplication extends BaseApp {
// 移动安全联盟 oaid // 移动安全联盟 oaid
initMiitHelper(); initMiitHelper();
// 优量汇
YlhAdManager.INSTANCE.initYlhAd(this);
// GroMore // GroMore
CsjGroMoreManager.INSTANCE.init(this); CsjGroMoreManager.INSTANCE.init(this);
// OneWay // OneWay
OwManager.INSTANCE.init(this); OwManager.INSTANCE.init(this);
// 穿山甲
TtCsjAdManager.init(this);
// 快手
KsManager.INSTANCE.initKs(this);
// 闪电盒子 // 闪电盒子
WnManager.INSTANCE.initWn(this); WnManager.INSTANCE.initWn(this);
// 枫岚广告 // 枫岚广告
MhManager.INSTANCE.initWn(this); // MhManager.INSTANCE.initWn(this);
// 天卓珊瑚 // 天卓珊瑚
TzManager.INSTANCE.initTz(this); TzManager.INSTANCE.initTz(this);
...@@ -329,6 +319,7 @@ public class MintsApplication extends BaseApp { ...@@ -329,6 +319,7 @@ public class MintsApplication extends BaseApp {
* 自定义logger * 自定义logger
*/ */
private void bindLogger() { private void bindLogger() {
try {
//自定义logger //自定义logger
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder() FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false) //是否选择显示线程信息,默认为true .showThreadInfo(false) //是否选择显示线程信息,默认为true
...@@ -338,6 +329,10 @@ public class MintsApplication extends BaseApp { ...@@ -338,6 +329,10 @@ public class MintsApplication extends BaseApp {
.tag("mints---network") //自定义TAG全部标签,默认PRETTY_LOGGER .tag("mints---network") //自定义TAG全部标签,默认PRETTY_LOGGER
.build(); .build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy)); Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
} catch (Exception e) {
e.printStackTrace();
LogUtil.e(e);
}
} }
private final MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids; private final MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
...@@ -355,23 +350,6 @@ public class MintsApplication extends BaseApp { ...@@ -355,23 +350,6 @@ public class MintsApplication extends BaseApp {
} }
} }
/**
* 友盟初始化
*/
public void initUm(Context context) {
try {
/*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(context, CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(context, "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
} catch (Exception e) {
e.printStackTrace();
}
}
/** /**
* app退出 * app退出
*/ */
......
...@@ -4,6 +4,7 @@ import android.view.View ...@@ -4,6 +4,7 @@ import android.view.View
import android.widget.FrameLayout import android.widget.FrameLayout
import com.bytedance.sdk.openadsdk.AdSlot import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdNative import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.bytedance.sdk.openadsdk.TTNativeExpressAd import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.manager.TtCsjAdManager import com.mints.flowbox.manager.TtCsjAdManager
...@@ -16,12 +17,14 @@ object BannerManager { ...@@ -16,12 +17,14 @@ object BannerManager {
private var adNative: TTAdNative? = null private var adNative: TTAdNative? = null
private var mTTAd: TTNativeExpressAd? = null private var mTTAd: TTNativeExpressAd? = null
private var frameLayout: FrameLayout? = null
fun init() { fun init() {
adNative = TtCsjAdManager.get().createAdNative(MintsApplication.getContext()) adNative = TTAdSdk.getAdManager().createAdNative(MintsApplication.getContext())
// TTAdSdk.getAdManager().createAdNative()
// 权限请求 // 权限请求
TtCsjAdManager.get().requestPermissionIfNecessary(MintsApplication.getContext()) // TtCsjAdManager.get().requestPermissionIfNecessary(MintsApplication.getContext())
} }
/** /**
...@@ -39,7 +42,7 @@ object BannerManager { ...@@ -39,7 +42,7 @@ object BannerManager {
* 获取穿山甲banner * 获取穿山甲banner
*/ */
fun getTtBanner(codeId: String, frameLayout: FrameLayout?) { fun getTtBanner(codeId: String, frameLayout: FrameLayout?) {
this.frameLayout = frameLayout
var expressViewAcceptedSizeWidth = getViewWidth() var expressViewAcceptedSizeWidth = getViewWidth()
var expressViewAcceptedSizeHeight = 0f var expressViewAcceptedSizeHeight = 0f
when (codeId) { when (codeId) {
...@@ -49,6 +52,7 @@ object BannerManager { ...@@ -49,6 +52,7 @@ object BannerManager {
} }
} }
// ToastUtil.showLong(MintsApplication.getContext(), "csj banner:$codeId")
adNative?.let { adNative?.let {
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
...@@ -63,9 +67,11 @@ object BannerManager { ...@@ -63,9 +67,11 @@ object BannerManager {
override fun onNativeExpressAdLoad(ads: MutableList<TTNativeExpressAd>?) { override fun onNativeExpressAdLoad(ads: MutableList<TTNativeExpressAd>?) {
if (ads == null || ads.size == 0) return if (ads == null || ads.size == 0) return
mTTAd = ads[0] BannerManager.frameLayout?.let {
bindAdListener(frameLayout) mTTAd = ads[0]
mTTAd?.render() bindAdListener()
mTTAd?.render()
}
} }
override fun onError(code: Int, msg: String) { override fun onError(code: Int, msg: String) {
...@@ -75,7 +81,7 @@ object BannerManager { ...@@ -75,7 +81,7 @@ object BannerManager {
} }
} }
private fun bindAdListener(frameLayout: FrameLayout?) { private fun bindAdListener() {
mTTAd?.let { mTTAd?.let {
it.setExpressInteractionListener(object : TTNativeExpressAd.ExpressAdInteractionListener { it.setExpressInteractionListener(object : TTNativeExpressAd.ExpressAdInteractionListener {
override fun onAdClicked(p0: View?, p1: Int) { override fun onAdClicked(p0: View?, p1: Int) {
...@@ -102,11 +108,12 @@ object BannerManager { ...@@ -102,11 +108,12 @@ object BannerManager {
} }
fun onDestroy() { fun onDestroy() {
frameLayout = null
mTTAd?.let { mTTAd?.let {
it.setExpressInteractionListener(null)
it.destroy() it.destroy()
mTTAd = null it.setExpressInteractionListener(null)
} }
mTTAd = null
adNative = null adNative = null
} }
} }
\ No newline at end of file
package com.mints.flowbox.ad.express
import android.widget.FrameLayout
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.manager.TtCsjAdManager
/**
* 能用信息流加载
*/
object ExpressManager {
fun loadExpress() {
if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
} else {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
}
}
fun getExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) {
return GroMoreCarrierExpressManager.instance.getADFrameLayout()
} else {
return TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout
}
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.kwad.sdk.api.* ...@@ -15,6 +15,7 @@ import com.kwad.sdk.api.*
import com.kwad.sdk.api.KsNativeAd.VideoPlayListener import com.kwad.sdk.api.KsNativeAd.VideoPlayListener
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.manager.ad.KsManager import com.mints.flowbox.manager.ad.KsManager
import com.mints.flowbox.utils.LogUtil import com.mints.flowbox.utils.LogUtil
import java.util.* import java.util.*
...@@ -36,12 +37,13 @@ object KsPreLoadExpressManager { ...@@ -36,12 +37,13 @@ object KsPreLoadExpressManager {
try { try {
var ksNativeAd: KsNativeAd? var ksNativeAd: KsNativeAd?
val scene = KsScene val scene = KsScene
.Builder(KsManager.KS_AD_NATIVEEXPRESS_AWARD) .Builder(KsManager.KS_AD_NATIVEEXPRESS_AWARD)
.adNum(1) .adNum(1)
.build() .build()
KsAdSDK.getLoadManager().loadNativeAd(scene, object : KsLoadManager.NativeAdListener { KsAdSDK.getLoadManager().loadNativeAd(scene, object : KsLoadManager.NativeAdListener {
override fun onError(p0: Int, p1: String?) { override fun onError(p0: Int, p1: String?) {
LogUtil.d("$p0 -> $p1") LogUtil.d("$p0 -> $p1")
AppConfig.isPreExpressAwardActivity=false
} }
override fun onNativeAdLoad(p0: MutableList<KsNativeAd>?) { override fun onNativeAdLoad(p0: MutableList<KsNativeAd>?) {
...@@ -51,6 +53,7 @@ object KsPreLoadExpressManager { ...@@ -51,6 +53,7 @@ object KsPreLoadExpressManager {
}) })
} catch (e: Exception) { } catch (e: Exception) {
AppConfig.isPreExpressAwardActivity=false
e.printStackTrace() e.printStackTrace()
} }
} }
...@@ -83,8 +86,7 @@ object KsPreLoadExpressManager { ...@@ -83,8 +86,7 @@ object KsPreLoadExpressManager {
* 使用SDK渲染的播放控件 * 使用SDK渲染的播放控件
*/ */
private fun getVideoItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getVideoItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_video, parent, false)
LayoutInflater.from(mContext).inflate(R.layout.native_item_video, parent, false)
val videoViewHolder = AdVideoViewHolder(convertView) val videoViewHolder = AdVideoViewHolder(convertView)
// 设置广告数据 // 设置广告数据
...@@ -104,9 +106,9 @@ object KsPreLoadExpressManager { ...@@ -104,9 +106,9 @@ object KsPreLoadExpressManager {
// SDK默认渲染的视频view // SDK默认渲染的视频view
val videoPlayConfig = KsAdVideoPlayConfig.Builder() val videoPlayConfig = KsAdVideoPlayConfig.Builder()
.videoSoundEnable(true) // 有声播放 .videoSoundEnable(true) // 有声播放
.dataFlowAutoStart(false) // 流量下自动播放 .dataFlowAutoStart(false) // 流量下自动播放
.build() .build()
val videoView = ksNativeAd.getVideoView(mContext, videoPlayConfig) val videoView = ksNativeAd.getVideoView(mContext, videoPlayConfig)
if (videoView != null && videoView.parent == null) { if (videoView != null && videoView.parent == null) {
videoViewHolder.mAdVideoContainer.removeAllViews() videoViewHolder.mAdVideoContainer.removeAllViews()
...@@ -119,8 +121,7 @@ object KsPreLoadExpressManager { ...@@ -119,8 +121,7 @@ object KsPreLoadExpressManager {
* 自定义的单图广告 * 自定义的单图广告
*/ */
private fun getSingleImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getSingleImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_single_image, parent, false)
LayoutInflater.from(mContext).inflate(R.layout.native_item_single_image, parent, false)
val viewHolder = AdSingleImageViewHolder(convertView) val viewHolder = AdSingleImageViewHolder(convertView)
bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd) bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd)
...@@ -138,8 +139,7 @@ object KsPreLoadExpressManager { ...@@ -138,8 +139,7 @@ object KsPreLoadExpressManager {
* 自定义的组图广告 * 自定义的组图广告
*/ */
private fun getGroupImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getGroupImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_group_image, parent, false)
LayoutInflater.from(mContext).inflate(R.layout.native_item_group_image, parent, false)
val viewHolder = AdGroupImageViewHolder(convertView) val viewHolder = AdGroupImageViewHolder(convertView)
bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd) bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd)
...@@ -168,17 +168,14 @@ object KsPreLoadExpressManager { ...@@ -168,17 +168,14 @@ object KsPreLoadExpressManager {
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
private fun getNormalItemView(parent: ViewGroup): View? { private fun getNormalItemView(parent: ViewGroup): View? {
val convertView: View = val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_normal, parent, false)
LayoutInflater.from(mContext).inflate(R.layout.native_item_normal, parent, false)
val normalViewHolder = NormalViewHolder(convertView) val normalViewHolder = NormalViewHolder(convertView)
normalViewHolder.textView.text = "没有广告" normalViewHolder.textView.text = "没有广告"
return convertView return convertView
} }
private fun bindCommonData( private fun bindCommonData(convertView: ViewGroup, adBaseViewHolder: AdBaseViewHolder,
convertView: ViewGroup, adBaseViewHolder: AdBaseViewHolder, ad: KsNativeAd) {
ad: KsNativeAd
) {
// 点击转换view的集合,传入的view点击时会触发转换操作:app下载, 打开h5页面 // 点击转换view的集合,传入的view点击时会触发转换操作:app下载, 打开h5页面
val clickViewList: MutableList<View> = ArrayList() val clickViewList: MutableList<View> = ArrayList()
clickViewList.add(convertView) // 点击整个view都可触发转换 clickViewList.add(convertView) // 点击整个view都可触发转换
...@@ -187,23 +184,23 @@ object KsPreLoadExpressManager { ...@@ -187,23 +184,23 @@ object KsPreLoadExpressManager {
// 注册View的点击,点击后触发转化 // 注册View的点击,点击后触发转化
ad.registerViewForInteraction(convertView, clickViewList, ad.registerViewForInteraction(convertView, clickViewList,
object : KsNativeAd.AdInteractionListener { object : KsNativeAd.AdInteractionListener {
override fun onAdClicked(view: View, ad: KsNativeAd) { override fun onAdClicked(view: View, ad: KsNativeAd) {
if (ad != null) { if (ad != null) {
// Toast.makeText(WenshuApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show() // Toast.makeText(MintsApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show()
}
} }
}
override fun onAdShow(ad: KsNativeAd) { override fun onAdShow(ad: KsNativeAd) {
if (ad != null) { if (ad != null) {
// Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show() // Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show()
}
} }
}
override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean { override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean {
TODO("Not yet implemented") return false
} }
}) })
// 广告描述 // 广告描述
adBaseViewHolder.mAdDes.text = ad.adDescription adBaseViewHolder.mAdDes.text = ad.adDescription
...@@ -236,8 +233,7 @@ object KsPreLoadExpressManager { ...@@ -236,8 +233,7 @@ object KsPreLoadExpressManager {
adBaseViewHolder.mAppIcon.visibility = View.GONE adBaseViewHolder.mAppIcon.visibility = View.GONE
} else { } else {
adBaseViewHolder.mAppIcon.visibility = View.VISIBLE adBaseViewHolder.mAppIcon.visibility = View.VISIBLE
Glide.with(MintsApplication.getContext()).load(ad.appIconUrl) Glide.with(MintsApplication.getContext()).load(ad.appIconUrl).into(adBaseViewHolder.mAppIcon)
.into(adBaseViewHolder.mAppIcon)
} }
// app名称 // app名称
if (!TextUtils.isEmpty(ad.appName)) { if (!TextUtils.isEmpty(ad.appName)) {
......
...@@ -15,9 +15,7 @@ import java.util.* ...@@ -15,9 +15,7 @@ import java.util.*
/** /**
* 预加载信息流管理类 * 预加载信息流管理类
*/ */
@SuppressLint("StaticFieldLeak") object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener, GMADLoadSuccessListener {
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener,
KSADLoadSuccessListener, GMADLoadSuccessListener {
private val TAG = PreLoadExpressManager::class.java.simpleName private val TAG = PreLoadExpressManager::class.java.simpleName
...@@ -64,8 +62,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -64,8 +62,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// } // }
when (getRandomWeight()) { when (getRandomWeight()) {
Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance() Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout)
.loadTtFrameLayout(mAdFrameLayout)
Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout() Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout()
Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup) Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup)
Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout() Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout()
...@@ -138,6 +135,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -138,6 +135,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 1) { // if (currentIndex == 1) {
// mAdFrameLayout = adFrameLayout // mAdFrameLayout = adFrameLayout
// } // }
if(view!=null){
AppConfig.isPreExpressAwardActivity=true
}
mAdFrameLayout = view mAdFrameLayout = view
} }
...@@ -145,6 +145,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -145,6 +145,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 2) { // if (currentIndex == 2) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){
AppConfig.isPreExpressAwardActivity=true
}
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
...@@ -152,6 +155,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -152,6 +155,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 3) { // if (currentIndex == 3) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){
AppConfig.isPreExpressAwardActivity=true
}
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
...@@ -159,6 +165,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -159,6 +165,9 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 3) { // if (currentIndex == 3) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){
AppConfig.isPreExpressAwardActivity=true
}
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
......
...@@ -106,7 +106,7 @@ public class TTPreLoadCarrierExpressManager { ...@@ -106,7 +106,7 @@ public class TTPreLoadCarrierExpressManager {
public void loadTtFrameLayout(String codeId) { public void loadTtFrameLayout(String codeId) {
init(); init();
// ToastUtil.showLong(WenshuApplication.getContext(), "通用信息流:" + codeId); // ToastUtil.showLong(MintsApplication.getContext(), "通用信息流:" + codeId);
if (mWorkHandler != null) { if (mWorkHandler != null) {
Message msg = Message.obtain(); Message msg = Message.obtain();
......
...@@ -4,7 +4,7 @@ import android.util.DisplayMetrics; ...@@ -4,7 +4,7 @@ import android.util.DisplayMetrics;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.mints.flowbox.MintsApplication; import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.common.AppConfig; import com.mints.flowbox.ad.express.TTADLoadSuccessListener;import com.mints.flowbox.common.AppConfig;
import com.mints.flowbox.manager.TTNativeExpressManager; import com.mints.flowbox.manager.TTNativeExpressManager;
import com.mints.flowbox.manager.TtCsjAdManager; import com.mints.flowbox.manager.TtCsjAdManager;
...@@ -62,6 +62,7 @@ public class TTPreLoadExpressManager { ...@@ -62,6 +62,7 @@ public class TTPreLoadExpressManager {
} }
} }
} catch (Exception e) { } catch (Exception e) {
AppConfig.isPreExpressAwardActivity=false;
e.printStackTrace(); e.printStackTrace();
} }
}); });
......
package com.mints.flowbox.ad.express package com.mints.flowbox.ad.express
import com.qq.e.ads.nativ.express2.*
import com.qq.e.comm.util.AdError import com.qq.e.comm.util.AdError
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.manager.ad.YlhAdManager import com.mints.flowbox.manager.ad.YlhAdManager
import com.mints.flowbox.utils.LogUtil
import com.qq.e.ads.nativ.ADSize import com.qq.e.ads.nativ.ADSize
import com.qq.e.ads.nativ.NativeExpressAD import com.qq.e.ads.nativ.NativeExpressAD
import com.qq.e.ads.nativ.NativeExpressADView import com.qq.e.ads.nativ.NativeExpressADView
/** /**
* 优量汇预加载信息流 * 优量汇预加载信息流
*/ */
...@@ -23,55 +27,54 @@ object YlhPreLoadExpressManager { ...@@ -23,55 +27,54 @@ object YlhPreLoadExpressManager {
fun loadYlhFrameLayout() { fun loadYlhFrameLayout() {
try { try {
nativeExpressAD = NativeExpressAD( nativeExpressAD = NativeExpressAD(MintsApplication.getContext(), ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, object : NativeExpressAD.NativeExpressADListener {
MintsApplication.getContext(), override fun onNoAD(p0: AdError?) {
ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), AppConfig.isPreExpressAwardActivity=false
YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, }
object : NativeExpressAD.NativeExpressADListener {
override fun onNoAD(p0: AdError?) {
}
override fun onADClicked(p0: NativeExpressADView?) { override fun onADClicked(p0: NativeExpressADView?) {
} }
override fun onADCloseOverlay(p0: NativeExpressADView?) { override fun onADCloseOverlay(p0: NativeExpressADView?) {
} }
override fun onADClosed(p0: NativeExpressADView?) { override fun onADClosed(p0: NativeExpressADView?) {
} }
override fun onADExposure(p0: NativeExpressADView?) { override fun onADExposure(p0: NativeExpressADView?) {
} }
override fun onADLeftApplication(p0: NativeExpressADView?) { override fun onADLeftApplication(p0: NativeExpressADView?) {
} }
override fun onADLoaded(p0: MutableList<NativeExpressADView>?) { override fun onADLoaded(p0: MutableList<NativeExpressADView>?) {
// 释放前一个展示的NativeExpressADView的资源 // 释放前一个展示的NativeExpressADView的资源
nativeExpressADView?.destroy() nativeExpressADView?.destroy()
nativeExpressADView = p0?.get(0) nativeExpressADView = p0?.get(0)
// 广告可见才会产生曝光,否则将无法产生收益。 // 广告可见才会产生曝光,否则将无法产生收益。
mADLoadSuccessListener?.onYlhAdLoadSuc(nativeExpressADView) mADLoadSuccessListener?.onYlhAdLoadSuc(nativeExpressADView)
nativeExpressADView?.render() nativeExpressADView?.render()
} }
override fun onADOpenOverlay(p0: NativeExpressADView?) { override fun onADOpenOverlay(p0: NativeExpressADView?) {
} }
override fun onRenderFail(p0: NativeExpressADView?) { override fun onRenderFail(p0: NativeExpressADView?) {
} AppConfig.isPreExpressAwardActivity=false
}
override fun onRenderSuccess(p0: NativeExpressADView?) { override fun onRenderSuccess(p0: NativeExpressADView?) {
} }
}) })
nativeExpressAD?.loadAD(1) nativeExpressAD?.loadAD(1)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
AppConfig.isPreExpressAwardActivity=false
} }
} }
......
...@@ -7,6 +7,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant; ...@@ -7,6 +7,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdNative; import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk; import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd; import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.ad.video.base.BaseVideoAd; import com.mints.flowbox.ad.video.base.BaseVideoAd;
import com.mints.flowbox.ad.video.base.VideoAdStatusListener; import com.mints.flowbox.ad.video.base.VideoAdStatusListener;
import com.mints.flowbox.common.Constant; import com.mints.flowbox.common.Constant;
...@@ -18,8 +19,6 @@ import com.mints.flowbox.manager.TtCsjAdManager; ...@@ -18,8 +19,6 @@ import com.mints.flowbox.manager.TtCsjAdManager;
*/ */
public class CsjFullVideoAdManager extends BaseVideoAd { public class CsjFullVideoAdManager extends BaseVideoAd {
private static CsjFullVideoAdManager _inst;
private VideoAdStatusListener videoAdStatusListener; private VideoAdStatusListener videoAdStatusListener;
Activity activity; Activity activity;
...@@ -28,20 +27,12 @@ public class CsjFullVideoAdManager extends BaseVideoAd { ...@@ -28,20 +27,12 @@ public class CsjFullVideoAdManager extends BaseVideoAd {
private boolean isClickScreen = true; // 是否点击屏幕跳转广告 private boolean isClickScreen = true; // 是否点击屏幕跳转广告
public static CsjFullVideoAdManager getInstance(Activity activity) { public CsjFullVideoAdManager() {
if (_inst == null) { init();
_inst = new CsjFullVideoAdManager(activity);
}
return _inst;
} }
private CsjFullVideoAdManager(Activity activity) { private void init() {
init(activity); ttAdNative = TTAdSdk.getAdManager().createAdNative(MintsApplication.getContext());
}
private void init(Activity activity) {
this.activity = activity;
ttAdNative = TTAdSdk.getAdManager().createAdNative(activity);
} }
/** /**
......
...@@ -8,11 +8,13 @@ import com.bytedance.sdk.openadsdk.TTAdNative; ...@@ -8,11 +8,13 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener; import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd; import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.mints.flowbox.BuildConfig; import com.mints.flowbox.BuildConfig;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.ad.code.CsjCode; import com.mints.flowbox.ad.code.CsjCode;
import com.mints.flowbox.ad.video.base.BaseVideoAd; import com.mints.flowbox.ad.video.base.BaseVideoAd;
import com.mints.flowbox.ad.video.base.VideoAdStatusListener; 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.AppPreferencesManager;
import com.mints.flowbox.manager.TTNativeExpressManager; import com.mints.flowbox.manager.TTNativeExpressManager;
import com.mints.flowbox.manager.TrackManager; import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.TtCsjAdManager; import com.mints.flowbox.manager.TtCsjAdManager;
...@@ -21,7 +23,6 @@ import com.mints.flowbox.utils.LogUtil; ...@@ -21,7 +23,6 @@ import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.MD5; import com.mints.flowbox.utils.MD5;
import com.mints.library.utils.json.JsonUtil; import com.mints.library.utils.json.JsonUtil;
import net.grandcentrix.tray.AppPreferences;
import java.util.HashMap; import java.util.HashMap;
...@@ -30,8 +31,6 @@ import java.util.HashMap; ...@@ -30,8 +31,6 @@ import java.util.HashMap;
*/ */
public class CsjVideoAdManager extends BaseVideoAd { public class CsjVideoAdManager extends BaseVideoAd {
private static CsjVideoAdManager _inst;
private AppPreferences ps;
private int curCoin; private int curCoin;
private String extraId; private String extraId;
private VideoAdStatusListener videoAdStatusListener; private VideoAdStatusListener videoAdStatusListener;
...@@ -43,20 +42,11 @@ public class CsjVideoAdManager extends BaseVideoAd { ...@@ -43,20 +42,11 @@ public class CsjVideoAdManager extends BaseVideoAd {
private boolean isClickScreen = true; // 是否点击屏幕跳转广告 private boolean isClickScreen = true; // 是否点击屏幕跳转广告
public static CsjVideoAdManager getInstance(Activity activity) { public CsjVideoAdManager() {
if (_inst == null) { init();
_inst = new CsjVideoAdManager(activity);
}
return _inst;
}
private CsjVideoAdManager(Activity activity) {
init(activity);
} }
private void init(Activity activity) { private void init() {
this.activity = activity;
ps = new AppPreferences(activity);
userManager = UserManager.getInstance(); userManager = UserManager.getInstance();
TTNativeExpressManager ttNativeExpressManager = new TTNativeExpressManager(); TTNativeExpressManager ttNativeExpressManager = new TTNativeExpressManager();
...@@ -68,7 +58,6 @@ public class CsjVideoAdManager extends BaseVideoAd { ...@@ -68,7 +58,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
if (mttRewardVideoAd != null) { if (mttRewardVideoAd != null) {
mttRewardVideoAd.setRewardAdInteractionListener(null); mttRewardVideoAd.setRewardAdInteractionListener(null);
} }
ps = null;
activity = null; activity = null;
} }
...@@ -263,10 +252,7 @@ public class CsjVideoAdManager extends BaseVideoAd { ...@@ -263,10 +252,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
vo.put("adtype", Constant.ADTYPE_VEDIO); vo.put("adtype", Constant.ADTYPE_VEDIO);
vo.put("tid", tid); vo.put("tid", tid);
vo.put("adsource", Constant.AD_SOURCE_CSJ); vo.put("adsource", Constant.AD_SOURCE_CSJ);
if (ps == null) { vo.put("ip", AppPreferencesManager.INSTANCE.get().getString(Constant.CSJ_VEDIO_APPIP, ""));
ps = new AppPreferences(activity);
}
vo.put("ip", ps.getString(Constant.CSJ_VEDIO_APPIP, ""));
switch (carrierType) { switch (carrierType) {
case Constant.CARRIER_VERSUS_VIDEO:// 每日任务-视频 case Constant.CARRIER_VERSUS_VIDEO:// 每日任务-视频
......
...@@ -9,37 +9,26 @@ import com.mints.flowbox.ad.video.base.BaseVideoAd ...@@ -9,37 +9,26 @@ import com.mints.flowbox.ad.video.base.BaseVideoAd
import com.mints.flowbox.ad.video.base.VideoAdStatusListener 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.ad.KsManager
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.manager.ad.KsManager
import com.mints.flowbox.utils.LogUtil import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.ToastUtil
private val TAG = KsVideoAdManager::class.java.simpleName private val TAG = KsVideoAdManager::class.java.simpleName
/** /**
* 快手广告视频 * 快手广告视频
*/ */
class KsVideoAdManager private constructor() : class KsVideoAdManager public constructor() :
BaseVideoAd() { BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null private var videoAdStatusListener: VideoAdStatusListener? = null
private var mRewardVideoAd: KsRewardVideoAd? = null private var mRewardVideoAd: KsRewardVideoAd? = null
private var activity: Activity? = null
private var isClickScreen: Boolean = true private var isClickScreen: Boolean = true
companion object {
private var _inst: KsVideoAdManager? = null
fun getInstance(): KsVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = KsVideoAdManager()
_inst
}
}
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) { override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
this.activity=activity
isClickScreen = true isClickScreen = true
val scene = KsScene.Builder(KsManager.KS_AD_VEDIO_POSTID).build() val scene = KsScene.Builder(KsManager.KS_AD_VEDIO_POSTID).build()
...@@ -47,14 +36,10 @@ class KsVideoAdManager private constructor() : ...@@ -47,14 +36,10 @@ class KsVideoAdManager private constructor() :
override fun onError(p0: Int, p1: String?) { override fun onError(p0: Int, p1: String?) {
videoAdStatusListener?.adFail() videoAdStatusListener?.adFail()
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_KS, Constant.EVENT_TYPE_ONE, p0.toString(), p1) TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_KS, Constant.EVENT_TYPE_ONE, p0.toString(), p1)
ToastUtil.showLong(activity,"快手 onError: code->${p0.toString()} msg->${p1}") // ToastUtil.showLong(activity,"快手 onError: code->${p0.toString()} msg->${p1}")
LogUtil.d(p1) LogUtil.d(p1)
} }
override fun onRequestResult(p0: Int) {
TODO("Not yet implemented")
}
override fun onRewardVideoAdLoad(p0: MutableList<KsRewardVideoAd>?) { override fun onRewardVideoAdLoad(p0: MutableList<KsRewardVideoAd>?) {
mRewardVideoAd = p0?.get(0) mRewardVideoAd = p0?.get(0)
if (mRewardVideoAd != null && mRewardVideoAd!!.isAdEnable) { if (mRewardVideoAd != null && mRewardVideoAd!!.isAdEnable) {
...@@ -116,6 +101,8 @@ class KsVideoAdManager private constructor() : ...@@ -116,6 +101,8 @@ class KsVideoAdManager private constructor() :
} }
} }
override fun onRequestResult(p0: Int) {}
}) })
...@@ -128,5 +115,6 @@ class KsVideoAdManager private constructor() : ...@@ -128,5 +115,6 @@ class KsVideoAdManager private constructor() :
override fun onDestroy() { override fun onDestroy() {
mRewardVideoAd = null mRewardVideoAd = null
activity=null
} }
} }
\ No newline at end of file
...@@ -6,8 +6,8 @@ import com.mints.flowbox.ad.video.base.BaseVideoAd ...@@ -6,8 +6,8 @@ import com.mints.flowbox.ad.video.base.BaseVideoAd
import com.mints.flowbox.ad.video.base.VideoAdStatusListener 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.ad.MhManager
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.manager.ad.MhManager
import com.mints.flowbox.utils.LogUtil import com.mints.flowbox.utils.LogUtil
private val TAG = MhVideoAdManager::class.java.simpleName private val TAG = MhVideoAdManager::class.java.simpleName
...@@ -15,29 +15,19 @@ private val TAG = MhVideoAdManager::class.java.simpleName ...@@ -15,29 +15,19 @@ private val TAG = MhVideoAdManager::class.java.simpleName
/** /**
* 枫岚广告视频 * 枫岚广告视频
*/ */
class MhVideoAdManager private constructor() : class MhVideoAdManager public constructor() :
BaseVideoAd() { BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null private var videoAdStatusListener: VideoAdStatusListener? = null
private var mRewardVideoAd: RewardVideoAd? = null private var mRewardVideoAd: RewardVideoAd? = null
private var isClickScreen: Boolean = true private var isClickScreen: Boolean = true
private var activity: Activity? = null
companion object {
private var _inst: MhVideoAdManager? = null
fun getInstance(): MhVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = MhVideoAdManager()
_inst
}
}
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) { override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true isClickScreen = true
this.activity=activity
val postId: String = when (carrierType) { val postId: String = when (carrierType) {
Constant.CARRIER_VERSUS_VIDEO -> MhManager.POS_ID Constant.CARRIER_VERSUS_VIDEO -> MhManager.POS_ID
Constant.CARRIER_HOMEWATER -> MhManager.POS_ID Constant.CARRIER_HOMEWATER -> MhManager.POS_ID
...@@ -112,5 +102,6 @@ class MhVideoAdManager private constructor() : ...@@ -112,5 +102,6 @@ class MhVideoAdManager private constructor() :
override fun onDestroy() { override fun onDestroy() {
mRewardVideoAd = null mRewardVideoAd = null
activity=null
} }
} }
\ No newline at end of file
package com.mints.flowbox.ad.video
import android.app.Activity
import com.mints.flowbox.ad.video.base.BaseVideoAd
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.manager.ad.OwManager
import com.mints.flowbox.utils.LogUtil
import mobi.oneway.export.Ad.OWRewardedAd
import mobi.oneway.export.AdListener.OWRewardedAdListener
import mobi.oneway.export.enums.OnewayAdCloseType
import mobi.oneway.export.enums.OnewaySdkError
private val TAG = OwVideoAdManager::class.java.simpleName
/**
* OneWay广告视频
*/
class OwVideoAdManager public constructor() :
BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null
private var owRewardedAd: OWRewardedAd? = null
private var isClickScreen: Boolean = true
private var activity: Activity? = null
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true
this.activity=activity
//创建激励视频事件监听器
val owRewardedAdListener: OWRewardedAdListener = object : OWRewardedAdListener {
override fun onAdReady() {
owRewardedAd?.show(activity)
}
override fun onAdShow(tag: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ZERO, "", "")
}
override fun onAdClick(tag: String) {
if (AppConfig.needReportClickAdEvent) {
TrackManager.getInstance().reportClickAdEvent()
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_TWO, "", "")
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_FOUR, "", "")
isClickScreen = false
}
videoAdStatusListener?.adDownload()
}
override fun onAdClose(tag: String, onewayVideoCloseType: OnewayAdCloseType) {
TrackManager.getInstance().reportAddCoinMsg(activity, getAdMapVO(carrierType, Constant.AD_SOURCE_OW, extraId, curCoin))
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_THREE, "", "")
videoAdStatusListener?.adSuccess()
}
override fun onAdFinish(s: String, onewayAdCloseType: OnewayAdCloseType, s1: String) {
}
override fun onSdkError(onewaySdkError: OnewaySdkError, msg: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ONE, "999999","emun:"+onewaySdkError.name+"msg:"+ msg)
LogUtil.d(TAG, "onADError->$msg")
videoAdStatusListener?.adFail()
}
}
//创建激励视频对象
owRewardedAd = OWRewardedAd(activity, OwManager.REWARD_PID, owRewardedAdListener)
owRewardedAd?.loadAd()
}
fun setVideoAdStatusListener(videoAdStatusListener: VideoAdStatusListener?) {
this.videoAdStatusListener = videoAdStatusListener
}
override fun onDestroy() {
owRewardedAd?.destory()
owRewardedAd = null
activity=null
}
}
\ No newline at end of file
...@@ -3,10 +3,12 @@ package com.mints.flowbox.ad.video ...@@ -3,10 +3,12 @@ package com.mints.flowbox.ad.video
import android.app.Activity import android.app.Activity
import android.text.TextUtils import android.text.TextUtils
import androidx.annotation.Nullable import androidx.annotation.Nullable
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.ad.video.base.BaseVideoAd import com.mints.flowbox.ad.video.base.BaseVideoAd
import com.mints.flowbox.ad.video.base.VideoAdStatusListener 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.AppPreferencesManager
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.manager.UserManager import com.mints.flowbox.manager.UserManager
import com.mints.flowbox.utils.LogUtil import com.mints.flowbox.utils.LogUtil
...@@ -18,20 +20,20 @@ import com.tz.sdk.core.ad.ADError ...@@ -18,20 +20,20 @@ import com.tz.sdk.core.ad.ADError
import com.tz.sdk.core.ad.ADSource import com.tz.sdk.core.ad.ADSource
import com.tz.sdk.core.ad.ADType import com.tz.sdk.core.ad.ADType
import com.tz.sdk.core.loader.ADLoader import com.tz.sdk.core.loader.ADLoader
import net.grandcentrix.tray.AppPreferences
private val TAG = ShVideoAdManager::class.java.simpleName private val TAG = ShVideoAdManager::class.java.simpleName
/** /**
* 天卓珊瑚广告视频 * 天卓珊瑚广告视频
*/ */
class ShVideoAdManager private constructor(activity: Activity) : class ShVideoAdManager public constructor() :
BaseVideoAd() { BaseVideoAd() {
private var isClickScreen: Boolean = true private var isClickScreen: Boolean = true
private var activity: Activity? = null
private var videoAdStatusListener: VideoAdStatusListener? = null private var videoAdStatusListener: VideoAdStatusListener? = null
private lateinit var ps: AppPreferences
companion object { companion object {
...@@ -43,28 +45,18 @@ class ShVideoAdManager private constructor(activity: Activity) : ...@@ -43,28 +45,18 @@ class ShVideoAdManager private constructor(activity: Activity) :
const val TZ_REWRAD_TYPE_DEBUG = 131 const val TZ_REWRAD_TYPE_DEBUG = 131
const val TZ_REWRAD_TYPE_RELEASE = 104 const val TZ_REWRAD_TYPE_RELEASE = 104
private var _inst: ShVideoAdManager? = null
fun getInstance(activity: Activity): ShVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = ShVideoAdManager(activity)
_inst
}
}
} }
init { init {
init(activity) init()
} }
private fun init(activity: Activity) { private fun init() {
ps = AppPreferences(activity)
} }
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) { override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true isClickScreen = true
this.activity=activity
val type = TZ_REWRAD_TYPE_RELEASE val type = TZ_REWRAD_TYPE_RELEASE
// val type = if (BuildConfig.DEBUG) { // val type = if (BuildConfig.DEBUG) {
...@@ -180,7 +172,7 @@ class ShVideoAdManager private constructor(activity: Activity) : ...@@ -180,7 +172,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
vo["adtype"] = Constant.ADTYPE_VEDIO vo["adtype"] = Constant.ADTYPE_VEDIO
vo["tid"] = MD5.GetMD5Code(System.currentTimeMillis().toString() + UserManager.getInstance().userID) vo["tid"] = MD5.GetMD5Code(System.currentTimeMillis().toString() + UserManager.getInstance().userID)
vo["ip"] = ps.getString(Constant.CSJ_VEDIO_APPIP, "")!! vo["ip"] = AppPreferencesManager.get().getString(Constant.CSJ_VEDIO_APPIP, "")!!
when (carrierType) { when (carrierType) {
Constant.CARRIER_VERSUS_VIDEO -> vo["coin"] = curCoin Constant.CARRIER_VERSUS_VIDEO -> vo["coin"] = curCoin
Constant.CARRIER_HOMEWATER -> vo["waterCoin"] = curCoin Constant.CARRIER_HOMEWATER -> vo["waterCoin"] = curCoin
......
...@@ -15,29 +15,19 @@ private val TAG = WnVideoAdManager::class.java.simpleName ...@@ -15,29 +15,19 @@ private val TAG = WnVideoAdManager::class.java.simpleName
/** /**
* 闪电盒子视频 * 闪电盒子视频
*/ */
class WnVideoAdManager private constructor() : class WnVideoAdManager public constructor() :
BaseVideoAd() { BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null private var videoAdStatusListener: VideoAdStatusListener? = null
private var mRewardVideoAd: WNRewardVideoAd? = null private var mRewardVideoAd: WNRewardVideoAd? = null
private var isClickScreen: Boolean = true private var isClickScreen: Boolean = true
private var activity: Activity? = null
companion object {
private var _inst: WnVideoAdManager? = null
fun getInstance(): WnVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = WnVideoAdManager()
_inst
}
}
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) { override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true isClickScreen = true
this.activity=activity
val postId: String = when (carrierType) { val postId: String = when (carrierType) {
Constant.CARRIER_VERSUS_VIDEO -> WnManager.WN_AD_VEDIO_MAIN_POSTID Constant.CARRIER_VERSUS_VIDEO -> WnManager.WN_AD_VEDIO_MAIN_POSTID
Constant.CARRIER_HOMEWATER -> WnManager.WN_AD_VEDIO_DRINK_POSTID Constant.CARRIER_HOMEWATER -> WnManager.WN_AD_VEDIO_DRINK_POSTID
...@@ -52,7 +42,7 @@ class WnVideoAdManager private constructor() : ...@@ -52,7 +42,7 @@ class WnVideoAdManager private constructor() :
WNAdSdk.getAdManager().loadRewardVideoAd(slot, object : WNRewardVideoAd.RewardVideoAdListener { WNAdSdk.getAdManager().loadRewardVideoAd(slot, object : WNRewardVideoAd.RewardVideoAdListener {
override fun onError(code: Int, message: String) { override fun onError(code: Int, message: String) {
LogUtil.d(TAG, "onError $code:$message") LogUtil.d(TAG, "onError ${code}:${message}")
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_SDHZ, Constant.EVENT_TYPE_ONE, (code).toString(), message) TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_SDHZ, Constant.EVENT_TYPE_ONE, (code).toString(), message)
...@@ -121,5 +111,6 @@ class WnVideoAdManager private constructor() : ...@@ -121,5 +111,6 @@ class WnVideoAdManager private constructor() :
it.interactionListener = null it.interactionListener = null
} }
mRewardVideoAd = null mRewardVideoAd = null
activity=null
} }
} }
\ No newline at end of file
...@@ -22,7 +22,6 @@ import java.util.Map; ...@@ -22,7 +22,6 @@ import java.util.Map;
*/ */
public class YlhVideoAdManager extends BaseVideoAd { public class YlhVideoAdManager extends BaseVideoAd {
private static YlhVideoAdManager _inst;
// 优量汇激励视频 // 优量汇激励视频
private RewardVideoAD rewardVideoAD; private RewardVideoAD rewardVideoAD;
...@@ -30,17 +29,12 @@ public class YlhVideoAdManager extends BaseVideoAd { ...@@ -30,17 +29,12 @@ public class YlhVideoAdManager extends BaseVideoAd {
private VideoAdStatusListener videoAdStatusListener; private VideoAdStatusListener videoAdStatusListener;
private boolean isClickScreen = true; // 是否点击屏幕跳转广告 private boolean isClickScreen = true; // 是否点击屏幕跳转广告
private Activity activity;
public static YlhVideoAdManager getInstance() {
if (_inst == null) {
_inst = new YlhVideoAdManager();
}
return _inst;
}
@Override @Override
public void onDestroy() { public void onDestroy() {
rewardVideoAD = null; rewardVideoAD = null;
activity = null;
} }
/** /**
...@@ -48,6 +42,7 @@ public class YlhVideoAdManager extends BaseVideoAd { ...@@ -48,6 +42,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
*/ */
@Override @Override
public void loadAd(Activity activity, int curCoin, String carrierType, String extraId) { public void loadAd(Activity activity, int curCoin, String carrierType, String extraId) {
this.activity = activity;
isClickScreen = true; isClickScreen = true;
......
...@@ -96,6 +96,10 @@ public class AppConfig { ...@@ -96,6 +96,10 @@ public class AppConfig {
* gromore 剩余广告播放数 * gromore 剩余广告播放数
*/ */
public static int groMoreVideoAdCount = 0; public static int groMoreVideoAdCount = 0;
/**
* owVideo 剩余广告播放数
*/
public static int owVideoAdCount = 0;
/** /**
* 高额试玩任务标识 * 高额试玩任务标识
...@@ -158,4 +162,23 @@ public class AppConfig { ...@@ -158,4 +162,23 @@ public class AppConfig {
* 首页Banner展示金额 * 首页Banner展示金额
*/ */
public static String HOME_BANNER_SIGN_GIVECASH = "20"; public static String HOME_BANNER_SIGN_GIVECASH = "20";
/*
* 高额任务和超级翻倍 csjVideo 剩余广告播放数
*/
public static int csjHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ylhVideo 剩余广告播放数
*/
public static int ylhHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ksVideo 剩余广告播放数
*/
public static int ksHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 groVideo 剩余广告播放数
*/
public static int groHighVideoAdCount = 0;
} }
...@@ -95,6 +95,7 @@ object Constant { ...@@ -95,6 +95,7 @@ object Constant {
const val CARRIER_OFFLINE_DOUBLE = "OFFLINE_DOUBLE" //离线收益 const val CARRIER_OFFLINE_DOUBLE = "OFFLINE_DOUBLE" //离线收益
const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //刮刮乐 const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //刮刮乐
const val CARRIER_GAME = "GAME" //游戏 const val CARRIER_GAME = "GAME" //游戏
const val CARRIER_TURN_VEDIOCHALLENGE = "TURN_VEDIOCHALLENGE" //大转盘刮刮乐
const val CARRIER_HOMEWATER = "HOMEWATER" //喝水 const val CARRIER_HOMEWATER = "HOMEWATER" //喝水
const val CARRIER_WALK = "WALK" //走路 const val CARRIER_WALK = "WALK" //走路
const val CARRIER_EATMEAL = "EATMEAL" // 打卡 const val CARRIER_EATMEAL = "EATMEAL" // 打卡
...@@ -145,6 +146,8 @@ object Constant { ...@@ -145,6 +146,8 @@ object Constant {
const val AD_SOURCE_CSJFULL = "CSJFULL" const val AD_SOURCE_CSJFULL = "CSJFULL"
const val AD_SOURCE_SH = "CORAL" //珊瑚天卓 const val AD_SOURCE_SH = "CORAL" //珊瑚天卓
const val AD_SOURCE_KS = "KS" //快手 const val AD_SOURCE_KS = "KS" //快手
const val AD_SOURCE_GROMORE = "GROMORE"
const val AD_SOURCE_OW = "OW" //OneWay
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重 // 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const val EVENT_TYPE_ZERO = "0" const val EVENT_TYPE_ZERO = "0"
...@@ -166,6 +169,8 @@ object Constant { ...@@ -166,6 +169,8 @@ object Constant {
const val CSJ_FULL_AD = "CSJFULL_VEDIO_AD" const val CSJ_FULL_AD = "CSJFULL_VEDIO_AD"
const val SH_VEDIO_AD = "SH_VEDIO_AD" const val SH_VEDIO_AD = "SH_VEDIO_AD"
const val KS_VEDIO_AD = "KS_VEDIO_AD" const val KS_VEDIO_AD = "KS_VEDIO_AD"
const val GROMORE_VEDIO_AD = "GROMORE_VEDIO_AD"
const val OW_VEDIO_AD = "OW_VEDIO_AD"
// 信息流广告类型 // 信息流广告类型
const val CSJ_EXPRESS_AD = "CSJ_EXPRESS_AD" const val CSJ_EXPRESS_AD = "CSJ_EXPRESS_AD"
......
...@@ -8,6 +8,7 @@ import com.bytedance.sdk.openadsdk.AdSlot; ...@@ -8,6 +8,7 @@ import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant; import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdManager; import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative; import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd; import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.mints.flowbox.MintsApplication; import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.common.AppConfig; import com.mints.flowbox.common.AppConfig;
...@@ -39,11 +40,11 @@ public class TTNativeExpressManager { ...@@ -39,11 +40,11 @@ public class TTNativeExpressManager {
public TTAdNative initTTAd(boolean permission) { public TTAdNative initTTAd(boolean permission) {
Context context = MintsApplication.getContext(); Context context = MintsApplication.getContext();
//step1:初始化sdk //step1:初始化sdk
TTAdManager ttAdManager = TtCsjAdManager.get(); TTAdManager ttAdManager = TTAdSdk.getAdManager();
//step2:(可选,强烈建议在合适的时机调用):申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。 //step2:(可选,强烈建议在合适的时机调用):申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。
if (permission) { // if (permission) {
TtCsjAdManager.get().requestPermissionIfNecessary(context); // TtCsjAdManager.get().requestPermissionIfNecessary(context);
} // }
//step3:创建TTAdNative对象,用于调用广告请求接口 //step3:创建TTAdNative对象,用于调用广告请求接口
mTTAdNative = ttAdManager.createAdNative(context); mTTAdNative = ttAdManager.createAdNative(context);
return mTTAdNative; return mTTAdNative;
......
...@@ -151,4 +151,16 @@ public class TrackManager { ...@@ -151,4 +151,16 @@ public class TrackManager {
trackPresenter.riskinfo(); trackPresenter.riskinfo();
} }
} }
public void reporGromeEcpm(HashMap<String, Object> vo) {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.reporGromeEcpm(vo);
}
}
public void reportGromoreAdClick(HashMap<String, Object> vo) {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.reportGromoreAdClick(vo);
}
}
} }
...@@ -22,6 +22,7 @@ public class TtCsjAdManager { ...@@ -22,6 +22,7 @@ public class TtCsjAdManager {
/*开屏*/ /*开屏*/
public static String TT_AD_SPLASH_POSTID = "";// 开屏 public static String TT_AD_SPLASH_POSTID = "";// 开屏
public static String TT_AD_GRO_SPLASH = "887497100";// gro兜底开屏
/*banner*/ /*banner*/
public static String TT_AD_BANNER_MY = "946261735";// 个人中心 public static String TT_AD_BANNER_MY = "946261735";// 个人中心
...@@ -46,7 +47,7 @@ public class TtCsjAdManager { ...@@ -46,7 +47,7 @@ public class TtCsjAdManager {
public static String TT_AD_FULLVEDIO_ALL = "946261704";// 通用 public static String TT_AD_FULLVEDIO_ALL = "946261704";// 通用
/*信息流*/ /*信息流*/
public static String TT_AD_NATIVEEXPRESS_XMLY = "946261714";//喜马拉雅信息流 public static String TT_AD_NATIVEEXPRESS_XMLY = "946261714";//喜马拉雅信息流
public static String TT_AD_NATIVEEXPRESS_AWARD = "";//信息流弹窗 public static String TT_AD_NATIVEEXPRESS_AWARD = "946261720";//信息流弹窗
public static String TT_AD_NATIVEEXPRESS_WALK = "946261720";//走路 public static String TT_AD_NATIVEEXPRESS_WALK = "946261720";//走路
public static String TT_AD_NATIVEEXPRESS_WATER = "946261720";//喝水 public static String TT_AD_NATIVEEXPRESS_WATER = "946261720";//喝水
public static String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "946261720";//早上打卡 public static String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "946261720";//早上打卡
......
package com.mints.flowbox.manager
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.MintsApplication
import com.mints.library.utils.CommonUtils
object UmengManager {
fun preInit(){
UMConfigure.preInit(MintsApplication.getContext(), CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"),
CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"))
}
/**
* 友盟初始化
*/
fun initUm() {
try {
/*
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(
MintsApplication.getContext(),
CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"),
CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"),
UMConfigure.DEVICE_TYPE_PHONE,
""
)
UMConfigure.setLogEnabled(BuildConfig.DEBUG)
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL)
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}
}
\ No newline at end of file
...@@ -19,44 +19,53 @@ object UserWeight { ...@@ -19,44 +19,53 @@ object UserWeight {
fun initAdWeight(data: UserTaskMsgBean) { fun initAdWeight(data: UserTaskMsgBean) {
AppConfig.isVideoSleep = data.vedioRules.isVedioSleep AppConfig.isVideoSleep = data.vedioRules.isVedioSleep
videoAdingManager.run { var groMoreRate = 0
initAdWeight( var groMoreCount = 0
data.vedioRules.csJ_VEDIO.rate, if (data.vedioRules.gromorE_VEDIO != null) {
groMoreRate = data.vedioRules.gromorE_VEDIO.rate
groMoreCount = data.vedioRules.gromorE_VEDIO.surplus
}
videoAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate,
data.vedioRules.ylH_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate,
data.vedioRules.fL_VEDIO.rate, 0,
data.vedioRules.corAl_VIDEO.rate, 0,
data.vedioRules.csjfulL_VEDIO.rate, data.vedioRules.csjfulL_VEDIO.rate,
data.vedioRules.kS_VEDIO.rate data.vedioRules.kS_VEDIO.rate,
) groMoreRate,
} data.vedioRules.oW_VEDIO.rate
)
LogUtil.d( LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " + "ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " + "sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " +
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " + "csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " + "shWeight:${0} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " + "flWeight:${0} " +
"flWeight:${data.vedioRules.fL_VEDIO.rate} " + "groMoreWeight:${groMoreRate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate} " "owWeight:${data.vedioRules.oW_VEDIO.rate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
) )
// 广告视频数 // 广告视频数
AppConfig.csjVideoAdCount = data.vedioRules.csJ_VEDIO.surplus AppConfig.csjVideoAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVideoAdCount = data.vedioRules.sdhZ_VEDIO.surplus AppConfig.wnVideoAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVideoAdCount = data.vedioRules.fL_VEDIO.surplus AppConfig.flVideoAdCount = 0
AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus AppConfig.shVideoAdCount = 0
AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus
AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus
LogUtil.d( AppConfig.owVideoAdCount = data.vedioRules.oW_VEDIO.surplus
TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " + AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus
"ylhCount:${AppConfig.ylhAdCount} " + AppConfig.groMoreVideoAdCount = groMoreCount
"sdhzCount:${AppConfig.wnVideoAdCount} " + LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"csjFullCount:${AppConfig.csjFullVedioAdCount} " + "ylhCount:${AppConfig.ylhAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " + "sdhzCount:${AppConfig.wnVideoAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " + "csjFullCount:${AppConfig.csjFullVedioAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount} " "shCount:${0} " +
"flCount:${0} " +
"groMoreCount:${AppConfig.groMoreVideoAdCount} " +
"owCount:${AppConfig.owVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount}"
) )
} }
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ import java.util.Map; ...@@ -23,7 +23,7 @@ import java.util.Map;
*/ */
public class TTGroMoreAdManagerHolder { public class TTGroMoreAdManagerHolder {
public static final String TT_AD_APPID = "5174315"; public static final String TT_AD_APPID = "5182992";
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME; public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
private static boolean sInit; private static boolean sInit;
......
package com.mints.flowbox.mvp.model;
import java.io.Serializable;
public class CoinMsgBean implements Serializable {
private int highCoin;
private int gromoreCoin;
private int coin;
private boolean showHigh;
private boolean riskinfoRate;
public int getHighCoin() {
return highCoin;
}
public int getGromoreCoin() {
return gromoreCoin;
}
public int getCoin() {
return coin;
}
public boolean isShowHigh() {
return showHigh;
}
public boolean isRiskinfoRate() {
return riskinfoRate;
}
}
...@@ -19,6 +19,7 @@ public class DrawcashBean implements Serializable { ...@@ -19,6 +19,7 @@ public class DrawcashBean implements Serializable {
private boolean openJDCash = true; private boolean openJDCash = true;
private String JDUrl = null; private String JDUrl = null;
public String getJDUrl() { public String getJDUrl() {
return JDUrl; return JDUrl;
} }
...@@ -86,20 +87,23 @@ public class DrawcashBean implements Serializable { ...@@ -86,20 +87,23 @@ public class DrawcashBean implements Serializable {
private int YLH_VEDIO; private int YLH_VEDIO;
private int FL_VEDIO; private int FL_VEDIO;
private int CORAL_VEDIO; private int CORAL_VEDIO;
private int KS_VEDIO;
private int RTA_VEDIO;
private int GROMORE_VEDIO;
private int OW_VEDIO;
public int getKS_VEDIO() { public int getRTA_VEDIO() {
return KS_VEDIO; return RTA_VEDIO;
} }
public void setKS_VEDIO(int KS_VEDIO) { public void setRTA_VEDIO(int RTA_VEDIO) {
this.KS_VEDIO = KS_VEDIO; this.RTA_VEDIO = RTA_VEDIO;
} }
private int KS_VEDIO;
public int getCORAL_VEDIO() { public int getCORAL_VEDIO() {
return CORAL_VEDIO; return CORAL_VEDIO;
} }
public int getSDHZ_VEDIO() { public int getSDHZ_VEDIO() {
return SDHZ_VEDIO; return SDHZ_VEDIO;
} }
...@@ -119,6 +123,17 @@ public class DrawcashBean implements Serializable { ...@@ -119,6 +123,17 @@ public class DrawcashBean implements Serializable {
public int getFL_VEDIO() { public int getFL_VEDIO() {
return FL_VEDIO; return FL_VEDIO;
} }
public int getKS_VEDIO() {
return KS_VEDIO;
}
public int getGROMORE_VEDIO() {
return GROMORE_VEDIO;
}
public int getOW_VEDIO() {
return OW_VEDIO;
}
} }
public class CashOutMoneyArrBean implements Serializable { public class CashOutMoneyArrBean implements Serializable {
......
...@@ -12,6 +12,8 @@ public class UserTaskMsgBean implements Serializable { ...@@ -12,6 +12,8 @@ public class UserTaskMsgBean implements Serializable {
private UserRiskAppsBean userRiskApps; private UserRiskAppsBean userRiskApps;
private AdcodeBean adcode_v1 = null; private AdcodeBean adcode_v1 = null;
private FlowAdRulesBean flowAdRules; private FlowAdRulesBean flowAdRules;
private GroAdcodeBean gromoreAdcodes = null;
private HighRatePlanBean highRatePlan;
private String ip; private String ip;
...@@ -30,6 +32,16 @@ public class UserTaskMsgBean implements Serializable { ...@@ -30,6 +32,16 @@ public class UserTaskMsgBean implements Serializable {
private boolean needReportClickAdEvent; private boolean needReportClickAdEvent;
public boolean isShowWechatTips() {
return showWechatTips;
}
public void setShowWechatTips(boolean showWechatTips) {
this.showWechatTips = showWechatTips;
}
private boolean showWechatTips;
public boolean isNeedReportClickAdEvent() { public boolean isNeedReportClickAdEvent() {
return needReportClickAdEvent; return needReportClickAdEvent;
} }
...@@ -136,4 +148,39 @@ public class UserTaskMsgBean implements Serializable { ...@@ -136,4 +148,39 @@ public class UserTaskMsgBean implements Serializable {
public FlowAdRulesBean getFlowAdRules() { public FlowAdRulesBean getFlowAdRules() {
return flowAdRules; return flowAdRules;
} }
public HighRatePlanBean getHighRatePlan() {
return highRatePlan;
}
public void setHighRatePlan(HighRatePlanBean highRatePlan) {
this.highRatePlan = highRatePlan;
}
public static class HighRatePlanBean implements Serializable {
private int YLH;
private int KS;
private int CSJ;
private int GROMORE;
public int getYLH() {
return YLH;
}
public int getKS() {
return KS;
}
public int getCSJ() {
return CSJ;
}
public int getGROMORE() {
return GROMORE;
}
}
public GroAdcodeBean getGromoreAdcodes() {
return gromoreAdcodes;
}
} }
...@@ -10,19 +10,14 @@ public class VedioRulesBean implements Serializable { ...@@ -10,19 +10,14 @@ public class VedioRulesBean implements Serializable {
private FLVedioBean FL_VEDIO; private FLVedioBean FL_VEDIO;
private CsjfullVedioBean CSJFULL_VEDIO; private CsjfullVedioBean CSJFULL_VEDIO;
private CORALVedioBean CORAL_VEDIO; private CORALVedioBean CORAL_VEDIO;
private KSVedioBean KS_VEDIO;
public KsVedioBean getKS_VEDIO() { private RTAVedioBean RTA_VEDIO;
return KS_VEDIO; private GROMOREVedioBean GROMORE_VEDIO;
} private OWVedioBean OW_VEDIO;
public void setKS_VEDIO(KsVedioBean KS_VEDIO) {
this.KS_VEDIO = KS_VEDIO;
}
private KsVedioBean KS_VEDIO;
private boolean flVideoFlag; private boolean flVideoFlag;
private boolean vedioSleep; private boolean vedioSleep;
public class CsjVedioBean implements Serializable { public class CsjVedioBean implements Serializable {
private int surplus;//剩余可看视频数 private int surplus;//剩余可看视频数
private int rate;//权重 private int rate;//权重
...@@ -88,6 +83,32 @@ public class VedioRulesBean implements Serializable { ...@@ -88,6 +83,32 @@ public class VedioRulesBean implements Serializable {
} }
} }
public class KSVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public class RTAVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public class CsjfullVedioBean implements Serializable { public class CsjfullVedioBean implements Serializable {
private int surplus; private int surplus;
private int rate; private int rate;
...@@ -102,7 +123,7 @@ public class VedioRulesBean implements Serializable { ...@@ -102,7 +123,7 @@ public class VedioRulesBean implements Serializable {
} }
public class KsVedioBean implements Serializable { public class GROMOREVedioBean implements Serializable {
private int surplus; private int surplus;
private int rate; private int rate;
...@@ -136,6 +157,38 @@ public class VedioRulesBean implements Serializable { ...@@ -136,6 +157,38 @@ public class VedioRulesBean implements Serializable {
return CORAL_VEDIO; return CORAL_VEDIO;
} }
public RTAVedioBean getRTA_VEDIO() {
return RTA_VEDIO;
}
public GROMOREVedioBean getGROMORE_VEDIO() {
return GROMORE_VEDIO;
}
public OWVedioBean getOW_VEDIO() {
return OW_VEDIO;
}
public class OWVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public void setRTA_VEDIO(RTAVedioBean RTA_VEDIO) {
this.RTA_VEDIO = RTA_VEDIO;
}
public KSVedioBean getKS_VEDIO() {
return KS_VEDIO;
}
public CsjfullVedioBean getCSJFULL_VEDIO() { public CsjfullVedioBean getCSJFULL_VEDIO() {
return CSJFULL_VEDIO; return CSJFULL_VEDIO;
} }
......
...@@ -10,6 +10,7 @@ import com.mints.flowbox.common.DeviceInfo; ...@@ -10,6 +10,7 @@ import com.mints.flowbox.common.DeviceInfo;
import com.mints.flowbox.manager.AppHttpManager; import com.mints.flowbox.manager.AppHttpManager;
import com.mints.flowbox.manager.ShumeiManager; import com.mints.flowbox.manager.ShumeiManager;
import com.mints.flowbox.mvp.model.BaseResponse; import com.mints.flowbox.mvp.model.BaseResponse;
import com.mints.flowbox.mvp.model.CoinMsgBean;
import com.mints.flowbox.mvp.model.UserBean; import com.mints.flowbox.mvp.model.UserBean;
import com.mints.flowbox.mvp.views.AwardView; import com.mints.flowbox.mvp.views.AwardView;
import com.mints.flowbox.utils.DeviceUuidFactory; import com.mints.flowbox.utils.DeviceUuidFactory;
...@@ -25,7 +26,7 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -25,7 +26,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
public void getCoinMsg() { public void getCoinMsg() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.getCoinMsg(), .call(loanService.getCoinMsg(),
new BaseSubscriber<BaseResponse<JsonObject>>() { new BaseSubscriber<BaseResponse<CoinMsgBean>>() {
@Override @Override
public void onCompleted() { public void onCompleted() {
if (isLinkView()) return; if (isLinkView()) return;
...@@ -42,32 +43,16 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -42,32 +43,16 @@ public class AwardPresenter extends BasePresenter<AwardView> {
} }
@Override @Override
public void onNext(BaseResponse<JsonObject> baseResponse) { public void onNext(BaseResponse<CoinMsgBean> baseResponse) {
if (isLinkView()) return; if (isLinkView()) return;
int code = baseResponse.getStatus(); int code = baseResponse.getStatus();
String message = baseResponse.getMessage(); String message = baseResponse.getMessage();
switch (code) { switch (code) {
case 200://成功 case 200://成功
JsonObject data = baseResponse.getData(); CoinMsgBean data = baseResponse.getData();
if (data != null) { if (data != null) {
boolean riskFlag = false; view.getUserTaskMsgSuc(data);
JsonElement riskinfoRateElement = data.get("riskinfoRate");
if (riskinfoRateElement != null) {
riskFlag = data.get("riskinfoRate").getAsBoolean();
}
boolean showHigh = false;
JsonElement showHighElement = data.get("showHigh");
if (showHighElement != null) {
showHigh = data.get("showHigh").getAsBoolean();
}
int highCoin = 3000;
JsonElement highCoinElement = data.get("highCoin");
if (highCoinElement != null) {
highCoin = data.get("highCoin").getAsInt();
}
view.getUserTaskMsgSuc(data.get("coin").getAsInt(), riskFlag, showHigh, highCoin);
} }
break; break;
default: default:
......
...@@ -128,8 +128,8 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -128,8 +128,8 @@ class HomePresenter : BasePresenter<HomeView>() {
when (baseResponse.status) { when (baseResponse.status) {
200 -> { 200 -> {
val codeBean = baseResponse.data val codeBean = baseResponse.data
CsjCode.initListCode(codeBean.csjArr) // CsjCode.initListCode(codeBean.csjArr)
YlhCode.initListCode(codeBean.ylhArr) // YlhCode.initListCode(codeBean.ylhArr)
} }
} }
} }
......
...@@ -68,6 +68,35 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -68,6 +68,35 @@ public class TrackPresenter extends BaseTrackPresenter {
}); });
} }
public void reporGromeEcpm(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reporGromeEcpm(vo),
new BaseSubscriber<BaseResponse<JsonObject>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<JsonObject> baseResponse) {
try {
if (baseResponse.getStatus() == 200) {
JsonObject data = baseResponse.getData();
if (data != null) {
AppConfig.gromoreId = data.get("ecpmId").getAsString();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/** /**
* 离线收益 * 离线收益
*/ */
......
package com.mints.flowbox.mvp.views package com.mints.flowbox.mvp.views
import com.mints.flowbox.mvp.model.CoinMsgBean
interface AwardView : BaseView { interface AwardView : BaseView {
/** /**
* 获取用户配置信息成功 * 获取用户配置信息成功
*/ */
fun getUserTaskMsgSuc(coin: Int, riskFlag: Boolean, showHigh: Boolean, highCoin: Int) fun getUserTaskMsgSuc(data: CoinMsgBean)
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.mints.flowbox.mvp.views ...@@ -2,6 +2,7 @@ package com.mints.flowbox.mvp.views
import com.mints.flowbox.mvp.model.ClickTurnBean import com.mints.flowbox.mvp.model.ClickTurnBean
import com.mints.flowbox.mvp.model.TurnBean import com.mints.flowbox.mvp.model.TurnBean
import com.mints.flowbox.mvp.model.UserTaskMsgBean
interface TurnTableView : BaseView { interface TurnTableView : BaseView {
fun getTurnTableSuc(data: TurnBean) fun getTurnTableSuc(data: TurnBean)
......
...@@ -9,6 +9,7 @@ import com.mints.flowbox.mvp.model.BaseResponse; ...@@ -9,6 +9,7 @@ import com.mints.flowbox.mvp.model.BaseResponse;
import com.mints.flowbox.mvp.model.CashoutChallengeBean; import com.mints.flowbox.mvp.model.CashoutChallengeBean;
import com.mints.flowbox.mvp.model.ClickTurnBean; import com.mints.flowbox.mvp.model.ClickTurnBean;
import com.mints.flowbox.mvp.model.CodeBean; import com.mints.flowbox.mvp.model.CodeBean;
import com.mints.flowbox.mvp.model.CoinMsgBean;
import com.mints.flowbox.mvp.model.CommonParamBean; import com.mints.flowbox.mvp.model.CommonParamBean;
import com.mints.flowbox.mvp.model.CpdBean; import com.mints.flowbox.mvp.model.CpdBean;
import com.mints.flowbox.mvp.model.DrawcashBean; import com.mints.flowbox.mvp.model.DrawcashBean;
...@@ -138,7 +139,7 @@ public interface LoanService { ...@@ -138,7 +139,7 @@ public interface LoanService {
* 获取用户配置信息 * 获取用户配置信息
*/ */
@POST("api/getCoinMsg") @POST("api/getCoinMsg")
Observable<BaseResponse<JsonObject>> getCoinMsg(); Observable<BaseResponse<CoinMsgBean>> getCoinMsg();
/** /**
* 调用事件 * 调用事件
...@@ -383,13 +384,13 @@ public interface LoanService { ...@@ -383,13 +384,13 @@ public interface LoanService {
/** /**
* 获取大转盘信息 * 获取大转盘信息
*/ */
@POST("api/turn/getTurnMsg") @POST("api/turnWithGrome/getTurnMsg")
Observable<BaseResponse<TurnBean>> getTurnMsg(); Observable<BaseResponse<TurnBean>> getTurnMsg();
/** /**
* 点击获取转盘信息 * 点击获取转盘信息
*/ */
@POST("api/turn/clickForTurn") @POST("api/turnWithGrome/clickForTurn")
Observable<BaseResponse<ClickTurnBean>> clickForTurn(); Observable<BaseResponse<ClickTurnBean>> clickForTurn();
/** /**
......
...@@ -269,23 +269,18 @@ class DrawcashActivity : BaseActivity(), ...@@ -269,23 +269,18 @@ class DrawcashActivity : BaseActivity(),
* 设置视频权重 * 设置视频权重
*/ */
private fun initAdWeight(data: DrawcashBean.VedioRules) { private fun initAdWeight(data: DrawcashBean.VedioRules) {
vedioAdingManager.initAdWeight( vedioAdingManager.initAdWeight(data.csJ_VEDIO,data.ylH_VEDIO,data.sdhZ_VEDIO,
data.csJ_VEDIO, 0,0,data.csjfulL_VEDIO,data.kS_VEDIO,data.gromorE_VEDIO,data.oW_VEDIO
data.ylH_VEDIO,
data.sdhZ_VEDIO,
data.fL_VEDIO,
data.coraL_VEDIO,
data.csjfulL_VEDIO,
data.kS_VEDIO
) )
LogUtil.d( LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} " +
TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} " + "ylhWeight:${data.ylH_VEDIO} " +
"ylhWeight:${data.ylH_VEDIO} " + "sdhzWeight:${data.sdhZ_VEDIO} " +
"sdhzWeight:${data.sdhZ_VEDIO} " + "csjFullWeight:${data.csjfulL_VEDIO} " +
"csjFullWeight:${data.csjfulL_VEDIO} " + "shWeight:${0} " +
"shWeight:${data.coraL_VEDIO} " + "flWeight:${0} " +
"flWeight:${data.fL_VEDIO} " + "groMoreWeight:${data.gromorE_VEDIO} " +
"ksWeight:${data.kS_VEDIO} " "owWeight:${data.oW_VEDIO} " +
"ksWeight:${data.kS_VEDIO}"
) )
// 广告视频数 // 广告视频数
AppConfig.csjVideoAdCount = 5 AppConfig.csjVideoAdCount = 5
......
...@@ -3,6 +3,7 @@ package com.mints.flowbox.ui.activitys ...@@ -3,6 +3,7 @@ package com.mints.flowbox.ui.activitys
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
import com.mints.flowbox.manager.TtCsjAdManager import com.mints.flowbox.manager.TtCsjAdManager
...@@ -88,7 +89,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -88,7 +89,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
} }
// 预加载信息流 // 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT) ExpressManager.loadExpress()
} }
...@@ -97,11 +98,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -97,11 +98,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
*/ */
private fun initExpress() { private fun initExpress() {
try { try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) { if (flSubsidykAd != null) {
if (flSubsidykAd != null) { flSubsidykAd.removeAllViews()
flSubsidykAd.removeAllViews() flSubsidykAd.addView(ExpressManager.getExpressFrameLayout())
flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
} }
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
......
...@@ -9,6 +9,7 @@ import androidx.viewpager.widget.ViewPager.OnPageChangeListener ...@@ -9,6 +9,7 @@ import androidx.viewpager.widget.ViewPager.OnPageChangeListener
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.UserManager import com.mints.flowbox.manager.UserManager
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.adapter.ViewPagerAdapter import com.mints.flowbox.ui.adapter.ViewPagerAdapter
...@@ -41,9 +42,8 @@ class GuideActivity : BaseActivity() { ...@@ -41,9 +42,8 @@ class GuideActivity : BaseActivity() {
} }
private fun readyGoMain() { private fun readyGoMain() {
val instance = AppPreferences(MintsApplication.getContext()) val customVersion: Int = AppPreferencesManager.get().getInt(Constant.CUSTOM_VERSION, 0)
val customVersion: Int = instance.getInt(Constant.CUSTOM_VERSION, 0) AppPreferencesManager.get().put(Constant.ISFIRSTENTER + customVersion, false)
instance.put(Constant.ISFIRSTENTER + customVersion, false)
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) { if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
......
...@@ -7,6 +7,7 @@ import android.view.animation.AnimationSet ...@@ -7,6 +7,7 @@ import android.view.animation.AnimationSet
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.common.DeviceInfo import com.mints.flowbox.common.DeviceInfo
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import kotlinx.android.synthetic.main.activity_splash.* import kotlinx.android.synthetic.main.activity_splash.*
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
...@@ -18,7 +19,6 @@ class SplashActivity : BaseActivity() { ...@@ -18,7 +19,6 @@ class SplashActivity : BaseActivity() {
private val mAlph by lazy { AlphaAnimation(1f, 1f) } private val mAlph by lazy { AlphaAnimation(1f, 1f) }
private val animationSet by lazy { AnimationSet(true) } private val animationSet by lazy { AnimationSet(true) }
private val ps by lazy { AppPreferences(context) }
override fun isApplyKitKatTranslucency() = false override fun isApplyKitKatTranslucency() = false
...@@ -90,8 +90,8 @@ class SplashActivity : BaseActivity() { ...@@ -90,8 +90,8 @@ class SplashActivity : BaseActivity() {
} }
private fun readyGoOtherActivity() { private fun readyGoOtherActivity() {
val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0) val customVersion: Int = AppPreferencesManager.get().getInt(Constant.CUSTOM_VERSION, 0)
val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true) val isFirstEnter: Boolean = AppPreferencesManager.get().getBoolean(Constant.ISFIRSTENTER + customVersion, true)
if (isFirstEnter) { if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java) readyGoThenKill(GuideActivity::class.java)
} else { } else {
......
...@@ -12,6 +12,7 @@ import com.mints.flowbox.MintsApplication ...@@ -12,6 +12,7 @@ import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.common.DeviceInfo import com.mints.flowbox.common.DeviceInfo
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
import com.mints.flowbox.manager.UserManager import com.mints.flowbox.manager.UserManager
import com.mints.flowbox.manager.ad.YlhAdManager import com.mints.flowbox.manager.ad.YlhAdManager
...@@ -35,7 +36,6 @@ class SplashYlhActivity : BaseActivity(), SplashADListener { ...@@ -35,7 +36,6 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
private var splashAD: SplashAD? = null private var splashAD: SplashAD? = null
private var container: ViewGroup? = null private var container: ViewGroup? = null
private val skipView: TextView? = null private val skipView: TextView? = null
private val ps by lazy { AppPreferences(context) }
var canJump = false var canJump = false
...@@ -196,8 +196,8 @@ class SplashYlhActivity : BaseActivity(), SplashADListener { ...@@ -196,8 +196,8 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
} }
private fun readyGoOtherActivity() { private fun readyGoOtherActivity() {
val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0) val customVersion: Int = AppPreferencesManager.get().getInt(Constant.CUSTOM_VERSION, 0)
val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true) val isFirstEnter: Boolean = AppPreferencesManager.get().getBoolean(Constant.ISFIRSTENTER + customVersion, true)
if (isFirstEnter) { if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java) readyGoThenKill(GuideActivity::class.java)
} else { } else {
......
...@@ -75,7 +75,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener { ...@@ -75,7 +75,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
// 微转分享 // 微转分享
layoutWrapper.visibility = View.VISIBLE layoutWrapper.visibility = View.VISIBLE
tv_title.text = "幸运大抽奖" tv_title.text = "幸运大抽奖"
currentFragment = TurnTableFragment(true) currentFragment = TurnTableFragment()
} }
} }
......
...@@ -126,7 +126,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -126,7 +126,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
*/ */
@Override @Override
public void showLoading(String message) { public void showLoading(String message) {
if (this.getWindow() != null && !this.isFinishing()) { if (!this.isFinishing() && this.getWindow() != null) {
if (progressDialog == null) { if (progressDialog == null) {
progressDialog = new LoadingDialog(this); progressDialog = new LoadingDialog(this);
progressDialog.setLoadText(message); progressDialog.setLoadText(message);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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