Commit 503e89c6 authored by jyx's avatar jyx

Merge branch 'dev_gro_more_haotu' into dev_ad

# Conflicts:
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/GroMoreCarrierExpressManager.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/GroMoreExpressManager.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/PreLoadExpressManager.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/CsjGroMoreVideoAdManager.java
#	GoodMoney/app/src/main/java/com/mints/goodmoney/manager/CsjAppLogManager.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/FoodSubsidyActivity.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SplashGroMoreActivity.java
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WalkActivity.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WaterActivity.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
#	GoodMoney/app/src/main/java/com/mints/goodmoney/utils/ForegroundOrBackground.java
#	GoodMoney/build.gradle
parents 729994a5 6bdad092
......@@ -5,8 +5,6 @@ apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'android-aspectjx'
apply plugin: 'com.sensorsdata.analytics.android'
apply plugin: 'com.bytedance.std.tracker'
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
......@@ -225,21 +223,6 @@ dependencies {
implementation(name: 'umeng-asms-armeabi-v1.2.2', ext: 'aar')
implementation(name: 'umeng-apm-armeabi-v1.2.0', ext: 'aar')
// TalkingDada(已集成)
// 一览视频
implementation("com.yilan.sdk:ui:3.3.3.0") {
exclude group: 'com.yilan.sdk', module: 'yb_extra'
exclude group: 'com.yilan.sdk', module: 'gdt'
exclude group: 'com.yilan.sdk', module: 'ks'
}
implementation('com.aliyun.ams:alicloud-android-httpdns:1.2.3@aar') {
transitive true
}
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
// 数美
implementation files('libs/smantifraud.aar')
// 猎豹游戏
......@@ -360,18 +343,10 @@ dependencies {
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// 穿山甲 GroMore
// mediation_ad_sdk
implementation(name: 'mediation_ad_sdk_2.7.1.2', ext: 'aar')
implementation(name: 'gdt_adapter_4.351.1221.1', ext: 'aar')
implementation(name: 'ks_adapter_3.3.9.0', ext: 'aar')
// 穿山甲广告
implementation(name: 'open_ad_sdk_3.6.1.3', ext: 'aar')
implementation(name: 'open_ad_sdk_4.0.1.1', ext: 'aar')
// 广点通广告 腾讯
implementation(name: 'GDTSDK.unionNormal.4.351.1221', ext: 'aar')
implementation(name: 'GDTSDK.unionNormal.4.420.1290', ext: 'aar')
// 快手
implementation(name: 'kssdk-ad-3.3.9', ext: 'aar')
// implementation(name: 'kssdk-all--3.3.16-publishRelease-9ffe2b94e', ext: 'aar')
// applog
implementation 'com.bytedance.applog:RangersAppLog-All-cn:5.2.6'
implementation(name: 'kssdk-all--3.3.16-publishRelease-9ffe2b94e', ext: 'aar')
}
......@@ -131,17 +131,6 @@
<!-- </intent-filter>-->
<!-- </activity>-->
<activity
android:name=".ui.activitys.SplashGroMoreActivity"
android:screenOrientation="portrait"
android:theme="@style/NormalSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activitys.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
......@@ -210,7 +199,13 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SplashCsjADActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:theme="@style/NormalSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activitys.MorningClockActivity"
android:screenOrientation="portrait" />
......@@ -258,9 +253,6 @@
<activity
android:name=".ui.activitys.ShaiziActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SplashGroMoreBackgroundActivity"
android:screenOrientation="portrait" />
<service
android:name=".service.UpdateService"
......@@ -319,8 +311,10 @@
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent1111016251" />
</intent-filter>
</activity>
......
......@@ -12,8 +12,6 @@ import androidx.multidex.MultiDexApplication;
import com.hjq.toast.ToastUtils;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.CsjAppLogManager;
import com.mints.goodmoney.manager.CsjGroMoreManager;
import com.mints.goodmoney.manager.KsManager;
import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MhManager;
......@@ -24,7 +22,6 @@ import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.TzManager;
import com.mints.goodmoney.manager.WnManager;
import com.mints.goodmoney.manager.XmManager;
import com.mints.goodmoney.manager.YlVideoManager;
import com.mints.goodmoney.manager.YlhAdManager;
import com.mints.goodmoney.net.LoanService;
import com.mints.goodmoney.utils.ForegroundOrBackground;
......@@ -129,12 +126,6 @@ public class MintsApplication extends MultiDexApplication {
// 穿山甲
TtCsjAdManager.init(this);
// GroMore
CsjGroMoreManager.INSTANCE.init(this);
// AppLog
CsjAppLogManager.INSTANCE.init(this);
// 快手
KsManager.INSTANCE.initKs(this);
......@@ -153,9 +144,6 @@ public class MintsApplication extends MultiDexApplication {
//小满
XmManager.INSTANCE.initXm(this);
// 一览视频
YlVideoManager.INSTANCE.init(this);
// 猎豹游戏初始化
LiebaoManager.getInstance().initCmGameSdk();
......
......@@ -10,18 +10,11 @@ import com.mints.goodmoney.manager.TtCsjAdManager
object ExpressManager {
fun loadExpress() {
if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
} else {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
}
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
......@@ -12,7 +12,6 @@ import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.kwad.sdk.api.*
import com.kwad.sdk.api.KsNativeAd.VideoPlayListener
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.manager.KsManager
......@@ -88,7 +87,7 @@ object KsPreLoadExpressManager {
// 设置广告数据
bindCommonData(convertView as ViewGroup, videoViewHolder, ksNativeAd)
ksNativeAd.setVideoPlayListener(object : VideoPlayListener {
ksNativeAd.setVideoPlayListener(object : KsNativeAd.VideoPlayListener {
override fun onVideoPlayStart() {
}
......
package com.mints.goodmoney.ad.express
import android.annotation.SuppressLint
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.bytedance.msdk.api.nativeAd.TTNativeAd
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.WeightBean
......@@ -11,11 +11,12 @@ import com.mints.goodmoney.utils.LogUtil
import com.qq.e.ads.nativ.NativeExpressADView
import java.util.*
/**
* 预加载信息流管理类
*/
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener, GMADLoadSuccessListener {
@SuppressLint("StaticFieldLeak")
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener,
KSADLoadSuccessListener {
private val TAG = PreLoadExpressManager::class.java.simpleName
......@@ -36,7 +37,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
YlhPreLoadExpressManager.setListener(this)
TTPreLoadExpressManager.getInstance().setListener(this)
KsPreLoadExpressManager.setListener(this)
GroMoreExpressManager.instance.setListener(this)
// GroMoreExpressManager.instance.setListener(this)
}
fun init(csjWeight: Int, ylhWeight: Int, ksWeight: Int, gmWeight: Int) {
......@@ -62,10 +63,11 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// }
when (getRandomWeight()) {
Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout)
Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance()
.loadTtFrameLayout(mAdFrameLayout)
Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout()
Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup)
Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout()
// Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout()
else -> {
TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout)
}
......@@ -152,13 +154,6 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
mAdFrameLayout?.addView(view)
}
override fun onGMAdLoadSuc(ttNativeAd: View?) {
// if (currentIndex == 3) {
// mAdFrameLayout?.addView(view)
// }
mAdFrameLayout?.addView(ttNativeAd)
}
}
interface TTADLoadSuccessListener {
......@@ -172,7 +167,3 @@ interface YLHADLoadSuccessListener {
interface KSADLoadSuccessListener {
fun onKSAdLoadSuc(ksNativeAd: View?)
}
\ No newline at end of file
interface GMADLoadSuccessListener {
fun onGMAdLoadSuc(ttNativeAd: View?)
}
\ No newline at end of file
......@@ -141,6 +141,10 @@ public class CsjFullVideoAdManager extends BaseVideoAd {
}
}
}
@Override
public void onFullScreenVideoCached(TTFullScreenVideoAd ttFullScreenVideoAd) {
}
});
}
......
......@@ -151,7 +151,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
public void onError(int code, String message) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_ONE, String.valueOf(code), message);
LogUtil.d(TAG, "onError " + code + message);
if (videoAdStatusListener != null) {
videoAdStatusListener.adFail();
......@@ -174,6 +173,10 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
}
@Override
public void onRewardVideoCached(TTRewardVideoAd ttRewardVideoAd) {
}
//视频广告的素材加载完毕,比如视频url等,在此回调后,可以播放在线视频,网络不好可能出现加载缓冲,影响体验。
@Override
public void onRewardVideoAdLoad(TTRewardVideoAd ad) {
......
......@@ -41,7 +41,6 @@ public class VideoAdingManager {
private ShVideoAdManager shVideoAdManager;
private CsjFullVideoAdManager csjFullVideoAdManager;
private KsVideoAdManager ksVideoAdManager;
private CsjGroMoreVideoAdManager csjGroMoreVideoAdManager;
private OwVideoAdManager owVideoAdManager;
private int wnWeight;
......@@ -91,7 +90,6 @@ public class VideoAdingManager {
shVideoAdManager = ShVideoAdManager.Companion.getInstance(activity);
csjFullVideoAdManager = CsjFullVideoAdManager.getInstance(activity);
ksVideoAdManager = KsVideoAdManager.Companion.getInstance(activity);
csjGroMoreVideoAdManager = CsjGroMoreVideoAdManager.getInstance(activity);
owVideoAdManager = OwVideoAdManager.Companion.getInstance();
weightList = new ArrayList<>();
}
......@@ -460,11 +458,11 @@ public class VideoAdingManager {
owVideoAdManager.onDestroy();
owVideoAdManager = null;
}
if (csjGroMoreVideoAdManager != null) {
csjGroMoreVideoAdManager.setVideoAdStatusListener(null);
csjGroMoreVideoAdManager.onDestroy();
csjGroMoreVideoAdManager = null;
}
// if (csjGroMoreVideoAdManager != null) {
// csjGroMoreVideoAdManager.setVideoAdStatusListener(null);
// csjGroMoreVideoAdManager.onDestroy();
// csjGroMoreVideoAdManager = null;
// }
if (mReceiverBroadcastReceiver != null) {
activity.stopService(new Intent(activity, AppInstallService.class));
......@@ -566,7 +564,6 @@ public class VideoAdingManager {
return;
}
csjVideoAdManager = CsjVideoAdManager.getInstance(activity);
// csjVideoAdManager = CsjVideoAdManager.getInstance();
}
......@@ -815,43 +812,6 @@ public class VideoAdingManager {
}
});
owVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} else if (TextUtils.equals(videoAdType, Constant.GROMORE_VEDIO_AD)) {
// GROMORE广告激励视频
if (csjGroMoreVideoAdManager == null) {
if (activity == null) {
if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerError(Constant.GROMORE_VEDIO_AD);
}
return;
}
csjGroMoreVideoAdManager = CsjGroMoreVideoAdManager.getInstance(activity);
}
csjGroMoreVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
public void adSuccess() {
AppConfig.groMoreVideoAdCount--;
if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerSuccess(Constant.GROMORE_VEDIO_AD);
}
}
@Override
public void adFail() {
if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerFail(Constant.GROMORE_VEDIO_AD);
}
}
@Override
public void adDownload() {
isVideoAdDownload = true;
// 注册下载任务监听
registerBroad();
}
});
csjGroMoreVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -59,6 +59,10 @@ public class BxmPlayVideo {
public void onRewardVideoCached() {
}
@Override
public void onRewardVideoCached(TTRewardVideoAd ttRewardVideoAd) {
}
});
} catch (Throwable e) {
appNative.onError(0);
......
package com.mints.goodmoney.manager
import android.app.Application
import com.bytedance.applog.AppLog
import com.bytedance.applog.InitConfig
import com.bytedance.applog.util.UriConstants
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.utils.LogUtil
import com.mints.library.utils.CommonUtils
private val TAG = CsjAppLogManager::class.java.simpleName
object CsjAppLogManager {
fun init(application: Application) {
/* 初始化开始 */
val config = InitConfig("229031", CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") + HumeSDK.getChannel(MintsApplication.getContext())) // appid和渠道,appid如不清楚请联系对接同学
//上报域名只支持中国
config.setUriConfig(UriConstants.DEFAULT)
// 是否在控制台输出日志,可用于观察用户行为日志上报情况
// config.setLogger { msg, t -> LogUtil.d(TAG, "$msg -> $t") }
config.setAutoStart(true)
AppLog.init(application, config)
/* 初始化结束 */
/* 自定义 “用户公共属性”(可选,初始化后调用, key相同会覆盖)
关于自定义 “用户公共属性” 请注意:1. 上报机制是随着每一次日志发送进行提交,默认的日志发送频率是1分钟,所以如果在一分钟内连续修改自定义用户公共属性,,按照日志发送前的最后一次修改为准, 2. 不推荐高频次修改,如每秒修改一次 */
//Map<String,Object> headerMap = new HashMap<String, Object>();
//headerMap.put("your_custom_key","your_custom_value");
//AppLog.setHeaderInfo((HashMap<String, Object>)headerMap);
//移除公共属性
//AppLog.removeHeaderInfo("your_custom_key");
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ object CsjGroMoreManager {
var AD_UNIT_VIDEO_ID = "946018378" // 激励视频
fun init(application: MintsApplication) {
TTGroMoreAdManagerHolder.init(application)
// TTGroMoreAdManagerHolder.init(application)
}
/**
......
......@@ -12,6 +12,8 @@ import com.mints.goodmoney.R
*/
object KsManager {
const val KS_CONTENT = 5746000049L
private const val KS_APP_ID = "574600005"
/* splash-postid */
......
......@@ -3,9 +3,6 @@ package com.mints.goodmoney.manager;
import android.content.Context;
import com.bytedance.sdk.openadsdk.TTAdConfig;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.cmcm.cmgame.CmGameSdk;
import com.cmcm.cmgame.gamedata.CmGameAppInfo;
import com.mints.goodmoney.BuildConfig;
......@@ -55,20 +52,30 @@ public class LiebaoManager {
* 游戏SDK初始化
*/
public void initCmGameSdk() {
final String adAppId = TtCsjAdManager.TT_AD_APPID; // 穿山甲appid
TTAdSdk.init(context,
new TTAdConfig.Builder()
.appId(adAppId)
.useTextureView(false) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.appName(TtCsjAdManager.TT_AD_NAME)
.titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
.allowShowNotify(true) //是否允许sdk展示通知栏提示
.allowShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页
.debug(BuildConfig.DEBUG) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.supportMultiProcess(false) //是否支持多进程,true支持
.build());
// final String adAppId = TtCsjAdManager.TT_AD_APPID; // 穿山甲appid
// TTAdSdk.init(context,
// new TTAdConfig.Builder()
// .appId(adAppId)
// .useTextureView(false) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
// .appName(TtCsjAdManager.TT_AD_NAME)
// .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
// .allowShowNotify(true) //是否允许sdk展示通知栏提示
// .allowShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页
// .debug(BuildConfig.DEBUG) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
// .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
// .supportMultiProcess(false) //是否支持多进程,true支持
// .build(), new TTAdSdk.InitCallback() {
// @Override
// public void success() {
//
// }
//
// @Override
// public void fail(int i, String s) {
//
// }
// });
CmGameAppInfo cmGameAppInfo = new CmGameAppInfo();
......
......@@ -196,6 +196,11 @@ public class ReadToutiaoAD {
LogUtils.i("ToutiaoAd", "rewardVideoAd video cached");
}
@Override
public void onRewardVideoCached(TTRewardVideoAd ttRewardVideoAd) {
}
//视频广告素材加载到,如title,视频url等,不包括视频文件
@Override
public void onRewardVideoAdLoad(TTRewardVideoAd ad) {
......
package com.mints.goodmoney.manager;
import android.app.Activity;
import android.content.Context;
import android.provider.Settings;
import com.bytedance.hume.readapk.HumeSDK;
import com.bytedance.msdk.api.TTAdConfig;
import com.bytedance.msdk.api.TTAdConstant;
import com.bytedance.msdk.api.TTMediationAdSdk;
import com.bytedance.msdk.api.UserInfoForSegment;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.library.utils.CommonUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 可以用一个单例来保存TTAdManager实例,在需要初始化sdk的时候调用
*/
public class TTGroMoreAdManagerHolder {
public static final String TT_AD_APPID = "5113521";
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
private static boolean sInit;
public static void init(Context context) {
doInit(context);
}
public static void initUnitySdkBanner(Activity activity) {
TTMediationAdSdk.initUnityForBanner(activity);
}
//step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
private static void doInit(Context context) {
if (!sInit) {
TTMediationAdSdk.initialize(context, buildConfig(context));
sInit = true;
}
}
private static TTAdConfig buildConfig(Context context) {
UserInfoForSegment userInfo = new UserInfoForSegment();
userInfo.setUserId(UserManager.getInstance().getUserID());
userInfo.setGender(UserInfoForSegment.GENDER_UNKNOWN);
userInfo.setChannel(CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"));
userInfo.setSubChannel(HumeSDK.getChannel(MintsApplication.getContext()));
userInfo.setAge(999);
userInfo.setUserValueGroup("msdk demo user value group");
Map<String, String> customInfos = new HashMap<>();
// customInfos.put("aaaa", "test111");
// customInfos.put("bbbb", "test222");
userInfo.setCustomInfos(customInfos);
return new TTAdConfig.Builder()
.appId(TT_AD_APPID) //必填 ,不能为空
.appName(TT_AD_NAME) //必填,不能为空
.openAdnTest(false)//开启第三方ADN测试时需要设置为true,会每次重新拉去最新配置,release 包情况下必须关闭.默认false
.isPanglePaid(false)//是否为费用户
.setPublisherDid(getAndroidId(context)) //用户自定义device_id
.openDebugLog(BuildConfig.DEBUG) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.usePangleTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView
.setPangleTitleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)
.allowPangleShowNotify(true) //是否允许sdk展示通知栏提示
.allowPangleShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页
.setPangleDirectDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.needPangleClearTaskReset()//特殊机型过滤,部分机型出现包解析失败问题(大部分是三星)。参数取android.os.Build.MODEL
.setUserInfoForSegment(userInfo) // 设置流量分组的信息
.build();
}
public static String getAndroidId(Context context) {
String androidId = null;
try {
androidId = Settings.System.getString(context.getContentResolver(), Settings.System.ANDROID_ID);
} catch (Exception e) {
e.printStackTrace();
}
return androidId;
}
}
......@@ -6,10 +6,9 @@ import com.bytedance.sdk.openadsdk.TTAdConfig;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.mvp.model.AdcodeBean;
import com.mints.library.utils.CommonUtils;
import com.mints.goodmoney.utils.LogUtil;
/**
* 穿山甲广告
......@@ -82,7 +81,17 @@ public class TtCsjAdManager {
//step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
private static void doInit(Context context) {
if (!sInit) {
TTAdSdk.init(context, buildConfig(context));
TTAdSdk.init(context, buildConfig(context), new TTAdSdk.InitCallback() {
@Override
public void success() {
LogUtil.d("TTAdSdk init success");
}
@Override
public void fail(int i, String s) {
LogUtil.d("TTAdSdk init fail " + i + " " + s);
}
});
sInit = true;
}
}
......@@ -107,7 +116,7 @@ public class TtCsjAdManager {
.allowShowNotify(true) //是否允许sdk展示通知栏提示
.allowShowPageWhenScreenLock(false) //是否在锁屏场景支持展示广告落地页
.debug(logFlag) //测试阶段打开,可以通过日志排查问题,上线时去除该调用
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI, TTAdConstant.NETWORK_STATE_4G, TTAdConstant.NETWORK_STATE_3G) //允许直接下载的网络状态集合
.supportMultiProcess(false)//是否支持多进程
//.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。
.build();
......
package com.mints.goodmoney.manager
import android.app.Application
import com.yilan.sdk.ui.YLUIInit
import com.yilan.sdk.ui.configs.CommentConfig
import com.yilan.sdk.ui.configs.FeedConfig
import com.yilan.sdk.ui.configs.YLUIConfig
/**
* 描述:一览视频(好兔)
* 作者:孟崔广
*/
object YlVideoManager {
private const val ACCESSKEY = "ylxgszgwjrr8"
private const val ACCESSTOKEN = "lmnzhm9yjdlc86xiy74cjgixnqpxe4o2"
fun init(application: Application) {
YLUIInit.getInstance()
.setCrashOpen(false)
.setApplication(application)
.setAccessKey(ACCESSKEY)
.setAccessToken(ACCESSTOKEN)
.build()
//页面个性化配置
YLUIConfig.getInstance() //抖音样式小视频配置
.littleLikeShow(true) //是否显示点赞
.littleShareShow(false) //是否显示分享
.littleShowGuide(true) //是否显示新手引导滑动浮层(第一次安装进入显示)
.littleComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
//feed流短视频样式配置
.videoComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
.videoLikeShow(false) //是否显示点赞
.videoShareShow(false) //是否显示分享
.followAvailable(false) //关注功能是否可用
.feedAvatarClickable(true) //头像是否支持点击跳转到作者页面
.feedPlayAuto(true) //feed自动播放
.feedSwipeRefreshEnable(true) //feed是否可以下拉刷新
FeedConfig.getInstance().playerStyle = FeedConfig.STYLE_FEED_PLAY //FeedConfig.STYLE_FEED_PLAY当前页面播放
}
}
\ No newline at end of file
......@@ -3,23 +3,16 @@ package com.mints.goodmoney.ui.activitys
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.video.CsjGroMoreVideoAdManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.AdBannerAdapter
import com.mints.goodmoney.utils.ToastUtil
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil
import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.*
/**
......@@ -44,7 +37,6 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n 广告代码位:" + AppConfig.user_channel_ad +
"\n 头条渠道:" + HumeSDK.getChannel(context))
// CsjGroMoreVideoAdManager.getInstance(AboutusActivity@this).loadAd(AboutusActivity@this,0,"","")
true
}
......
......@@ -11,7 +11,6 @@ import android.view.KeyEvent
import android.view.View
import androidx.core.content.ContextCompat
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
......
......@@ -3,8 +3,9 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter
import com.mints.goodmoney.mvp.views.FoodSubsidyView
......@@ -18,7 +19,8 @@ import kotlinx.android.synthetic.main.activity_food_subsidy.*
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyView, StepView.StepViewListener, MealView.MealViewListener {
class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyView,
StepView.StepViewListener, MealView.MealViewListener {
private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() }
......@@ -87,8 +89,8 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
}
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
ExpressManager.loadExpress()
TTPreLoadCarrierExpressManager.getInstance()
.loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
}
......@@ -99,7 +101,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
try {
if (flSubsidykAd != null) {
flSubsidykAd.removeAllViews()
flSubsidykAd.addView(ExpressManager.getExpressFrameLayout())
flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -23,7 +23,7 @@ class MokuGuideActivity : BaseActivity(), View.OnClickListener {
override fun finish() {
super.finish()
//关闭窗体动画显示
overridePendingTransition(0, R.anim.bottom_out)
overridePendingTransition(0, R.anim.push_bottom_out)
}
override fun initViewsAndEvents() {
......
......@@ -5,11 +5,11 @@ import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MorningClockBean
import com.mints.goodmoney.mvp.model.VideoAdingBean
......@@ -66,7 +66,8 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
awardVideo()
// 预加载信息流
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
TTPreLoadCarrierExpressManager.getInstance()
.loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
}
}
}
......@@ -76,16 +77,19 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
morningClockList = data.targetList
if (data.isCanClick) {
tvMorningClockClick.background = ContextCompat.getDrawable(mContext, R.drawable.shape_water_btn)
tvMorningClockClick.background =
ContextCompat.getDrawable(mContext, R.drawable.shape_water_btn)
tvMorningClockClick.isEnabled = true
} else {
tvMorningClockClick.background = ContextCompat.getDrawable(mContext, R.drawable.shape_tv_gold_none)
tvMorningClockClick.background =
ContextCompat.getDrawable(mContext, R.drawable.shape_tv_gold_none)
tvMorningClockClick.isEnabled = false
}
tvMorningClockClick.text = data.buttonMsg
tvMorningClockDay.text = SpanUtils()
.append("打卡领金币 已连续打卡")
.append("${data.continuityDays}").setForegroundColor(ContextCompat.getColor(mContext, R.color.color_FF9837))
.append("${data.continuityDays}")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.color_FF9837))
.append("天")
.create()
......@@ -128,7 +132,11 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
/**
* 加载激励视频
*/
private fun loadVideo(videoAdingManager: VideoAdingManager, bean: VideoAdingBean, isFirstLoad: Boolean) {
private fun loadVideo(
videoAdingManager: VideoAdingManager,
bean: VideoAdingBean,
isFirstLoad: Boolean
) {
videoAdingManager.setVideoAdingListener(object : VideoAdingManager.VideoAdingListener {
override fun videoAdingListenerError(adType: String) {
showToast("加载超时,请休息一下")
......@@ -186,7 +194,7 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
try {
if (flMorningClockAd != null) {
flMorningClockAd.removeAllViews()
flMorningClockAd.addView(ExpressManager.getExpressFrameLayout())
flMorningClockAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -8,7 +8,6 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.yilan.sdk.ui.little.YLLittleVideoFragment
import kotlinx.android.synthetic.main.activity_splash.*
import net.grandcentrix.tray.AppPreferences
......@@ -63,9 +62,6 @@ class SplashActivity : BaseActivity() {
if (!deviceInfo.signInfo) {
finish()
} else {
// 预加载好兔视频
YLLittleVideoFragment.preloadVideo()
setAnimation()
}
}
......
package com.mints.goodmoney.ui.activitys
import android.text.TextUtils
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.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.CommonUtils
import net.grandcentrix.tray.AppPreferences
private val TAG = SplashCsjADActivity::class.java.simpleName
......@@ -18,6 +24,9 @@ private val TAG = SplashCsjADActivity::class.java.simpleName
* 后台返回时每次都展示 快手广告
*/
class SplashCsjADActivity : BaseActivity() {
private val ps by lazy { AppPreferences(context) }
private var container: ViewGroup? = null
private var mIsPaused = false
var canJump = false
......@@ -143,7 +152,18 @@ class SplashCsjADActivity : BaseActivity() {
}
private fun readyGoOtherActivity() {
finish()
val customVersion: Int = ps.getInt(Constant.CUSTOM_VERSION, 0)
val isFirstEnter: Boolean = ps.getBoolean(Constant.ISFIRSTENTER + customVersion, true)
if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java)
} else {
val channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
} else {
readyGoThenKill(MainActivity::class.java)
}
}
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.FrameLayout;
import com.bytedance.msdk.adapter.pangle.PangleNetworkRequestInfo;
import com.bytedance.msdk.api.AdError;
import com.bytedance.msdk.api.AdSlot;
import com.bytedance.msdk.api.NetworkPlatformConst;
import com.bytedance.msdk.api.TTNetworkRequestInfo;
import com.bytedance.msdk.api.splash.TTSplashAd;
import com.bytedance.msdk.api.splash.TTSplashAdListener;
import com.bytedance.msdk.api.splash.TTSplashAdLoadCallback;
import com.mints.goodmoney.R;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.CsjGroMoreManager;
import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.ui.activitys.base.BaseActivity;
import com.mints.goodmoney.utils.LogUtil;
import java.util.HashMap;
/**
* GroMore开屏广告Activity示例
*/
public class SplashGroMoreBackgroundActivity extends BaseActivity {
private static final String TAG = "SplashGroMoreActivity";
private TTSplashAd mTTSplashAd;
private FrameLayout mSplashContainer;
//是否强制跳转到主页面
private boolean mForceGoMain;
//开屏广告加载超时时间,建议大于1000,这里为了冷启动第一次加载到广告并且展示,示例设置了2000ms
private static final int AD_TIME_OUT = 4000;
private static final int MSG_GO_MAIN = 1;
//开屏广告是否已经加载
private boolean mHasLoaded;
// 百度开屏广告点击跳转落地页后倒计时不暂停,即使在看落地页,倒计时结束后仍然会强制跳转,需要特殊处理:
// 检测到广告被点击,且走了activity的onPaused证明跳转到了落地页,这时候onAdDismiss回调中不进行跳转,而是在activity的onResume中跳转。
private boolean isBaiduSplashAd = false;
private boolean baiduSplashAdClicked = false;
private boolean onPaused = false;
@Override
protected int getContentViewLayoutID() {
return R.layout.activity_splash_gromore_back;
}
@Override
protected void initViewsAndEvents() {
try {
mSplashContainer = findViewById(R.id.splash_container);
//加载开屏广告
loadSplashAd();
} catch (Exception e) {
goToMainActivity();
}
}
/**
* 加载开屏广告
*/
private void loadSplashAd() {
/**
* 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题
* ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);)
*/
mTTSplashAd = new TTSplashAd(this, CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID());
mTTSplashAd.setTTAdSplashListener(mSplashAdListener);
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder()
.setImageAdSize(1080, 1920) // 既适用于原生类型,也适用于模版类型。
.build();
//自定义兜底方案 选择使用
TTNetworkRequestInfo ttNetworkRequestInfo;
//穿山甲兜底
ttNetworkRequestInfo = new PangleNetworkRequestInfo(TtCsjAdManager.TT_AD_APPID, TtCsjAdManager.TT_AD_GRO_SPLASH);
//gdt兜底
// ttNetworkRequestInfo = new GdtNetworkRequestInfo(YlhAdManager.YLH_AD_APPID, "2001697222975737");
//ks兜底
// ttNetworkRequestInfo = new KsNetworkRequestInfo("90009", "4000000042");
//百度兜底
// ttNetworkRequestInfo = new BaiduNetworkRequestInfo("e866cfb0", "2058622");
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
mTTSplashAd.loadAd(adSlot, ttNetworkRequestInfo, new TTSplashAdLoadCallback() {
// mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() {
@Override
public void onSplashAdLoadFail(AdError adError) {
LogUtil.d(TAG, adError.message);
mHasLoaded = true;
Log.e(TAG, "load splash ad error : " + adError.code + ", " + adError.message);
// 获取本次waterfall加载中,加载失败的adn错误信息。
if (mTTSplashAd != null)
LogUtil.d(TAG, "ad load infos: " + mTTSplashAd.getAdLoadInfoList());
goToMainActivity();
}
@Override
public void onSplashAdLoadSuccess() {
if (mTTSplashAd != null) {
mTTSplashAd.showAd(mSplashContainer);
isBaiduSplashAd = mTTSplashAd.getAdNetworkPlatformId() == NetworkPlatformConst.SDK_NAME_BAIDU;
// 获取本次waterfall加载中,加载失败的adn错误信息。
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mTTSplashAd.getAdNetworkRitId());
vo.put("ecpm", mTTSplashAd.getPreEcpm());
vo.put("adSource", mTTSplashAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE0);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo);
}
Log.e(TAG, "load splash ad success ");
}
@Override
public void onAdLoadTimeout() {
mHasLoaded = true;
Log.i(TAG, "开屏广告加载超时.......");
// 获取本次waterfall加载中,加载失败的adn错误信息。
if (mTTSplashAd != null)
LogUtil.d(TAG, "ad load infos: " + mTTSplashAd.getAdLoadInfoList());
goToMainActivity();
}
}, AD_TIME_OUT);
}
TTSplashAdListener mSplashAdListener = new TTSplashAdListener() {
@Override
public void onAdClicked() {
baiduSplashAdClicked = true;
LogUtil.d(TAG, "onAdClicked");
}
@Override
public void onAdShow() {
LogUtil.d(TAG, "onAdShow");
}
@Override
public void onAdSkip() {
LogUtil.d(TAG, "onAdSkip");
goToMainActivity();
}
@Override
public void onAdDismiss() {
LogUtil.d(TAG, "onAdDismiss");
if (isBaiduSplashAd && onPaused && baiduSplashAdClicked) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要在onResume中跳转主页。
return;
}
goToMainActivity();
}
};
@Override
protected void onResume() {
//判断是否该跳转到主页面
if (mForceGoMain) {
goToMainActivity();
}
if (isBaiduSplashAd && onPaused && baiduSplashAdClicked) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity();
}
super.onResume();
}
@Override
protected void onPause() {
super.onPause();
onPaused = true;
}
@Override
protected void onStop() {
super.onStop();
mForceGoMain = true;
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mTTSplashAd != null) {
mTTSplashAd.destroy();
}
}
@Override
protected boolean isApplyKitKatTranslucency() {
return false;
}
/**
* 跳转到主页面
*/
private void goToMainActivity() {
finish();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
}
}
......@@ -21,7 +21,6 @@ import com.mints.library.utils.CommonUtils
import com.qq.e.ads.splash.SplashAD
import com.qq.e.ads.splash.SplashADListener
import com.qq.e.comm.util.AdError
import com.yilan.sdk.ui.little.YLLittleVideoFragment
import net.grandcentrix.tray.AppPreferences
/**
......@@ -101,7 +100,6 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
if (!deviceInfo.signInfo) {
baseApplication.exitApp()
} else {
YLLittleVideoFragment.preloadVideo()
try {
container = findViewById<View>(R.id.splash_container) as ViewGroup
fetchSplashAD(this, container, skipView, YlhAdManager.YLH_AD_SPLASH_POSTID, this, 0)
......
......@@ -3,8 +3,9 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.WalkBean
import com.mints.goodmoney.mvp.presenters.WalkPresenter
import com.mints.goodmoney.mvp.views.WalkView
......@@ -98,8 +99,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
}
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
ExpressManager.loadExpress()
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
}
/**
......@@ -109,7 +109,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
try {
if (flWalkAd != null) {
flWalkAd.removeAllViews()
flWalkAd.addView(ExpressManager.getExpressFrameLayout())
flWalkAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -3,8 +3,9 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.WaterBean
import com.mints.goodmoney.mvp.presenters.WaterPresenter
import com.mints.goodmoney.ui.activitys.base.BaseActivity
......@@ -16,7 +17,8 @@ import kotlinx.android.synthetic.main.activity_water.*
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener, com.mints.goodmoney.mvp.views.WaterView {
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener,
com.mints.goodmoney.mvp.views.WaterView {
private val waterPresenter by lazy { WaterPresenter() }
......@@ -68,7 +70,8 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
}
// 预加载信息流
ExpressManager.loadExpress()
TTPreLoadCarrierExpressManager.getInstance()
.loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
}
override fun clickForWaterSuc(waterCoin: Int) {
......@@ -112,7 +115,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
try {
if (flWaterAd != null) {
flWaterAd.removeAllViews()
flWaterAd.addView(ExpressManager.getExpressFrameLayout())
flWaterAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -349,6 +349,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
//视频广告加载后的视频文件资源缓存到本地的回调
override fun onRewardVideoCached() {}
override fun onRewardVideoCached(p0: TTRewardVideoAd?) {}
//视频广告素材加载到,如title,视频url等,不包括视频文件
override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) {
......
......@@ -42,8 +42,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
}
try {
if (TextUtils.equals(getClass().getSimpleName(), "SplashGroMoreActivity") ||
TextUtils.equals(getClass().getSimpleName(), "GuideActivity")) {
if (TextUtils.equals(getClass().getSimpleName(), "GuideActivity")) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
......
......@@ -8,6 +8,7 @@ import android.view.Gravity
import android.view.View
import android.widget.FrameLayout
import android.widget.LinearLayout
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
......@@ -23,9 +24,6 @@ import com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport
import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.TimeRender
import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.category.ChannelFragment
import kotlinx.android.synthetic.main.layout_red_bag.*
import kotlinx.android.synthetic.main.layout_red_box.*
import net.grandcentrix.tray.AppPreferences
......@@ -43,7 +41,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
private val ps by lazy { AppPreferences(context) }
private var channelFragment: ChannelFragment? = null
private var channelFragment: Fragment? = null
// 是否是第一次观看完视频
private var isFirstWatchVideo = true
......@@ -105,9 +103,6 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
override fun onPause() {
super.onPause()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
YLPlayerConfig.config().unRegisterPlayerCallback()
}
// 福袋动画停止
stopRedbox()
// 倒计时红包暂停
......@@ -138,7 +133,6 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
override fun onDestroy() {
super.onDestroy()
YLPlayerConfig.config().unRegisterPlayerCallback()
horizChannelPresenter.detachView()
}
......@@ -234,11 +228,17 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
}
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(30))
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(120), 0, 0)
paramsRedBox.gravity = Gravity.END
rl_fragment_main_redbox.layoutParams = paramsRedBox
......@@ -252,8 +252,12 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
val transaction: FragmentTransaction = childFragmentManager.beginTransaction()
if (channelFragment == null) {
channelFragment = ChannelFragment()
transaction.add(R.id.yilan_fragment_frame_container, channelFragment!!, ChannelFragment::class.java.simpleName)
channelFragment = MyFragment()
transaction.add(
R.id.yilan_fragment_frame_container,
channelFragment!!,
MyFragment::class.java.simpleName
)
} else {
transaction.show(channelFragment!!)
}
......@@ -345,49 +349,6 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
}
private fun registerPlayerCallBack() {
// 设置点击的item播放状态,callback返回true标识用户已经处理了event,返回false,标识使用播放器内部逻辑处理event。
YLPlayerConfig.config().registerPlayerCallBack(object : OnPlayerCallBack {
override fun onStart(p0: String?, videoid: String, p2: String?) {
// 防止网络异常时, 第一次加载倒计时红包
if (isFirstLoadVideo) {
isFirstLoadVideo = false
initTimeView()
} else {
resumeDownloadTime(videoid)
}
}
override fun onPause(p0: String?, p1: String?, p2: String?) {
pauseDownloadTime()
}
override fun onResume(p0: String?, videoid: String, p2: String?) {
resumeDownloadTime(videoid)
}
override fun onComplete(p0: String?, videoid: String, p2: String?) {
}
override fun onLoopComplete(pager: String?, videoID: String, taskID: String?, num: Int) {
pauseDownloadTime()
}
override fun onStuckStart(p0: String?, p1: String?, p2: String?) {
}
override fun onStuckEnd(p0: String?, p1: String?, p2: String?) {
}
override fun onError(p0: String?, p1: String?, p2: String?) {
pauseDownloadTime()
}
override fun onStop(p0: String?, p1: String?, p2: String?) {
// pauseDownloadTime()
}
})
}
private fun destoryTimerRedbox() {
......
......@@ -6,13 +6,9 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.mvp.presenters.VersionUpdatePresenter;
import com.mints.goodmoney.ui.activitys.SplashADActivity;
import com.mints.goodmoney.ui.activitys.SplashCsjADActivity;
import com.mints.goodmoney.ui.activitys.SplashGroMoreActivity;
import com.mints.goodmoney.ui.activitys.SplashGroMoreBackgroundActivity;
import java.lang.ref.WeakReference;
......@@ -96,8 +92,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// 每次返回应用时 都展示开屏广告
String simpleName = activity.getClass().getSimpleName();
if (TextUtils.equals(simpleName, "SplashYlhActivity") ||
TextUtils.equals(simpleName, "GuideActivity") ||
if (TextUtils.equals(simpleName, "GuideActivity") ||
TextUtils.equals(simpleName, "AwardActivity") ||
TextUtils.equals(simpleName, "DrawcashActivity")) {
count++;
......@@ -111,7 +106,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
// if (AppConfig.groMoreVideoAdCount > 0) {
if (groIntent == null) {
groIntent = new Intent(activity, SplashGroMoreBackgroundActivity.class);
groIntent = new Intent(activity, SplashCsjADActivity.class);
}
activity.startActivity(groIntent);
// } else {
......
package com.mints.goodmoney.utils;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
......@@ -12,7 +11,7 @@ import android.util.Log;
import androidx.annotation.RequiresApi;
import com.yilan.sdk.common.util.PermissionUtil;
import com.tz.sdk.core.utils.PermissionUtil;
import java.lang.reflect.Method;
......
......@@ -23,7 +23,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
android:src="@mipmap/ic_arrow_back_white" />
<ImageView
android:layout_width="wrap_content"
......
......@@ -22,7 +22,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
android:src="@mipmap/ic_arrow_back_white" />
<ImageView
android:layout_width="wrap_content"
......
......@@ -22,7 +22,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
android:src="@mipmap/ic_arrow_back_white" />
<ImageView
android:layout_width="wrap_content"
......
......@@ -22,7 +22,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
android:src="@mipmap/ic_arrow_back_white" />
<ImageView
android:layout_width="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<com.bytedance.msdk.api.format.TTNativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
......@@ -108,4 +108,4 @@
android:layout_marginRight="10dp" />
</RelativeLayout>
</com.bytedance.msdk.api.format.TTNativeAdView>
\ No newline at end of file
</FrameLayout>
\ No newline at end of file
......@@ -71,6 +71,9 @@ allprojects {
repositories {
google()
jcenter()
// maven { url 'https://dl.bintray.com/umsdk/release' }
// umeng仓库
maven { url 'https://repo1.maven.org/maven2/' }
maven { url "https://jitpack.io" }
//添加一览 maven地址
......
......@@ -16,8 +16,9 @@ android.injected.testOnly=false
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
DEBUG_URL="http://39.97.65.143:9082/api-gm/"
#DEBUG_URL="http://39.97.65.143:9082/api-gm/"
#DEBUG_URL="http://192.168.31.194:8101/"
DEBUG_URL="https://api.mints-id.com/api-gm/"
RELEASE_URL="https://api.mints-id.com/api-gm/"
RELEASE_KEY_PASSWORD=mints.goodmoney
......
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