Commit 18ef89cc authored by jyx's avatar jyx

优量汇SDK更新,代码位更新

parent 741652f9
...@@ -198,7 +198,7 @@ dependencies { ...@@ -198,7 +198,7 @@ dependencies {
// 穿山甲广告 版本3.4.1.2 // 穿山甲广告 版本3.4.1.2
implementation(name: 'open_ad_sdk', ext: 'aar') implementation(name: 'open_ad_sdk', ext: 'aar')
// 广点通广告 腾讯 // 广点通广告 腾讯
implementation(name: 'GDTSDK.unionNoPlugin.4.294.1164', ext: 'aar') implementation(name: 'GDTSDK.unionNormal.4.333.1203', ext: 'aar')
// shareSdk // shareSdk
implementation project(':shareSdkLib') implementation project(':shareSdkLib')
// 应用管理中心分包 // 应用管理中心分包
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<uses-permission android:name="com.wenshu.youyou.permission" /> <uses-permission android:name="com.wenshu.youyou.permission" />
<!-- 蘑菇星球 --> <!-- 蘑菇星球 -->
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/> <uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<permission <permission
android:name="com.wenshu.youyou.permission" android:name="com.wenshu.youyou.permission"
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
android:value="${UMENG_KEY}" /> android:value="${UMENG_KEY}" />
<!-- TalkingData --> <!-- TalkingData -->
<!-- <meta-data--> <!-- <meta-data-->
<!-- android:name="TD_KEY"--> <!-- android:name="TD_KEY"-->
<!-- android:value="${TD_KEY}" />--> <!-- android:value="${TD_KEY}" />-->
<!-- ShareSDK --> <!-- ShareSDK -->
<meta-data <meta-data
...@@ -140,6 +140,9 @@ ...@@ -140,6 +140,9 @@
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoneTranslucent" /> android:theme="@style/AppTheme.NoneTranslucent" />
<activity
android:name=".ui.activitys.SplashCsjADActivity"
android:screenOrientation="portrait" />
<activity android:name="com.wenshu.youyou.ui.activitys.WebActivity" /> <activity android:name="com.wenshu.youyou.ui.activitys.WebActivity" />
<activity <activity
android:name="com.wenshu.library.base.BaseWebActivity" android:name="com.wenshu.library.base.BaseWebActivity"
...@@ -299,15 +302,15 @@ ...@@ -299,15 +302,15 @@
</provider> </provider>
<!-- 鱼丸盒子广告 --> <!-- 鱼丸盒子广告 -->
<!-- <provider--> <!-- <provider-->
<!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"--> <!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"-->
<!-- android:authorities="${applicationId}.YwFileProvider"--> <!-- android:authorities="${applicationId}.YwFileProvider"-->
<!-- android:exported="false"--> <!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">--> <!-- android:grantUriPermissions="true">-->
<!-- <meta-data--> <!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"--> <!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/ywsdk_file_paths" />--> <!-- android:resource="@xml/ywsdk_file_paths" />-->
<!-- </provider>--> <!-- </provider>-->
<!-- 穿山甲广告 --> <!-- 穿山甲广告 -->
<provider <provider
......
...@@ -154,12 +154,12 @@ public class WenshuApplication extends MultiDexApplication { ...@@ -154,12 +154,12 @@ public class WenshuApplication extends MultiDexApplication {
* 初始化喜马拉雅 * 初始化喜马拉雅
*/ */
private void initXmly() { private void initXmly() {
XmPlayerConfig.getInstance(this).setDefualtNotificationNickNameAndInfo(Constant.wenshu_APP_NAME, Constant.wenshu_APP_NAME); XmPlayerConfig.getInstance(this).setDefualtNotificationNickNameAndInfo(Constant.Wenshu_APP_NAME, Constant.Wenshu_APP_NAME);
if (BaseUtil.isMainProcess(this)) { if (BaseUtil.isMainProcess(this)) {
ConstantsOpenSdk.isDebug = BuildConfig.DEBUG; ConstantsOpenSdk.isDebug = BuildConfig.DEBUG;
CommonRequest mXimalaya = CommonRequest.getInstanse(); CommonRequest mXimalaya = CommonRequest.getInstanse();
String mAppSecret = "e31c08462e63e0c3f71ffd7fbba85850"; String mAppSecret = "c4b04d0784307e48be3950158c77fb0d";
String mAppKey = "fe44f14a0fcfbb101632099787eadd04"; String mAppKey = "ba8e54e24fcea42993500cb414fb23f3";
mXimalaya.setAppkey(mAppKey); mXimalaya.setAppkey(mAppKey);
mXimalaya.setPackid(Constant.wenshu_PKG_NAME); mXimalaya.setPackid(Constant.wenshu_PKG_NAME);
mXimalaya.init(this, mAppSecret); mXimalaya.init(this, mAppSecret);
......
package com.wenshu.youyou.ad.express package com.wenshu.youyou.ad.express
import android.annotation.SuppressLint
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
...@@ -13,6 +14,7 @@ import java.util.* ...@@ -13,6 +14,7 @@ import java.util.*
/** /**
* 预加载信息流管理类 * 预加载信息流管理类
*/ */
@SuppressLint("StaticFieldLeak")
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener { object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener {
private val TAG = PreLoadExpressManager::class.java.simpleName private val TAG = PreLoadExpressManager::class.java.simpleName
......
...@@ -42,19 +42,16 @@ public class TTPreLoadExpressManager { ...@@ -42,19 +42,16 @@ public class TTPreLoadExpressManager {
DisplayMetrics displayMetrics = WenshuApplication.getContext().getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = WenshuApplication.getContext().getResources().getDisplayMetrics();
float density = displayMetrics.density; float density = displayMetrics.density;
float pxWidth = displayMetrics.widthPixels - (50 * density + 0.5f); float pxWidth = displayMetrics.widthPixels - (50 * density + 0.5f);
float dpWidth = pxWidth / density + 0.5f; return pxWidth / density + 0.5f;
return dpWidth;
} }
/** /**
* 预加载 信息流 * 预加载 信息流
*/ */
public void loadTtFrameLayout(FrameLayout adFrameLayout) { public void loadTtFrameLayout(FrameLayout adFrameLayout) {
// init(); init();
try { try {
ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_AWARD, adFrameLayout, getViewWidth(), 0); ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_AWARD, adFrameLayout, getViewWidth(), 0);
ttNativeExpressManager.setTTNativeExpressManagerListener(view -> { ttNativeExpressManager.setTTNativeExpressManagerListener(view -> {
try { try {
......
...@@ -2,6 +2,7 @@ package com.wenshu.youyou.ad.video; ...@@ -2,6 +2,7 @@ package com.wenshu.youyou.ad.video;
import android.app.Activity; import android.app.Activity;
import android.os.SystemClock; import android.os.SystemClock;
import com.wenshu.youyou.ad.video.base.BaseVideoAd; import com.wenshu.youyou.ad.video.base.BaseVideoAd;
import com.wenshu.youyou.ad.video.base.VideoAdStatusListener; import com.wenshu.youyou.ad.video.base.VideoAdStatusListener;
import com.wenshu.youyou.common.AppConfig; import com.wenshu.youyou.common.AppConfig;
...@@ -13,6 +14,8 @@ import com.qq.e.ads.rewardvideo.RewardVideoAD; ...@@ -13,6 +14,8 @@ import com.qq.e.ads.rewardvideo.RewardVideoAD;
import com.qq.e.ads.rewardvideo.RewardVideoADListener; import com.qq.e.ads.rewardvideo.RewardVideoADListener;
import com.qq.e.comm.util.AdError; import com.qq.e.comm.util.AdError;
import java.util.Map;
/** /**
* 优量汇视频 * 优量汇视频
*/ */
...@@ -168,7 +171,7 @@ public class YlhVideoAdManager extends BaseVideoAd { ...@@ -168,7 +171,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
} }
@Override @Override
public void onReward() {//激励视频广告激励发放 public void onReward(Map<String, Object> map) {//激励视频广告激励发放
// if (activity != null) { // if (activity != null) {
// ylhVideoAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType)); // ylhVideoAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// } // }
......
...@@ -17,7 +17,7 @@ object Constant { ...@@ -17,7 +17,7 @@ object Constant {
/** /**
* app名称 * app名称
*/ */
const val wenshu_APP_NAME = "尤友" const val Wenshu_APP_NAME = "尤友"
/** /**
* 应用包名 * 应用包名
......
...@@ -567,7 +567,7 @@ class DeviceInfo private constructor() { ...@@ -567,7 +567,7 @@ class DeviceInfo private constructor() {
val appMap: MutableMap<String, String> = HashMap() val appMap: MutableMap<String, String> = HashMap()
appMap["appName"] = appInfo.loadLabel(mContext!!.packageManager) as String appMap["appName"] = appInfo.loadLabel(mContext!!.packageManager) as String
appMap["appPkg"] = pinfo.packageName appMap["appPkg"] = pinfo.packageName
if (TextUtils.equals(Constant.wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) && if (TextUtils.equals(Constant.Wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) &&
TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) { TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) {
continue continue
} }
...@@ -600,7 +600,7 @@ class DeviceInfo private constructor() { ...@@ -600,7 +600,7 @@ class DeviceInfo private constructor() {
//系统程序 忽略 //系统程序 忽略
} else { } else {
//非系统程序 //非系统程序
if (TextUtils.equals(Constant.wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) && if (TextUtils.equals(Constant.Wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) &&
TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) { TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) {
continue continue
} }
...@@ -634,7 +634,7 @@ class DeviceInfo private constructor() { ...@@ -634,7 +634,7 @@ class DeviceInfo private constructor() {
//系统程序 忽略 //系统程序 忽略
} else { } else {
//非系统程序 //非系统程序
if (TextUtils.equals(Constant.wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) && if (TextUtils.equals(Constant.Wenshu_APP_NAME, appInfo.loadLabel(mContext!!.packageManager) as String) &&
TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) { TextUtils.equals(pinfo.packageName, Constant.wenshu_PKG_NAME)) {
continue continue
} }
......
...@@ -17,13 +17,14 @@ import com.wenshu.youyou.mvp.model.ServerAdBean; ...@@ -17,13 +17,14 @@ import com.wenshu.youyou.mvp.model.ServerAdBean;
*/ */
public class TtCsjAdManager { public class TtCsjAdManager {
public static final String TT_AD_APPID = "5038593"; public static final String TT_AD_APPID = "5155496";
public static final String TT_AD_NAME = Constant.wenshu_APP_NAME; public static final String TT_AD_NAME = Constant.Wenshu_APP_NAME;
/*激励视频*/
public static String TT_AD_SPLASH_POSTID = "887454728";// 个人中心
/*banner*/ /*banner*/
public static String TT_AD_BANNER_MY = "945812059";// 个人中心 public static String TT_AD_BANNER_MY = "945968536";// 个人中心
public static String TT_AD_BANNER_JULEYUN = "";// 聚乐云 public static String TT_AD_BANNER_JULEYUN = "";// 聚乐云
/*激励视频*/
public static String TT_AD_VEDIO_MAIN_DEV = "945811826";// 开发使用 public static String TT_AD_VEDIO_MAIN_DEV = "945811826";// 开发使用
public static String TT_AD_VEDIO_DRINK = "945811826";//喝水打卡 public static String TT_AD_VEDIO_DRINK = "945811826";//喝水打卡
public static String TT_AD_VEDIO_WALK = "945811826";//走路打卡 public static String TT_AD_VEDIO_WALK = "945811826";//走路打卡
...@@ -39,19 +40,19 @@ public class TtCsjAdManager { ...@@ -39,19 +40,19 @@ public class TtCsjAdManager {
public static String TT_AD_VEDIO_GAME = "";// 猎豹 public static String TT_AD_VEDIO_GAME = "";// 猎豹
public static String TT_AD_VEDIO_JULEYUN = "";// 聚乐云 public static String TT_AD_VEDIO_JULEYUN = "";// 聚乐云
public static String TT_AD_VEDIO_BIANXIANMAO = "";// 变现猫 public static String TT_AD_VEDIO_BIANXIANMAO = "";// 变现猫
public static String TT_AD_VEDIO_BLESSINGBAG = "945811826";// 福袋 public static String TT_AD_VEDIO_BLESSINGBAG = "945968497";// 福袋
public static String TT_AD_VEDIO_HOMEVEDIO = "945811826";// 首页视频翻倍 public static String TT_AD_VEDIO_HOMEVEDIO = "945968497";// 首页视频翻倍
public static String TT_AD_VEDIO_SMALLHOMEVEDIO = "945811826";// 短视频翻倍 public static String TT_AD_VEDIO_SMALLHOMEVEDIO = "945968497";// 短视频翻倍
public static String TT_AD_VEDIO_KYLVEDIO = "945811826";// 来电秀视频 public static String TT_AD_VEDIO_KYLVEDIO = "945968497";// 来电秀视频
/*全屏视频*/ /*全屏视频*/
public static String TT_AD_FULLVEDIO_ALL = "945811843";// 通用 public static String TT_AD_FULLVEDIO_ALL = "945968499";// 通用
/*信息流*/ /*信息流*/
public static String TT_AD_NATIVEEXPRESS_XMLY = "945811816";//喜马拉雅信息流 public static String TT_AD_NATIVEEXPRESS_XMLY = "945968506";//喜马拉雅信息流
public static String TT_AD_NATIVEEXPRESS_AWARD = "945811936";//信息流弹窗 public static String TT_AD_NATIVEEXPRESS_AWARD = "945968518";//信息流弹窗
public static String TT_AD_NATIVEEXPRESS_WALK = "945811899";//走路 public static String TT_AD_NATIVEEXPRESS_WALK = "945968542";//走路
public static String TT_AD_NATIVEEXPRESS_WATER = "945811899";//喝水 public static String TT_AD_NATIVEEXPRESS_WATER = "945968542";//喝水
public static String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945811899";//早上打卡 public static String TT_AD_NATIVEEXPRESS_MORNINGCLOCK = "945968542";//早上打卡
public static String TT_AD_NATIVEEXPRESS_EAT = "945811899";//餐补 public static String TT_AD_NATIVEEXPRESS_EAT = "945968542";//餐补
public static String TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT = "";//猎豹列表和退出 public static String TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT = "";//猎豹列表和退出
/*全屏广告*/ /*全屏广告*/
public static String TT_AD_ALLVEDIO_ID_LIEBAO = "";//猎豹全屏带跳过按钮 public static String TT_AD_ALLVEDIO_ID_LIEBAO = "";//猎豹全屏带跳过按钮
......
...@@ -12,13 +12,13 @@ import com.wannuosili.sdk.WNAdSdk ...@@ -12,13 +12,13 @@ import com.wannuosili.sdk.WNAdSdk
*/ */
object WnManager { object WnManager {
private const val APP_ID = "" private const val APP_ID = "10000547"
const val WN_AD_VEDIO_DRINK_POSTID = "" //喝水打卡 const val WN_AD_VEDIO_DRINK_POSTID = "100000812008" //喝水打卡
const val WN_AD_VEDIO_MAIN_POSTID = "" //我的界面视频 const val WN_AD_VEDIO_MAIN_POSTID = "100000812008" //我的界面视频
const val WN_AD_VEDIO_ERASE_POSTID = "" //刮刮乐 const val WN_AD_VEDIO_ERASE_POSTID = "100000812008" //刮刮乐
const val WN_AD_VEDIO_TURNABLE_POSTID = "" //大转盘 const val WN_AD_VEDIO_TURNABLE_POSTID = "100000812008" //大转盘
const val WN_AD_VEDIO_MOREDIALOG_POSTID = "" //签到、气泡、离线弹框 const val WN_AD_VEDIO_MOREDIALOG_POSTID = "100000812008" //签到、气泡、离线弹框
/** /**
* 初始化 * 初始化
......
...@@ -13,33 +13,33 @@ import com.qq.e.comm.managers.GDTADManager ...@@ -13,33 +13,33 @@ import com.qq.e.comm.managers.GDTADManager
object YlhAdManager { object YlhAdManager {
/* 优量汇appid */ /* 优量汇appid */
const val YLH_AD_APPID = "1110058445" const val YLH_AD_APPID = "1111577663"
/* splash-postid */ /* splash-postid */
var YLH_AD_SPLASH_POSTID = "1051659976719686" var YLH_AD_SPLASH_POSTID = "9001274114255176"
/* 激励视频 */ /* 激励视频 */
var YLH_AD_VEDIO_DRINK = "7051055905193266" //喝水打卡 var YLH_AD_VEDIO_DRINK = "4061975164654076" //喝水打卡
var YLH_AD_VEDIO_WALK = "7051055905193266" //走路打卡 var YLH_AD_VEDIO_WALK = "4061975164654076" //走路打卡
var YLH_AD_VEDIO_MAIN = "7051055905193266" // 我的界面视频 var YLH_AD_VEDIO_MAIN = "4061975164654076" // 我的界面视频
var YLH_AD_VEDIO_ERASE = "7051055905193266" // 刮刮乐 var YLH_AD_VEDIO_ERASE = "4061975164654076" // 刮刮乐
var YLH_AD_VEDIO_TURNABLE = "7051055905193266" // 大转盘 var YLH_AD_VEDIO_TURNABLE = "4061975164654076" // 大转盘
var YLH_AD_VEDIO_MOREDIALOG = "7051055905193266" // 气泡 var YLH_AD_VEDIO_MOREDIALOG = "4061975164654076" // 气泡
var YLH_AD_VEDIO_SIGN = "7051055905193266" // 签到 var YLH_AD_VEDIO_SIGN = "4061975164654076" // 签到
var YLH_AD_VEDIO_EAT = "7051055905193266" // 饭补 var YLH_AD_VEDIO_EAT = "4061975164654076" // 饭补
var YLH_AD_VEDIO_OFFINELINE = "7051055905193266" // 离线弹框 var YLH_AD_VEDIO_OFFINELINE = "4061975164654076" // 离线弹框
var YLH_AD_VEDIO_DRAWCASH = "7051055905193266" // 提现 var YLH_AD_VEDIO_DRAWCASH = "4061975164654076" // 提现
var YLH_AD_VEDIO_MOST = "7051055905193266" // 超级翻倍/高额任务 var YLH_AD_VEDIO_MOST = "4061975164654076" // 超级翻倍/高额任务
var YLH_AD_VEDIO_GAME = "" // 猎豹 var YLH_AD_VEDIO_GAME = "" // 猎豹
var YLH_AD_VEDIO_BLESSINGBAG = "7051055905193266" // 福袋 var YLH_AD_VEDIO_BLESSINGBAG = "4061975164654076" // 福袋
var YLH_AD_VEDIO_HOMEVEDIO = "7051055905193266" // 首页视频翻倍 var YLH_AD_VEDIO_HOMEVEDIO = "4061975164654076" // 首页视频翻倍
var YLH_AD_VEDIO_SMALLHOMEVEDIO = "7051055905193266" // 短视频翻倍 var YLH_AD_VEDIO_SMALLHOMEVEDIO = "4061975164654076" // 短视频翻倍
var YLH_AD_VEDIO_KYLVEDIO = "7051055905193266" // 来电秀视频 var YLH_AD_VEDIO_KYLVEDIO = "4061975164654076" // 来电秀视频
/*信息流*/ /*信息流*/
var YLH_AD_NATIVEEXPRESS_JULEYUN = "" //聚乐云 var YLH_AD_NATIVEEXPRESS_JULEYUN = "" //聚乐云
var YLH_AD_NATIVEEXPRESS_AWARD = "4081450906109922" //奖励弹窗 var YLH_AD_NATIVEEXPRESS_AWARD = "5061071124059461" //奖励弹窗
/* 插屏 */ /* 插屏 */
var YLH_AD_INTERSTITIALAD_LIEBAO = "" //猎豹 var YLH_AD_INTERSTITIALAD_LIEBAO = "" //猎豹
......
package com.wenshu.youyou.ui.activitys
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTSplashAd
import com.wenshu.youyou.R
import com.wenshu.youyou.manager.TTNativeExpressManager
import com.wenshu.youyou.manager.TtCsjAdManager
import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.library.net.netstatus.NetUtils
private val TAG = SplashCsjADActivity::class.java.simpleName
/**
* 后台返回时每次都展示 快手广告
*/
class SplashCsjADActivity : BaseActivity() {
private var container: ViewGroup? = null
private var mIsPaused = false
var canJump = false
private var mTTAdNative: TTAdNative? = null
override fun getContentViewLayoutID(): Int {
return R.layout.activity_splash_ylh
}
override fun initViewsAndEvents() {
if (!NetUtils.isNetworkConnected(context)) {
finish()
} else {
try {
container = findViewById<View>(R.id.splash_container) as ViewGroup
//step2:创建TTAdNative对象
val ttNativeExpressManager = TTNativeExpressManager()
mTTAdNative = ttNativeExpressManager.initTTAd(false)
loadSplashAd()
} catch (e: Exception) {
readyGoOtherActivity()
}
}
}
override fun isApplyKitKatTranslucency(): Boolean {
return false
}
private fun loadSplashAd() {
//step3:创建开屏广告请求参数AdSlot
val adSlot: AdSlot? = AdSlot.Builder()
.setCodeId(TtCsjAdManager.TT_AD_SPLASH_POSTID)
.setImageAcceptedSize(1080, 1920)
.build()
mTTAdNative!!.loadSplashAd(adSlot, object : TTAdNative.SplashAdListener {
override fun onError(p0: Int, p1: String?) {
readyGoOtherActivity()
}
override fun onTimeout() {
readyGoOtherActivity()
}
override fun onSplashAdLoad(ad: TTSplashAd?) {
if (ad == null) {
readyGoOtherActivity()
return
}
val splashView = ad.splashView
if (container != null && !isFinishing) {
container!!.removeAllViews()
//把SplashView 添加到ViewGroup中,注意开屏广告view:width >=70%屏幕宽;height >=50%屏幕高
container!!.addView(splashView)
//设置不开启开屏广告倒计时功能以及不显示跳过按钮,如果这么设置,您需要自定义倒计时逻辑
//ad.setNotAllowSdkCountdown();
} else {
readyGoOtherActivity()
}
ad.setSplashInteractionListener(object : TTSplashAd.AdInteractionListener {
override fun onAdClicked(p0: View?, p1: Int) {
}
override fun onAdShow(p0: View?, p1: Int) {
}
override fun onAdSkip() {
readyGoOtherActivity()
}
override fun onAdTimeOver() {
readyGoOtherActivity()
}
})
}
}, 3000)
}
/**
* 设置一个变量来控制当前开屏页面是否可以跳转,当开屏广告为普链类广告时,点击会打开一个广告落地页,此时开发者还不能打开自己的App主页。当从广告落地页返回以后,
* 才可以跳转到开发者自己的App主页;当开屏广告是App类广告时只会下载App。
*/
private operator fun next() {
if (mIsPaused) {
canJump = true
} else {
readyGoOtherActivity()
}
}
override fun onPause() {
super.onPause()
mIsPaused = true
}
override fun onResume() {
super.onResume()
mIsPaused = false
if (canJump) {
next()
}
}
/**
* 开屏页一定要禁止用户对返回按钮的控制,否则将可能导致用户手动退出了App而广告无法正常曝光和计费
*/
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
return if (keyCode == KeyEvent.KEYCODE_BACK) {
true
} else super.onKeyDown(keyCode, event)
}
private fun readyGoOtherActivity() {
finish()
}
}
\ No newline at end of file
...@@ -332,7 +332,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -332,7 +332,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
val transaction: FragmentTransaction = supportFragmentManager.beginTransaction() val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
if (littleVideoFragment == null) { if (littleVideoFragment == null) {
littleVideoFragment = YLLittleVideoFragment.newInstance() littleVideoFragment = YLLittleVideoFragment.newInstance()
transaction.add(R.id.yilan_fragment_frame_container, littleVideoFragment!!, YLLittleVideoFragment::class.java.simpleName) transaction.add(
R.id.yilan_fragment_frame_container,
littleVideoFragment!!,
YLLittleVideoFragment::class.java.simpleName
)
} else { } else {
transaction.show(littleVideoFragment!!) transaction.show(littleVideoFragment!!)
} }
...@@ -363,7 +367,12 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -363,7 +367,12 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
override fun onLoopComplete(pager: String?, videoID: String, taskID: String?, num: Int) { override fun onLoopComplete(
pager: String?,
videoID: String,
taskID: String?,
num: Int
) {
// LogUtil.d(TAG, "registerPlayerCallBack onLoopComplete") // LogUtil.d(TAG, "registerPlayerCallBack onLoopComplete")
addVideoIdList(videoID) addVideoIdList(videoID)
pauseDownloadTime() pauseDownloadTime()
...@@ -388,11 +397,17 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -388,11 +397,17 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
private fun initListener() { private fun initListener() {
val params = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT) val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
params.setMargins(0, 0, 0, BubbleUtils.dp2px(270)) params.setMargins(0, 0, 0, BubbleUtils.dp2px(270))
cdvvYilanTime.layoutParams = params cdvvYilanTime.layoutParams = params
val paramsRedBox = FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT) val paramsRedBox = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
)
paramsRedBox.setMargins(0, BubbleUtils.dp2px(40), 0, 0) paramsRedBox.setMargins(0, BubbleUtils.dp2px(40), 0, 0)
paramsRedBox.gravity = Gravity.END paramsRedBox.gravity = Gravity.END
rl_fragment_main_redbox.layoutParams = paramsRedBox rl_fragment_main_redbox.layoutParams = paramsRedBox
...@@ -405,10 +420,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -405,10 +420,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onSuccess(p0: String?, p1: Int, p2: String?, p3: String?) { override fun onSuccess(p0: String?, p1: Int, p2: String?, p3: String?) {
} }
override fun onError(p0: String?, p1: Int, p2: String?, p3: Int, p4: String?, p5: String?) { override fun onError(
p0: String?,
p1: Int,
p2: String?,
p3: Int,
p4: String?,
p5: String?
) {
} }
override fun onRenderError(p0: String?, p1: Int, p2: String?, p3: Int, p4: String?, p5: String?) { override fun onRenderError(
p0: String?,
p1: Int,
p2: String?,
p3: Int,
p4: String?,
p5: String?
) {
} }
override fun onShow(p0: String?, p1: Int, p2: String?, p3: String) { override fun onShow(p0: String?, p1: Int, p2: String?, p3: String) {
...@@ -539,14 +568,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -539,14 +568,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
R.id.btn_dialogper_back -> { R.id.btn_dialogper_back -> {
if (activity != null && !activity!!.isFinishing && if (activity != null && !activity!!.isFinishing &&
powerDialog != null && powerDialog!!.isShowing powerDialog != null && powerDialog!!.isShowing
) { ) {
showToast("请您同意授权,否则将无法使用APP功能") showToast("请您同意授权,否则将无法使用APP功能")
} }
} }
R.id.btn_dialogper_next -> { R.id.btn_dialogper_next -> {
if (activity != null && !activity!!.isFinishing && if (activity != null && !activity!!.isFinishing &&
powerDialog != null && powerDialog!!.isShowing powerDialog != null && powerDialog!!.isShowing
) { ) {
powerDialog!!.dismiss() powerDialog!!.dismiss()
ps.put(Constant.LOAN_PERMISSION_FLAG, false) ps.put(Constant.LOAN_PERMISSION_FLAG, false)
...@@ -555,12 +584,25 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -555,12 +584,25 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
ShumeiManager.getInstance().initShumei() ShumeiManager.getInstance().initShumei()
// 游客首次提示1500新人奖励 且 不是分享包 // 游客首次提示1500新人奖励 且 不是分享包
val channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME") val channel = CommonUtils.getAppMetaData(
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && ps.getBoolean(Constant.FIRST_VISITOR_FLAG, true)) { WenshuApplication.getContext(),
"CHANNEL_NAME"
)
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && ps.getBoolean(
Constant.FIRST_VISITOR_FLAG,
true
)
) {
ps.put(Constant.FIRST_VISITOR_FLAG, false) ps.put(Constant.FIRST_VISITOR_FLAG, false)
val bundle = Bundle() val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, if (userMsgBean != null && userMsgBean!!.userMsg.showCoin > 0) userMsgBean?.userMsg?.showCoin!! else 1500) bundle.putInt(
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_NEW_VISITOR) Constant.MAIN_CUR_COIN,
if (userMsgBean != null && userMsgBean!!.userMsg.showCoin > 0) userMsgBean?.userMsg?.showCoin!! else 1500
)
bundle.putString(
Constant.MAIN_CARRIER_TYPE,
Constant.CARRIER_NEW_VISITOR
)
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
} }
} }
...@@ -575,20 +617,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -575,20 +617,24 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重 * 设置视频权重
*/ */
private fun initAdWeight(data: UserTaskMsgBean) { private fun initAdWeight(data: UserTaskMsgBean) {
videoAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, videoAdingManager?.initAdWeight(
data.vedioRules.ylH_VEDIO.rate, data.vedioRules.csJ_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.fL_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate,
data.vedioRules.corAl_VIDEO.rate, data.vedioRules.fL_VEDIO.rate,
data.vedioRules.csjfulL_VEDIO.rate, data.vedioRules.corAl_VIDEO.rate,
data.vedioRules.kS_VEDIO.rate) data.vedioRules.csjfulL_VEDIO.rate,
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " + data.vedioRules.kS_VEDIO.rate
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " + )
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " + LogUtil.d(
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " + TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " + "ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
"flWeight:${data.vedioRules.fL_VEDIO.rate} " + "sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate} ") "csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " +
"flWeight:${data.vedioRules.fL_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
...@@ -597,13 +643,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -597,13 +643,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus
AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus
AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " + LogUtil.d(
"ylhCount:${AppConfig.ylhAdCount} " + TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"sdhzCount:${AppConfig.wnVideoAdCount} " + "ylhCount:${AppConfig.ylhAdCount} " +
"csjFullCount:${AppConfig.csjFullVedioAdCount} " + "sdhzCount:${AppConfig.wnVideoAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " + "csjFullCount:${AppConfig.csjFullVedioAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " + "shCount:${AppConfig.shVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount} ") "flCount:${AppConfig.flVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount} "
)
} }
private fun initExpress(flowAdRules: FlowAdRulesBean) { private fun initExpress(flowAdRules: FlowAdRulesBean) {
......
...@@ -9,6 +9,7 @@ import android.text.TextUtils; ...@@ -9,6 +9,7 @@ import android.text.TextUtils;
import com.wenshu.youyou.manager.TrackManager; import com.wenshu.youyou.manager.TrackManager;
import com.wenshu.youyou.mvp.presenters.VersionUpdatePresenter; import com.wenshu.youyou.mvp.presenters.VersionUpdatePresenter;
import com.wenshu.youyou.ui.activitys.SplashADActivity; import com.wenshu.youyou.ui.activitys.SplashADActivity;
import com.wenshu.youyou.ui.activitys.SplashCsjADActivity;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
...@@ -23,11 +24,14 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -23,11 +24,14 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
private static ForegroundOrBackground instance; private static ForegroundOrBackground instance;
public int count = 0; public int count = 0;
private volatile boolean isYlhSplash = false;
private Intent ylhIntent;
private Intent csjIntent;
//获取当前最上层的activity //获取当前最上层的activity
private static WeakReference<Activity> app_activity; private static WeakReference<Activity> app_activity;
private VersionUpdatePresenter vup; private VersionUpdatePresenter vup;
private WeakReference<Activity> reference; private WeakReference<Activity> reference;
private Intent intent;
public static ForegroundOrBackground init(Application application) { public static ForegroundOrBackground init(Application application) {
if (instance == null) { if (instance == null) {
...@@ -99,10 +103,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -99,10 +103,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted"); // LogUtil.d("ForegroundOrBackground", System.currentTimeMillis() - leaveTime + " onActivityStarted");
// 60秒后打开应用 显示开屏广告 // 60秒后打开应用 显示开屏广告
if (System.currentTimeMillis() - leaveTime >= 60000) { if (System.currentTimeMillis() - leaveTime >= 60000) {
if (intent == null) {
intent = new Intent(activity, SplashADActivity.class); if (isYlhSplash) {
isYlhSplash = false;
if (ylhIntent == null) {
// 优量汇广告
ylhIntent = new Intent(activity, SplashADActivity.class);
}
activity.startActivity(ylhIntent);
} else {
isYlhSplash = true;
if (csjIntent == null) {
// 快手广告
csjIntent = new Intent(activity, SplashCsjADActivity.class);
}
activity.startActivity(csjIntent);
// if (ksIntent == null) {
// // 快手广告
// ksIntent = new Intent(activity, SplashKsADActivity.class);
// }
// activity.startActivity(ksIntent);
} }
activity.startActivity(intent);
} }
} }
count++; count++;
......
...@@ -82,10 +82,10 @@ ...@@ -82,10 +82,10 @@
MiniprogramType="0" Path="pages/index/index.html?id=1" SortId="4" MiniprogramType="0" Path="pages/index/index.html?id=1" SortId="4"
UserName="gh_afb25ac019c9" WithShareTicket="true" /> UserName="gh_afb25ac019c9" WithShareTicket="true" />
<WechatMoments AppId="wxc8ac2985f6a805e2" AppSecret="05ec1f88c19ef905325ad4a316f62e9d" BypassApproval="false" <WechatMoments AppId="wxa9c7cc9c01db59f1" AppSecret="4d317618b7205c56992219f195349a2c" BypassApproval="false"
Enable="true" Id="5" SortId="5" /> Enable="true" Id="5" SortId="5" />
<WechatFavorite AppId="wx4868b35061f87885" AppSecret="64020361b8ec4c99936c0e3999a9f249" Enable="true" <WechatFavorite AppId="wxa9c7cc9c01db59f1" AppSecret="4d317618b7205c56992219f195349a2c" Enable="true"
Id="6" SortId="6" /> Id="6" SortId="6" />
<!-- ShareByAppClient标识是否使用微博客户端分享,默认是false --> <!-- ShareByAppClient标识是否使用微博客户端分享,默认是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