Commit 2fdc23e3 authored by jyx's avatar jyx

更新通知栏广告为新插屏半屏

parent 0cd8cbbd
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/jniLibs"/></dataSet></merger> <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/debug/jniLibs"/></dataSet></merger>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/shaders"/></dataSet></merger> <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/debug/shaders"/></dataSet></merger>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/assets"/><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/intermediates/shader_assets/debug/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/assets"/></dataSet></merger> <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/main/assets"/><source path="/Users/hello/android_fiveworld/animlibrary/build/intermediates/shader_assets/debug/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/debug/assets"/></dataSet></merger>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res"/><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/rs/debug"/><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res"><file path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/res/values/attrs.xml" qualifiers=""><declare-styleable name="AnimatedSvgView"> <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/main/res"/><source path="/Users/hello/android_fiveworld/animlibrary/build/generated/res/rs/debug"/><source path="/Users/hello/android_fiveworld/animlibrary/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/main/res"><file path="/Users/hello/android_fiveworld/animlibrary/src/main/res/values/attrs.xml" qualifiers=""><declare-styleable name="AnimatedSvgView">
<attr format="integer" name="animatedSvgImageSizeX"/> <attr format="integer" name="animatedSvgImageSizeX"/>
<attr format="integer" name="animatedSvgImageSizeY"/> <attr format="integer" name="animatedSvgImageSizeY"/>
<attr format="string" name="animatedSvgTraceTime"/> <attr format="string" name="animatedSvgTraceTime"/>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<attr format="reference" name="animatedSvgTraceResidueColors"/> <attr format="reference" name="animatedSvgTraceResidueColors"/>
<attr format="integer" name="animatedSvgTraceMarkerLength"/> <attr format="integer" name="animatedSvgTraceMarkerLength"/>
<attr format="reference" name="animatedSvgFillColors"/> <attr format="reference" name="animatedSvgFillColors"/>
</declare-styleable></file></source><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/rs/debug"/><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/debug/res"/></dataSet><mergedItems><configuration qualifiers=""><declare-styleable name="AnimatedSvgView"> </declare-styleable></file></source><source path="/Users/hello/android_fiveworld/animlibrary/build/generated/res/rs/debug"/><source path="/Users/hello/android_fiveworld/animlibrary/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/hello/android_fiveworld/animlibrary/src/debug/res"/></dataSet><mergedItems><configuration qualifiers=""><declare-styleable name="AnimatedSvgView">
<attr format="integer" name="animatedSvgImageSizeX"/> <attr format="integer" name="animatedSvgImageSizeX"/>
<attr format="integer" name="animatedSvgImageSizeY"/> <attr format="integer" name="animatedSvgImageSizeY"/>
<attr format="string" name="animatedSvgTraceTime"/> <attr format="string" name="animatedSvgTraceTime"/>
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
4 4
5 <uses-sdk 5 <uses-sdk
6 android:minSdkVersion="14" 6 android:minSdkVersion="14"
6-->/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml 6-->/Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
7 android:targetSdkVersion="28" /> 7 android:targetSdkVersion="28" />
7-->/Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml 7-->/Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
8 8
9</manifest> 9</manifest>
-- Merging decision tree log --- -- Merging decision tree log ---
manifest manifest
ADDED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml:1:1-63 ADDED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml:1:1-63
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml:1:1-63 INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml:1:1-63
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml:1:1-63 INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml:1:1-63
package package
ADDED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml:1:11-61 ADDED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml:1:11-61
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
xmlns:android xmlns:android
ADDED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml:1:1-63 ADDED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml:1:1-63
uses-sdk uses-sdk
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml reason: use-sdk injection requested INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml reason: use-sdk injection requested
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
android:targetSdkVersion android:targetSdkVersion
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
ADDED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml ADDED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
android:minSdkVersion android:minSdkVersion
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
ADDED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml ADDED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
INJECTED from /Users/mcg/Documents/worker/androidspace/My5GWorld/animlibrary/src/main/AndroidManifest.xml INJECTED from /Users/hello/android_fiveworld/animlibrary/src/main/AndroidManifest.xml
package com.mints.fiveworld.ad.half;
import android.app.Activity;
import android.util.Log;
import com.bytedance.msdk.api.AdError;
import com.bytedance.msdk.api.v2.GMAdConstant;
import com.bytedance.msdk.api.v2.GMMediationAdSdk;
import com.bytedance.msdk.api.v2.GMSettingConfigCallback;
import com.bytedance.msdk.api.v2.ad.fullvideo.GMFullVideoAd;
import com.bytedance.msdk.api.v2.ad.fullvideo.GMFullVideoAdListener;
import com.bytedance.msdk.api.v2.ad.fullvideo.GMFullVideoAdLoadCallback;
import com.bytedance.msdk.api.v2.slot.GMAdOptionUtil;
import com.bytedance.msdk.api.v2.slot.GMAdSlotFullVideo;
import com.mints.fiveworld.ad.AdHelper;
import com.mints.fiveworld.ad.AdReportManager;
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener;
import com.mints.fiveworld.common.Constant;
import com.mints.fiveworld.manager.TrackManager;
import com.mints.fiveworld.manager.UserManager;
import com.mints.fiveworld.manager.ad.CsjGroMoreManager;
import com.mints.fiveworld.utils.LogUtil;
import com.mints.fiveworld.utils.TimeRender;
import java.lang.ref.WeakReference;
import java.util.HashMap;
/**
* 应用内外-全屏广告(新插屏 半屏) 通知栏
*/
public class Notice_NewOutSceneFull {
private static Notice_NewOutSceneFull _inst;
public static Notice_NewOutSceneFull getInstance() {
if (_inst == null) {
_inst = new Notice_NewOutSceneFull();
}
return _inst;
}
private static final String TAG = Notice_NewOutSceneFull.class.getSimpleName();
private WifiAdStatusListener wifiAdStatusListener;
private GMFullVideoAd mTTFullVideoAd;
private WeakReference<Activity> activity;
private String fullId;
private boolean isClickScreen = true; // 是否点击屏幕跳转广告
private String mCarrier = "";
private String adcode = "";
private String ecpm = "";
private int adSource = 0;
private int isLoadSuccess = 0;//0-加载失败/未加载 1-加载中 2-加载成功
private long adLoadTime = 0;// 广告展示时间,45分钟后当前广告失效,重新预加载广告
private long adPreingTime = 0;// 防止预加载超时 2分钟
public void preloadFullAd(Activity activity, String carrier) {
this.mCarrier = carrier;
this.activity = new WeakReference<>(activity);
boolean isOversped = TimeRender.isOverspedMin(adLoadTime, AdHelper.AD_NO_SHOWTIME_OUT);
boolean isPreingOversped = TimeRender.isOverspedMin(adPreingTime, AdHelper.AD_REQUEST_TIME_OUT);
LogUtil.d(TAG, "gromore应用内新插屏半屏广告-> 1、进入预加载 isLoadSuccess=" + isLoadSuccess + " isOversped=" + isOversped + " activity=" + this.activity.get() + " isPreingOversped=" + isPreingOversped);
if ((isLoadSuccess == 0 // 加载失败
|| (adLoadTime > 0 && isOversped) // 超过45分钟
|| (adPreingTime > 0 && isPreingOversped && isLoadSuccess == 1)) // 预加载超时
&& this.activity.get() != null) {
adPreingTime = System.currentTimeMillis();
isLoadSuccess = 1;
LogUtil.d(TAG, "gromore应用内新插屏半屏广告-> 2、执行预加载去了=" + isLoadSuccess);
if (GMMediationAdSdk.configLoadSuccess()) {
loadAd();
} else {
GMMediationAdSdk.registerConfigCallback(mSettingConfigCallback);
}
}
}
/**
* config回调
*/
private final GMSettingConfigCallback mSettingConfigCallback = this::loadAd;
private void loadAd() {
fullId = getFullId();
isClickScreen = true;
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_REQUEST,
"",
fullId,
"",
"",
System.currentTimeMillis(),
mCarrier,
"",
"",
""
);
/**
* 选择的模板类型
* 如果服务端配置了模板类型跟随服务端配置
* 有效值 0 客户端设置生效 1 原生 2 模板 1.0 3 模板 2.0
* 服务端没有下发数值客户端设置模板版本才会生效
*/
/**
* 注:每次加载全屏视频广告的时候需要新建一个TTFullVideoAd,否则可能会出现广告填充问题
* ( 例如:mTTFullVideoAd = new TTFullVideoAd(this, adUnitId);)
*/
mTTFullVideoAd = new GMFullVideoAd(activity.get(), fullId);
GMAdSlotFullVideo adSlotFullVideo = new GMAdSlotFullVideo.Builder()
.setGMAdSlotGDTOption(GMAdOptionUtil.getGMAdSlotGDTOption().build())
.setGMAdSlotBaiduOption(GMAdOptionUtil.getGMAdSlotBaiduOption().build())
.setUserID(UserManager.getInstance().getUserID())//用户id,必传参数
.setOrientation(GMAdConstant.VERTICAL)//必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL;
.build();
//请求广告
mTTFullVideoAd.loadAd(adSlotFullVideo, new GMFullVideoAdLoadCallback() {
@Override
public void onFullVideoLoadFail(AdError adError) {
LogUtil.d(TAG, "gromore应用内新插屏半屏广告--> 3、onFullVideoLoadFail onError " + adError.code + adError.message);
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_FAIL,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"onFullVideoLoadFail",
String.valueOf(adError.code),
adError.message
);
isLoadSuccess = 0;
// if (wifiAdStatusListener != null) {
// wifiAdStatusListener.adFail();
// }
}
@Override
public void onFullVideoAdLoad() {
LogUtil.d(TAG, "gromore应用内新插屏半屏广告--> 3、Gromore 新插屏onFullVideoAdLoad ");
if (mTTFullVideoAd != null) {
adcode = mTTFullVideoAd.getAdNetworkRitId();
ecpm = mTTFullVideoAd.getPreEcpm();
adSource = mTTFullVideoAd.getAdNetworkPlatformId();
}
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_SUC,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"",
"",
""
);
isLoadSuccess = 2;
adLoadTime = System.currentTimeMillis();
if (wifiAdStatusListener != null) {
wifiAdStatusListener.adSuccess();
}
}
@Override
public void onFullVideoCached() {
isLoadSuccess = 2;
adLoadTime = System.currentTimeMillis();
LogUtil.d(TAG, "gromore应用内新插屏半屏广告--> 3、Gromore 新插屏onFullVideoCached ");
}
});
}
private String getFullId() {
return CsjGroMoreManager.INSTANCE.getOutCommonNewInterstitialId();
}
public void showFullAd(Activity _activity, WifiAdStatusListener wifiAdStatusListener, String carrier) {
mCarrier = carrier;
this.activity = new WeakReference<>(_activity);
boolean isOversped = TimeRender.isOverspedMin(adLoadTime, AdHelper.AD_NO_SHOWTIME_OUT);
this.wifiAdStatusListener = wifiAdStatusListener;
// 若上一个广告还在加载中则返回
if (isLoadSuccess == 1) {
if (this.wifiAdStatusListener != null)
this.wifiAdStatusListener.adFail();
return;
}
// 预加载广告成功 且 预加载广告时长未超过45分钟
if (isLoadSuccess == 2
&& !isOversped
&& mTTFullVideoAd != null && mTTFullVideoAd.isReady() && this.activity.get() != null) {
isClickScreen = true;
LogUtil.d(TAG, "gromore应用内新插屏半屏广告--> 4、展示广告LoadSuccess=" + isLoadSuccess + " isReady=" + mTTFullVideoAd.isReady() + " isOversped=" + isOversped + " activity=" + this.activity.get());
//在获取到广告后展示,强烈建议在onRewardVideoCached回调后,展示广告,提升播放体验
//该方法直接展示广告
//展示广告,并传入广告展示的场景
mTTFullVideoAd.setFullVideoAdListener(mTTFullVideoAdListener);
mTTFullVideoAd.showFullAd(this.activity.get());
} else {
LogUtil.d(TAG, "gromore应用内新插屏半屏广告--> 5、展示广告时失败了,广告可能超时45分钟 onError ");
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_SHOWFAIL,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"LoadSuccess=" + isLoadSuccess + " isOversped=" + isOversped,
"999995",
"showFail"
);
if (this.wifiAdStatusListener != null)
this.wifiAdStatusListener.adFail();
}
// 状态重置
isLoadSuccess = 0;
}
public int getLoadStatus() {
return isLoadSuccess;
}
/**
* 激励视频交互回调
*/
private final GMFullVideoAdListener mTTFullVideoAdListener = new GMFullVideoAdListener() {
@Override
public void onFullVideoAdShow() {
if (mTTFullVideoAd != null) {
adcode = mTTFullVideoAd.getAdNetworkRitId();
ecpm = mTTFullVideoAd.getPreEcpm();
adSource = mTTFullVideoAd.getAdNetworkPlatformId();
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", adcode);
vo.put("ecpm", ecpm);
vo.put("adSource", adSource);
vo.put("adType", Constant.GRO_MORE_ADTYPE4);
vo.put("adid", fullId);
TrackManager.getInstance().cmtGroMoreInfo(vo);
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_SHOW,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"",
""
, ""
);
}
Log.d(TAG, "onFullVideoAdShow");
// 应用内展示时预加载下一个
if (activity.get() != null && !activity.get().isFinishing()) {
preloadFullAd(activity.get(), mCarrier);
}
}
@Override
public void onFullVideoAdShowFail(AdError adError) {
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_SHOWFAIL,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"onFullVideoAdShowFail",
String.valueOf(adError.code),
adError.message
);
if (wifiAdStatusListener != null)
wifiAdStatusListener.adFail();
}
@Override
public void onFullVideoAdClick() {
Log.d(TAG, "onFullVideoAdClick");
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_CLICK,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"",
""
, ""
);
if (isClickScreen) {
// 防止重复
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_REPEAT,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"",
""
, ""
);
isClickScreen = false;
}
}
@Override
public void onFullVideoAdClosed() {
if (wifiAdStatusListener != null)
wifiAdStatusListener.adClose();
Log.d(TAG, "onFullVideoAdClosed");
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_CLOSE,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"",
""
, ""
);
}
@Override
public void onVideoComplete() {
Log.d(TAG, "onVideoComplete");
}
@Override
public void onVideoError() {
isLoadSuccess = 0;
AdReportManager.INSTANCE.eventFull(
getInner(),
AdReportManager.EVENT_TYPE_SHOWFAIL,
adcode,
fullId,
ecpm,
String.valueOf(adSource),
System.currentTimeMillis(),
mCarrier,
"onVideoError",
"999999",
"onVideoError"
);
Log.d(TAG, "onVideoError");
}
@Override
public void onSkippedVideo() {
Log.d(TAG, "onSkippedVideo");
}
};
private String getInner() {
return AdReportManager.INNER_IN;
}
public void setWifiAdStatusListener(WifiAdStatusListener wifiAdStatusListener) {
this.wifiAdStatusListener = wifiAdStatusListener;
}
}
...@@ -5,10 +5,9 @@ import android.os.Bundle ...@@ -5,10 +5,9 @@ import android.os.Bundle
import com.mints.fiveworld.ad.full.OutSceneFull import com.mints.fiveworld.ad.full.OutSceneFull
import com.mints.fiveworld.ad.full.InSceneFull import com.mints.fiveworld.ad.full.InSceneFull
import com.mints.fiveworld.ad.full.Notice_OutSceneFull import com.mints.fiveworld.ad.full.Notice_OutSceneFull
import com.mints.fiveworld.ad.inscreen.InSceneInterstitial
import com.mints.fiveworld.ad.half.NewInSceneFull import com.mints.fiveworld.ad.half.NewInSceneFull
import com.mints.fiveworld.ad.half.NewOutSceneFull import com.mints.fiveworld.ad.half.NewOutSceneFull
import com.mints.fiveworld.ad.inscreen.Notice_OutSceneInterstitial import com.mints.fiveworld.ad.half.Notice_NewOutSceneFull
import com.mints.fiveworld.common.Constant import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.common.random.HitChanceKeeper import com.mints.fiveworld.common.random.HitChanceKeeper
import com.mints.fiveworld.manager.ad.CsjGroMoreManager import com.mints.fiveworld.manager.ad.CsjGroMoreManager
...@@ -110,7 +109,7 @@ class WifiAdManager private constructor() { ...@@ -110,7 +109,7 @@ class WifiAdManager private constructor() {
fun getInCurrentAdStatus(): Boolean { fun getInCurrentAdStatus(): Boolean {
when (inCurrentAdType) { when (inCurrentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> { Constant.GROMORE_INSERTSCREEN_AD -> {
return InSceneInterstitial.getInstance().loadStatus == 2 return NewInSceneFull.getInstance().loadStatus == 2
} }
Constant.GROMORE_FULL_AD -> { Constant.GROMORE_FULL_AD -> {
return InSceneFull.getInstance().loadStatus == 2 return InSceneFull.getInstance().loadStatus == 2
...@@ -198,7 +197,7 @@ class WifiAdManager private constructor() { ...@@ -198,7 +197,7 @@ class WifiAdManager private constructor() {
fun getOutCurrentAdStatus(): Boolean { fun getOutCurrentAdStatus(): Boolean {
when (outCurrentAdType) { when (outCurrentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> { Constant.GROMORE_INSERTSCREEN_AD -> {
return Notice_OutSceneInterstitial.getInstance().loadStatus == 2 return Notice_NewOutSceneFull.getInstance().loadStatus == 2
} }
Constant.GROMORE_FULL_AD -> { Constant.GROMORE_FULL_AD -> {
return Notice_OutSceneFull.getInstance().loadStatus == 2 return Notice_OutSceneFull.getInstance().loadStatus == 2
...@@ -266,7 +265,7 @@ class WifiAdManager private constructor() { ...@@ -266,7 +265,7 @@ class WifiAdManager private constructor() {
when (noticeOutCurrentAdType) { when (noticeOutCurrentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> { Constant.GROMORE_INSERTSCREEN_AD -> {
Notice_OutSceneInterstitial.getInstance().preloadInsertScreenAd(activity, carrier) Notice_NewOutSceneFull.getInstance().preloadFullAd(activity, carrier)
} }
Constant.GROMORE_FULL_AD -> { Constant.GROMORE_FULL_AD -> {
Notice_OutSceneFull.getInstance().preloadFullAd(activity, carrier) Notice_OutSceneFull.getInstance().preloadFullAd(activity, carrier)
...@@ -285,8 +284,8 @@ class WifiAdManager private constructor() { ...@@ -285,8 +284,8 @@ class WifiAdManager private constructor() {
) { ) {
when (noticeOutCurrentAdType) { when (noticeOutCurrentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> { Constant.GROMORE_INSERTSCREEN_AD -> {
Notice_OutSceneInterstitial.getInstance() Notice_NewOutSceneFull.getInstance()
.showInteractionAd(_activity, wifiAdStatusListener, carrier) .showFullAd(_activity, wifiAdStatusListener, carrier)
} }
Constant.GROMORE_FULL_AD -> { Constant.GROMORE_FULL_AD -> {
Notice_OutSceneFull.getInstance() Notice_OutSceneFull.getInstance()
......
package com.mints.fiveworld.common.random package com.mints.fiveworld.common.random
import android.util.Log import android.util.Log
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.mvp.model.WeightBean import com.mints.fiveworld.mvp.model.WeightBean
import com.mints.fiveworld.utils.LogUtil import com.mints.fiveworld.utils.LogUtil
import kotlin.random.Random import kotlin.random.Random
...@@ -105,6 +106,8 @@ object HitChanceKeeper { ...@@ -105,6 +106,8 @@ object HitChanceKeeper {
weightArr: List<WeightBean>?, weightArr: List<WeightBean>?,
defaultChance: String = "" defaultChance: String = ""
): String { ): String {
return Constant.GROMORE_INSERTSCREEN_AD
if (weight == 0 || weightArr == null || weightArr.isEmpty()) return defaultChance if (weight == 0 || weightArr == null || weightArr.isEmpty()) return defaultChance
LogUtil.d(TAG, "-->>> 1、权重总值:${weight}") LogUtil.d(TAG, "-->>> 1、权重总值:${weight}")
......
...@@ -8,13 +8,9 @@ import android.view.KeyEvent; ...@@ -8,13 +8,9 @@ import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.bytedance.msdk.adapter.pangle.PangleNetworkRequestInfo;
import com.bytedance.msdk.api.AdError; import com.bytedance.msdk.api.AdError;
import com.bytedance.msdk.api.NetworkPlatformConst; import com.bytedance.msdk.api.NetworkPlatformConst;
import com.bytedance.msdk.api.splash.TTSplashAdListener;
import com.bytedance.msdk.api.GMAdEcpmInfo;
import com.bytedance.msdk.api.v2.GMAdConstant; import com.bytedance.msdk.api.v2.GMAdConstant;
import com.bytedance.msdk.api.v2.GMNetworkPlatformConst;
import com.bytedance.msdk.api.v2.GMNetworkRequestInfo; import com.bytedance.msdk.api.v2.GMNetworkRequestInfo;
import com.bytedance.msdk.api.v2.ad.splash.GMSplashAd; import com.bytedance.msdk.api.v2.ad.splash.GMSplashAd;
import com.bytedance.msdk.api.v2.ad.splash.GMSplashAdListener; import com.bytedance.msdk.api.v2.ad.splash.GMSplashAdListener;
......
...@@ -104,7 +104,7 @@ public class CycleProgress extends View { ...@@ -104,7 +104,7 @@ public class CycleProgress extends View {
pathMeasure.getSegment(0, pathMeasure.getLength() * mAnimatorValue, dstPath, true); pathMeasure.getSegment(0, pathMeasure.getLength() * mAnimatorValue, dstPath, true);
//渐变 //渐变
Shader mShader = new LinearGradient(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth, mHeight - mStrokeWidth / 2, Shader mShader = new LinearGradient(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth, mHeight - mStrokeWidth / 2,
Color.parseColor("#DEAEC5"), Color.parseColor("#FB918A"), Shader.TileMode.REPEAT); Color.parseColor("#38A8F5"), Color.parseColor("#468df8"), Shader.TileMode.REPEAT);
//遮罩 //遮罩
mProgressPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); mProgressPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
mProgressPaint.setShader(mShader); mProgressPaint.setShader(mShader);
......
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