Commit 1e4c5250 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent fc91e796
......@@ -17,7 +17,6 @@ import com.mintegral.msdk.out.MIntegralSDKFactory;
import com.mints.highgold.common.AppConfig;
import com.mints.highgold.common.Constant;
import com.mints.highgold.manager.LiebaoManager;
import com.mints.highgold.manager.LyAdManager;
import com.mints.highgold.manager.MiitHelper;
import com.mints.highgold.manager.TTAdManagerHolder;
import com.mints.highgold.net.LoanService;
......@@ -142,9 +141,6 @@ public class MintsApplication extends MultiDexApplication {
// 猎豹游戏初始化
LiebaoManager.getInstance().initCmGameSdk();
// 立言积分初始化
// initGold(this);
// 初始化ShareSDK
MobSDK.init(this);
......@@ -200,7 +196,7 @@ public class MintsApplication extends MultiDexApplication {
initTuia();
// Mintegral广告
// initMintegral();
initMintegral();
}
/**
......
......@@ -148,7 +148,7 @@ public class CsjFullVedioAdManager implements LyVedioAdManagerView {
// System.out.println("mcg __ csjfull onAdVideoBarClick");
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_HYTECH, Constant.EVENT_TYPE_FOUR, "", "");
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJFULL, Constant.EVENT_TYPE_FOUR, "", "");
isClickScreen = false;
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJFULL, Constant.EVENT_TYPE_TWO, "", "");
......
......@@ -215,7 +215,7 @@ public class CsjVedioAdManager implements LyVedioAdManagerView {
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_HYTECH, Constant.EVENT_TYPE_FOUR, "", "");
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_FOUR, "", "");
isClickScreen = false;
}
......
......@@ -32,7 +32,7 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
private static MintegralVedioAdManager _inst;
// private MintegralVedioAdPresenter mintegralVedioAdPresenter;
// private MintegralVedioAdPresenter mintegralVedioAdPresenter;
private MintegralVedioAdListener mintegralVedioAdListener;
Activity activity;
......@@ -83,9 +83,9 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
// }
try {
if (mDialog != null) {
mDialog = null;
}
// if (mDialog != null) {
// mDialog = null;
// }
if (mNetStateOnReceive != null && activity != null) {
activity.unregisterReceiver(mNetStateOnReceive);
}
......@@ -140,12 +140,10 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
@Override
public void onLoadSuccess(String unitId) {
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_MINTEGRAL, Constant.EVENT_TYPE_ZERO, "", "");
System.out.println("mcg __ onLoadSuccess");
}
@Override
public void onVideoLoadSuccess(String unitId) {
System.out.println("mcg __ onVideoLoadSuccess");
if (mMTGRewardVideoHandler.isReady()) {
mMTGRewardVideoHandler.show(mRewardId, mUserId);
} else {
......@@ -177,15 +175,22 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
@Override
public void onAdShow() {
System.out.println("mcg __ onAdShow");
}
@Override
public void onAdClose(boolean isCompleteView, String RewardName, float RewardAmout) {
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_MINTEGRAL, Constant.EVENT_TYPE_THREE, "", "");
if (isCompleteView) {
showDialog(RewardName, RewardAmout);
if (mintegralVedioAdListener != null) {
mintegralVedioAdListener.mintegralVedioAdAdSuccess();
}
// if (activity != null) {
// mintegralVedioAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// }
}
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_MINTEGRAL, Constant.EVENT_TYPE_THREE, "", "");
System.out.println("mcg __ onAdClose isCompleteView:" + isCompleteView);
......@@ -193,7 +198,6 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
@Override
public void onVideoAdClicked(String unitId) {
System.out.println("mcg __ onVideoAdClicked");
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_MINTEGRAL, Constant.EVENT_TYPE_TWO, "", "");
if (isClickScreen) {
......@@ -209,21 +213,10 @@ public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
@Override
public void onVideoComplete(String unitId) {
System.out.println("mcg __ onVideoComplete");
}
@Override
public void onEndcardShow(String unitId) {
if (mintegralVedioAdListener != null) {
mintegralVedioAdListener.mintegralVedioAdAdSuccess();
}
// if (activity != null) {
// mintegralVedioAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// }
// System.out.println("mcg __ onEndcardShow");
}
});
......
......@@ -166,7 +166,7 @@ public class YlhVedioAdManager implements LyVedioAdManagerView {
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_HYTECH, Constant.EVENT_TYPE_FOUR, "", "");
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_YLH, Constant.EVENT_TYPE_FOUR, "", "");
isClickScreen = false;
}
System.out.println("mcg ylh 点击");
......
package com.mints.highgold.ad.banner
import android.app.Activity
import android.view.View
import com.lechuan.midunovel.view.FoxStreamerView
import com.mints.highgold.common.AppConfig
import com.mints.highgold.manager.TaAdManager
import com.mints.highgold.manager.UserManager
class BannerAdmanager {
var activity: Activity? = null
var fsvAward: FoxStreamerView? = null
constructor(activity: Activity?) {
this.activity = activity
}
/**
* 展示banner
*
* @param carrierType
* @param view 要展示的banner
*/
fun showBannerAd(carrierType: String, view: View?) {
if (UserManager.getInstance().adShowFlag) initBannerAd(carrierType, view)
}
/**
* banner广告显示类型 0-推啊
*
* @param carrierType
* @param view
*/
private fun initBannerAd(carrierType: String, view: View?) {
if (AppConfig.bannerAdType == 0) loadTaBannerAd(carrierType, view)
}
private fun loadTaBannerAd(carrierType: String, view: View?) {
if (view != null) {
if (view is FoxStreamerView) {
fsvAward = view
fsvAward?.loadAd(TaAdManager.TA_AD_AWARD_BANNER, UserManager.getInstance().userID)
}
}
}
fun ondestory() {
fsvAward?.destroy()
}
}
\ No newline at end of file
......@@ -58,11 +58,11 @@ public class AppConfig {
/**
* mintegralVedio 剩余广告播放数
*/
public static int mintegralAdCount = 5;
public static int mintegralAdCount = 0;
/**
* hytechVedio 剩余广告播放数
*/
public static int hytechVedioAdCount = 5;
public static int hytechVedioAdCount = 0;
/**
* 一览视频 时间间隔 单位-秒
......@@ -73,4 +73,9 @@ public class AppConfig {
* 插屏广告显示类型 0-穿山甲 1-优量汇 2-推啊
*/
public static int interactionAdType = 0;
/**
* banner显示类型 0-推啊
*/
public static int bannerAdType = 0;
}
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