Commit 11de4d92 authored by mengcuiguang's avatar mengcuiguang

添加推啊广告

parent 807572e6
......@@ -284,6 +284,27 @@ dependencies {
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
// Mintegral 广告
// implementation 'com.mintegral.msdk:videojs:10.2.41'
// implementation 'com.mintegral.msdk:mtgjscommon:10.2.41'
// implementation 'com.mintegral.msdk:playercommon:10.2.41'
// implementation 'com.mintegral.msdk:reward:10.2.41'
// implementation 'com.mintegral.msdk:videocommon:10.2.41'
// implementation 'com.mintegral.msdk:optimizedata:10.2.41'
// implementation 'com.mintegral.msdk:common:10.2.41'
// implementation 'com.mintegral.msdk:alphab:10.2.41'
// implementation 'com.mintegral.msdk:mtgnative:10.2.41'
// implementation 'com.mintegral.msdk:nativeex:10.2.41'
// implementation 'com.mintegral.msdk:interstitial:10.2.41'
// implementation 'com.mintegral.msdk:interstitialvideo:10.2.41'
// // 开发者后台创建App勾选APK为YES则加上mtgdownloads依赖
// implementation 'com.mintegral.msdk:mtgdownloads:10.2.41'
// 推啊广告
implementation('com.tuia:sdk:2.0.1.0') {
transitive = true
exclude group: 'com.google.code.gson'
}
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
......
......@@ -462,4 +462,7 @@
-keep class com.ta.**{*;}
# ======================= 一览视频 END ================
# ===================== 推啊AD START ================
-dontwarn com.lechuan.midunovel.**
-keep class com.lechuan.midunovel.** { *; }
# ======================= 推啊AD END ================
......@@ -92,6 +92,15 @@
android:name="Mob-AppSecret"
android:value="${SHARE_SECRET}" />
<!-- 推啊appkey -->
<meta-data
android:name="TUIA_APPKEY"
android:value="3JqPn4Kc11qYkuT5jX8nuJSKHJTv" />
<meta-data
android:name="TUIA_APPSECRET"
android:value="3XThiZCoXgsHmfqKTMH3R9erQ4qdqCGBrJLLKp9" />
<activity
android:name="com.mints.highgold.ui.activitys.SplashActivity"
android:configChanges="keyboard|orientation|screenSize"
......
......@@ -14,6 +14,7 @@ import com.bun.miitmdid.core.JLibrary;
import com.component.dly.xzzq_ywsdk.YwSDK;
import com.downloader.PRDownloader;
import com.downloader.PRDownloaderConfig;
import com.lechuan.midunovel.view.FoxSDK;
import com.liyanmobi.soft.lycoin.LyEntry;
import com.liyanmobi.soft.lycoin.LyOnInitializeListener;
import com.mints.highgold.BuildConfig;
......@@ -201,6 +202,9 @@ public class MintsApplication extends MultiDexApplication {
// initYwSdk();
// }
// }
// 推啊广告
initTuia();
}
/**
......@@ -388,6 +392,14 @@ public class MintsApplication extends MultiDexApplication {
FeedConfig.getInstance().setPlayerStyle(FeedConfig.STYLE_NATIVE);//FeedConfig.STYLE_STYLE_FEED_PLAY当前页面播放
}
/**
* 推啊广告
*/
private void initTuia() {
//基础SDK初始化
FoxSDK.init(this);
}
/**
* app退出
......
//package com.mints.highgold.ad;
//
//import android.app.Activity;
//import android.app.Dialog;
//import android.content.DialogInterface;
//import android.content.IntentFilter;
//import android.net.ConnectivityManager;
//import android.text.TextUtils;
//import android.view.KeyEvent;
//import android.view.View;
//import android.widget.TextView;
//
//import com.mintegral.msdk.out.MTGRewardVideoHandler;
//import com.mintegral.msdk.out.RewardVideoListener;
//import com.mintegral.msdk.videocommon.download.NetStateOnReceive;
//import com.mints.highgold.MintsApplication;
//import com.mints.highgold.R;
//import com.mints.highgold.mvp.presenters.MintegralVedioAdPresenter;
//import com.mints.highgold.mvp.views.MintegralVedioAdManagerView;
//import com.mints.highgold.ui.widgets.LoadingDialog;
//import com.mints.highgold.utils.ToastUtil;
//
///**
// * Mintegral视频
// */
//public class MintegralVedioAdManager implements MintegralVedioAdManagerView {
//
// private static MintegralVedioAdManager _inst;
//
// private MintegralVedioAdPresenter mintegralVedioAdPresenter;
// private MintegralVedioAdListener mintegralVedioAdListener;
//
// Activity activity;
// protected LoadingDialog progressDialog;
//
// private int curCoin;
// private String extraId;
// private int downloadCoin = 10;
// private String carrierType = "";
//
// private MTGRewardVideoHandler mMTGRewardVideoHandler;
// private NetStateOnReceive mNetStateOnReceive;
// private Dialog mDialog;
// private String mRewardUnitId = "146874";
// private String mRewardId = "12817";
// private String mUserId = "123";
//
// public static MintegralVedioAdManager getInstance(Activity activity) {
// if (_inst != null) {
// return _inst;
// } else {
// _inst = new MintegralVedioAdManager(activity);
// return _inst;
// }
// }
//
// private MintegralVedioAdManager(Activity activity) {
// init(activity);
// return;
// }
//
// private void init(Activity activity) {
// this.activity = activity;
//
// initHandler();
//
// mintegralVedioAdPresenter = new MintegralVedioAdPresenter();
// mintegralVedioAdPresenter.attachView(this);
// }
//
// public void destory() {
// if (mintegralVedioAdPresenter != null) {
// mintegralVedioAdPresenter.dispose();
// mintegralVedioAdPresenter.detachView();
// }
//
// try {
// if (mDialog != null) {
// mDialog = null;
// }
// if (mNetStateOnReceive != null && activity != null) {
// activity.unregisterReceiver(mNetStateOnReceive);
// }
// if (mMTGRewardVideoHandler != null) {
// mMTGRewardVideoHandler.setRewardVideoListener(null);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// @Override
// public MintsApplication getBaseApplication() {
// return (MintsApplication) activity.getApplication();
// }
//
// public void loadMintegralAd(int downloadCoin, int curCoin, String carrierType, String extraId) {
// if (activity == null) {
// showToast("界面加载超时,请重新加载");
// return;
// }
//
// this.downloadCoin = downloadCoin;
// this.carrierType = carrierType;
// this.curCoin = curCoin;
// this.extraId = extraId;
//
// if (mMTGRewardVideoHandler != null) {
// mMTGRewardVideoHandler.load();
// }
// }
//
//
// private void initHandler() {
// if (activity == null) return;
//
// try {
// // Declare network status for downloading video
// if (mNetStateOnReceive == null) {
// mNetStateOnReceive = new NetStateOnReceive();
// IntentFilter filter = new IntentFilter();
// filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
// activity.registerReceiver(mNetStateOnReceive, filter);
// }
//
// mMTGRewardVideoHandler = new MTGRewardVideoHandler(activity, mRewardUnitId);
// mMTGRewardVideoHandler.setRewardVideoListener(new RewardVideoListener() {
//
// @Override
// public void onLoadSuccess(String unitId) {
//
// }
//
// @Override
// public void onVideoLoadSuccess(String unitId) {
// if (mMTGRewardVideoHandler.isReady()) {
// mMTGRewardVideoHandler.show(mRewardId, mUserId);
// }
// }
//
// @Override
// public void onVideoLoadFail(String errorMsg) {
// }
//
// @Override
// public void onShowFail(String errorMsg) {
// }
//
// @Override
// public void onAdShow() {
// }
//
// @Override
// public void onAdClose(boolean isCompleteView, String RewardName, float RewardAmout) {
// if (isCompleteView) {
// showDialog(RewardName, RewardAmout);
// }
// }
//
// @Override
// public void onVideoAdClicked(String unitId) {
// }
//
// @Override
// public void onVideoComplete(String unitId) {
// }
//
// @Override
// public void onEndcardShow(String unitId) {
// }
//
// });
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// public void showDialog(String RewardName, float RewardAmout) {
// if (activity == null) return;
//
// try {
// mDialog = new Dialog(activity);
// View view = View.inflate(activity, R.layout.dialog_reward, null);
// TextView tvRewardName = (TextView) view.findViewById(R.id.tv_rewardName);
// TextView tvRewardAmout = (TextView) view.findViewById(R.id.tv_RewardAmout);
// tvRewardName.setText(RewardName + "");
// tvRewardAmout.setText(RewardAmout + "");
// mDialog.setContentView(view);
// mDialog.show();
// } catch (Throwable t) {
// t.printStackTrace();
// }
// }
//
// /**
// * 显示加载进度条(自定义message)
// *
// * @param message
// */
// @Override
// public void showLoading(String message) {
// if (activity.getWindow() != null && !activity.isFinishing()) {
// if (progressDialog == null) {
// progressDialog = new LoadingDialog(activity);
// progressDialog.setLoadText(message);
// }
//
// progressDialog.show();
// setProgressOnTouchOutside(false);
// setProgressNoDismiss();
// }
// }
//
// /**
// * 设置Progress是否手触消失
// *
// * @param onTouchOutside
// */
// public void setProgressOnTouchOutside(boolean onTouchOutside) {
// if (progressDialog != null)
// progressDialog.setCanceledOnTouchOutside(onTouchOutside);
// }
//
// /**
// * 设置点击返回是否消失加载进度条
// */
// public final void setProgressNoDismiss() {
// if (progressDialog != null && progressDialog.isShowing()) {
// progressDialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
//
// @Override
// public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
// if (keyCode == KeyEvent.KEYCODE_BACK) {
// return true;
// }
// return false;
// }
// });
// }
// }
//
// /**
// * 消失加载进度条
// */
// @Override
// public void hideLoading() {
// try {
// if (activity.getWindow() != null && !activity.isFinishing()) {
// if (progressDialog != null && progressDialog.isShowing()) {
// progressDialog.dismiss();
// progressDialog = null;
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// progressDialog = null;
// }
// }
//
// @Override
// public void showToast(String msg) {
// if (!TextUtils.isEmpty(msg))
// ToastUtil.show(MintsApplication.getContext(), msg);
// }
//
// public void setMintegralVedioAdListener(MintegralVedioAdListener mintegralVedioAdListener) {
// this.mintegralVedioAdListener = mintegralVedioAdListener;
// }
//
// public interface MintegralVedioAdListener {
// void mintegralVedioAdFail();
//
// void mintegralVedioAdAdSuccess();
//
// void mintegralVedioAdDownload();
// }
//
//}
......@@ -6,9 +6,13 @@ import android.view.View;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.lechuan.midunovel.view.FoxListener;
import com.lechuan.midunovel.view.FoxTbScreen;
import com.mints.highgold.common.AppConfig;
import com.mints.highgold.common.Constant;
import com.mints.highgold.manager.TTAdManagerHolder;
import com.mints.highgold.manager.TaAdManager;
import com.mints.highgold.manager.UserManager;
import com.mints.highgold.manager.YlhAdManager;
import com.qq.e.ads.interstitial2.UnifiedInterstitialAD;
import com.qq.e.ads.interstitial2.UnifiedInterstitialADListener;
......@@ -21,10 +25,17 @@ import java.util.List;
*/
public class InsertScreenAdManager {
private Activity activity;
// 穿山甲
private TTAdNative mTTAdNative;
private TTNativeExpressAd mTTAd;
// 优量汇
private UnifiedInterstitialAD iad;
// 推啊
private FoxTbScreen mTMItAd;
public InsertScreenAdManager(Activity activity) {
this.activity = activity;
}
......@@ -40,21 +51,28 @@ public class InsertScreenAdManager {
if (iad != null) {
iad.destroy();
}
if (mTMItAd != null) {
mTMItAd.destroy();
}
}
/**
* 插屏广告显示类型 true-穿山甲 false-优量汇
* 插屏广告显示类型 0-穿山甲 1-优量汇 2-推啊
*
* @param carrierType
*/
private void initInsertScreenAd(String carrierType) {
if (AppConfig.isInteractionAdTypeFlag) {
//显示穿山甲
if (AppConfig.interactionAdType == 0) {
//穿山甲
loadCsjInteractionAd(carrierType);
} else {
} else if (AppConfig.interactionAdType == 1) {
//优量汇
loadYlhInteractionAd(carrierType);
} else if (AppConfig.interactionAdType == 2) {
//推啊
loadTaInteractionAd(carrierType);
}
}
/**
......@@ -97,8 +115,8 @@ public class InsertScreenAdManager {
mTTAdNative.loadInteractionExpressAd(adSlot, new TTAdNative.NativeExpressAdListener() {
@Override
public void onError(int code, String message) {
//当前播放完成换下一个类型 true-穿山甲
// AppConfig.isInteractionAdTypeFlag = false;
//当前播放完成换下一个类型 1-优量汇
AppConfig.interactionAdType = 1;
}
@Override
......@@ -126,18 +144,20 @@ public class InsertScreenAdManager {
@Override
public void onAdShow(View view, int type) {
//当前播放完成换下一个类型 true-穿山甲
AppConfig.isInteractionAdTypeFlag = false;
//当前播放完成换下一个类型 1-优量汇
AppConfig.interactionAdType = 1;
}
@Override
public void onRenderFail(View view, String msg, int code) {
//当前播放完成换下一个类型 1-优量汇
AppConfig.interactionAdType = 1;
}
@Override
public void onRenderSuccess(View view, float width, float height) {
if (activity != null) {
if (mTTAd != null && activity != null && !activity.isFinishing()) {
//返回view的宽高 单位 dp
mTTAd.showInteractionExpressAd(activity);
}
......@@ -150,7 +170,9 @@ public class InsertScreenAdManager {
*/
public void loadYlhInteractionAd(String carrierType) {
iad = getIAD(carrierType);
iad.loadAD();
if (iad != null && activity != null && !activity.isFinishing()) {
iad.loadAD();
}
}
private UnifiedInterstitialAD getIAD(String carrierType) {
......@@ -182,8 +204,8 @@ public class InsertScreenAdManager {
iad = new UnifiedInterstitialAD(activity, YlhAdManager.YLH_AD_VEDIO_APPID, posId, new UnifiedInterstitialADListener() {
@Override
public void onADReceive() {
//当前播放完成换下一个类型 false-优量汇
AppConfig.isInteractionAdTypeFlag = true;
//当前优量汇播放完成换下一个类型
AppConfig.interactionAdType = 2;
showAD();
}
......@@ -193,9 +215,7 @@ public class InsertScreenAdManager {
@Override
public void onNoAD(AdError adError) {
// error
//当前播放完成换下一个类型 false-优量汇
// AppConfig.isInteractionAdTypeFlag = true;
AppConfig.interactionAdType = 2;
}
@Override
......@@ -227,8 +247,78 @@ public class InsertScreenAdManager {
}
private void showAD() {
if (iad != null) {
if (iad != null && activity != null && !activity.isFinishing()) {
iad.show();
}
}
/**
* 加载推啊插屏广告
*
* @param carrierType
*/
private void loadTaInteractionAd(String carrierType) {
if (activity == null) return;
int codeId = TaAdManager.TA_AD_INTERSTITIALAD_SMALLVEDIO;
switch (carrierType) {
case Constant.CARRIER_DRAWCASH:// 提现
codeId = TaAdManager.TA_AD_INTERSTITIALAD_DRAWCAH;
break;
case Constant.CARRIER_YILANVEIDO_REDENVELOPE:// 小视频
codeId = TaAdManager.TA_AD_INTERSTITIALAD_SMALLVEDIO;
break;
case Constant.CARRIER_REDENVELOPE:// 抢红包
codeId = TaAdManager.TA_AD_INTERSTITIALAD_REDBOX;
break;
case Constant.CARRIER_FRIENDS:// 邀请好友
codeId = TaAdManager.TA_AD_INTERSTITIALAD_FRIENDS;
break;
case Constant.CARRIER_GAME:// 游戏赚
codeId = TaAdManager.TA_AD_INTERSTITIALAD_GAME;
break;
}
if (mTMItAd == null) {
mTMItAd = new FoxTbScreen(activity);
}
if (activity != null && !activity.isFinishing()) {
mTMItAd.setAdListener(new FoxListener() {
@Override
public void onReceiveAd() {
System.out.println("mcg __ onReceiveAd");
AppConfig.interactionAdType = 0;
}
@Override
public void onFailedToReceiveAd() {
System.out.println("mcg __ onFailedToReceiveAd");
AppConfig.interactionAdType = 0;
}
@Override
public void onLoadFailed() {
System.out.println("mcg __ onLoadFailed");
AppConfig.interactionAdType = 0;
}
@Override
public void onCloseClick() {
}
@Override
public void onAdClick() {
}
@Override
public void onAdExposure() {
}
@Override
public void onAdActivityClose(String s) {
}
});
mTMItAd.loadAd(codeId, UserManager.getInstance().getUserID());
}
}
}
......@@ -76,7 +76,7 @@ public class AppConfig {
public static int yilanVedioTime = 30;
/**
* 插屏广告显示类型 true-穿山甲 false-优量汇
* 插屏广告显示类型 0-穿山甲 1-优量汇 2-推啊
*/
public static boolean isInteractionAdTypeFlag = true;
public static int interactionAdType = 0;
}
package com.mints.highgold.manager;
/**
* 描述:推啊广告
* 作者:孟崔广
* 时间:2020/4/26 16:46
* 邮箱:mengcuiguang@cashbang.cn
*/
public class TaAdManager {
/* banner */
public static final int TA_AD_AWARD_BANNER = 340374;//banner_奖励弹框
/* 插屏 */
public static final int TA_AD_INTERSTITIALAD_DRAWCAH = 340897;//提现
public static final int TA_AD_INTERSTITIALAD_SMALLVEDIO = 340878;//小视频
public static final int TA_AD_INTERSTITIALAD_REDBOX = 340894;//抢红包
public static final int TA_AD_INTERSTITIALAD_FRIENDS = 340896;//邀请好友
public static final int TA_AD_INTERSTITIALAD_GAME = 340895;//游戏赚
}
package com.mints.highgold.mvp.presenters;
import com.mints.highgold.mvp.views.MintegralVedioAdManagerView;
import rx.Subscription;
public class MintegralVedioAdPresenter extends BasePresenter<MintegralVedioAdManagerView> {
private Subscription subscription;
public void dispose() {
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}
}
}
package com.mints.highgold.mvp.views;
import com.mints.highgold.mvp.model.HytechVedioRsp;
public interface MintegralVedioAdManagerView extends BaseView {
}
......@@ -5,6 +5,7 @@ import android.animation.ValueAnimator;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.animation.LinearInterpolator;
......@@ -18,18 +19,18 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTFullScreenVideoAd;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.liyanmobi.soft.lycoin.LyAdInfo;
import com.liyanmobi.soft.lycoin.LyAdType;
import com.liyanmobi.soft.lycoin.LyManager;
import com.lechuan.midunovel.base.util.FoxBaseCommonUtils;
import com.lechuan.midunovel.view.FoxListener;
import com.lechuan.midunovel.view.FoxStreamerView;
import com.mints.highgold.BuildConfig;
import com.mints.highgold.R;
import com.mints.highgold.ad.VedioAdingManager;
import com.mints.highgold.common.AppConfig;
import com.mints.highgold.common.Constant;
import com.mints.highgold.manager.LyAdManager;
import com.mints.highgold.manager.TTAdManagerHolder;
import com.mints.highgold.manager.TTNativeExpressManager;
import com.mints.highgold.manager.TTPreLoadExpressManager;
import com.mints.highgold.manager.TaAdManager;
import com.mints.highgold.manager.UserManager;
import com.mints.highgold.manager.YlhAdManager;
import com.mints.highgold.mvp.model.EventMessage;
......@@ -46,10 +47,6 @@ import com.mints.highgold.utils.SPUtil;
import com.mints.highgold.utils.SoundPoolUtil;
import com.mints.highgold.utils.SpanUtils;
import com.mints.highgold.utils.Utils;
import com.mints.highgold.utils.rxutil.CommonRxTask;
import com.mints.highgold.utils.rxutil.RxjavaUtil;
import com.mints.library.base.BaseWebActivity;
import com.mints.library.utils.GlideUtils;
import com.mints.library.utils.json.JsonUtil;
import com.mints.library.utils.nodoubleclick.AntiShake;
import com.qq.e.ads.rewardvideo.RewardVideoAD;
......@@ -59,9 +56,9 @@ import com.qq.e.comm.util.AdError;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
......@@ -91,16 +88,10 @@ public class AwardActivity extends BaseActivity implements AwardView {
TextView tvAwardHint;
@Bind(R.id.iv_award_guang)
ImageView ivAwardGuang;
@Bind(R.id.iv_award_icon)
ImageView ivAwardIcon;
@Bind(R.id.tv_award_title)
TextView tvAwardTitle;
@Bind(R.id.tv_award_copies)
TextView tvAwardCopies;
@Bind(R.id.fl_award_bannerad)
LinearLayout flAwardBannerad;
@Bind(R.id.ll_award_bg)
LinearLayout llAwardBg;
@Bind(R.id.fsv_award)
FoxStreamerView fsvAward;
private AwardPresenter awardPresenter;
private SPUtil spUtil;
......@@ -152,8 +143,12 @@ public class AwardActivity extends BaseActivity implements AwardView {
tvAwardNext.setVisibility(View.GONE);
flAwardAd.setVisibility(View.GONE);
tvAwardHint.setVisibility(View.INVISIBLE);
fsvAward.setVisibility(View.GONE);
} else {
tvAwardHint.setVisibility(View.GONE);
fsvAward.setVisibility(View.VISIBLE);
fsvAward.loadAd(TaAdManager.TA_AD_AWARD_BANNER, UserManager.getInstance().getUserID());
}
initDataView();
......@@ -218,6 +213,9 @@ public class AwardActivity extends BaseActivity implements AwardView {
@Override
public void onDestroy() {
if (fsvAward != null) {
fsvAward.destroy();
}
super.onDestroy();
try {
......@@ -727,65 +725,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
}
private void getLyCardList(LyAdManager lyAdManager) {
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
if (AppConfig.lyAdSdkInitState) {
// 获取
lyAdManager.setLyAdCardInfo(lyAdManager.getLyAdList(LyAdType.AD_TYPE_CARD, 5, true));
}
}
@Override
public void doInUIThread() {
List<LyAdInfo> lyAdCardInfo = lyAdManager.getLyAdCardInfo();
if (lyAdCardInfo != null && lyAdCardInfo.size() > 0) {
LyAdInfo lyAdInfo = null;
for (int i = 0; i < lyAdCardInfo.size(); i++) {
lyAdInfo = lyAdCardInfo.get(i);
if (lyAdInfo.ad_sub_type == 2) {
break;
}
}
if (flAwardBannerad != null && lyAdInfo != null) {
if (lyAdInfo.ad_sub_type == 2) {
flAwardBannerad.setVisibility(View.VISIBLE);
LyManager.getInstance().onDisplay(lyAdInfo);
String title = lyAdInfo.sub_title;
String content = lyAdInfo.main_title;
String jump_url = lyAdInfo.jump_url;
tvAwardTitle.setText(title);
tvAwardCopies.setText(content);
// GlideUtils.loadImageViewLoding(context, lyAdInfo.icon_url, ivIcon, R.mipmap.ic_launcher, R.mipmap.ic_launcher);
GlideUtils.loadImageView(getContext(), lyAdInfo.icon_url, ivAwardIcon);
LyAdInfo finalLyAdInfo = lyAdInfo;
flAwardBannerad.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LyManager.getInstance().onClick(finalLyAdInfo);
Bundle bundle = new Bundle();
bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, title);
bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, jump_url);
readyGo(BaseWebActivity.class, bundle);
}
});
}
}
// System.out.println("mcg__" + JsonUtil.toJson(lyAdCardInfo));
}
}
});
}
private ObjectAnimator loadAnim(ImageView view) {
ObjectAnimator mAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
......@@ -1280,5 +1219,4 @@ public class AwardActivity extends BaseActivity implements AwardView {
}
return vo;
}
}
......@@ -165,7 +165,7 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
if (AntiShake.check(llDrawcashBottom.getId())) return;
}
System.out.println("mcg __ drawcash onresume");
// System.out.println("mcg __ drawcash onresume");
insertScreenAd.showInsertScreenAd(Constant.CARRIER_DRAWCASH);
drawcashPresenter.getUserTaskMsg();
}
......
......@@ -20,6 +20,7 @@ import android.webkit.WebResourceResponse;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.mints.highgold.R;
......@@ -42,6 +43,8 @@ public class NewsWebviewActivity extends BaseActivity {
TextView tvActivityTitle;
@Bind(R.id.wb_news)
WebView mWebView;
@Bind(R.id.pb_web)
ProgressBar mProgressBar;
private String url;
private String title;
......@@ -53,6 +56,8 @@ public class NewsWebviewActivity extends BaseActivity {
@Override
protected void initViewsAndEvents() {
mProgressBar.setProgress(0);
if (TextUtils.isEmpty(title)) {
tvActivityTitle.setText("推荐");
} else {
......@@ -206,8 +211,17 @@ public class NewsWebviewActivity extends BaseActivity {
});
mWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView webView, int i) {
super.onProgressChanged(webView, i);
public void onProgressChanged(WebView webView, int newProgress) {
super.onProgressChanged(webView, newProgress);
if (mProgressBar != null && !NewsWebviewActivity.this.isFinishing()) {
if (newProgress == 100) {
mProgressBar.setVisibility(View.GONE);
} else {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setProgress(newProgress);
}
}
}
@Override
......
......@@ -22,6 +22,7 @@ import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.mints.highgold.R;
......@@ -50,6 +51,8 @@ public class WebActivity extends BaseActivity {
TextView tvActivityTitle;
@Bind(R.id.common_web_browser_layout_daichao)
BrowserLayout mBrowserLayout;
@Bind(R.id.pb_web)
ProgressBar mProgressBar;
private ValueCallback<Uri> mUploadMessage;// 表单的数据信息
private ValueCallback<Uri[]> mUploadCallbackAboveL;
......@@ -66,6 +69,7 @@ public class WebActivity extends BaseActivity {
@Override
protected void initViewsAndEvents() {
mProgressBar.setProgress(0);
if (TextUtils.isEmpty(title)) {
tvActivityTitle.setText("推荐");
......@@ -100,6 +104,19 @@ public class WebActivity extends BaseActivity {
mUploadMessage = uploadMsg;
take();
}
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (mProgressBar != null && !WebActivity.this.isFinishing()) {
if (newProgress == 100) {
mProgressBar.setVisibility(View.GONE);
} else {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setProgress(newProgress);
}
}
}
});
mBrowserLayout.getWebView().setWebViewClient(new WebViewClient() {
@Override
......
......@@ -468,7 +468,12 @@ public class MyFragment extends BaseFragment
Bundle bundle = new Bundle();
bundle.putString(Constant.DAICHAO_URL, linkurl);
bundle.putString(Constant.DAICHAO_TITLE, bannerList.getTitle());
readyGo(WebActivity.class, bundle);
if (TextUtils.equals(id, "rotationrcNews")) {
// 新闻资讯 兼容h5 iframe
readyGo(NewsWebviewActivity.class, bundle);
} else {
readyGo(WebActivity.class, bundle);
}
}
}
}
......
......@@ -54,7 +54,7 @@ public class BrowserLayout extends LinearLayout {
private ImageButton mRefreshBtn = null;
private int mBarHeight = 5;
private ProgressBar mProgressBar = null;
// private ProgressBar mProgressBar = null;
private String mLoadUrl;
......@@ -72,10 +72,10 @@ public class BrowserLayout extends LinearLayout {
mContext = context;
setOrientation(VERTICAL);
mProgressBar = (ProgressBar) LayoutInflater.from(context).inflate(R.layout.progress_horizontal, null);
mProgressBar.setMax(100);
mProgressBar.setProgress(0);
addView(mProgressBar, LayoutParams.MATCH_PARENT, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, mBarHeight, getResources().getDisplayMetrics()));
// mProgressBar = (ProgressBar) LayoutInflater.from(context).inflate(R.layout.progress_horizontal, null);
// mProgressBar.setMax(100);
// mProgressBar.setProgress(0);
// addView(mProgressBar, LayoutParams.MATCH_PARENT, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, mBarHeight, getResources().getDisplayMetrics()));
mWebView = new WebView(context);
mWebView.getSettings().setJavaScriptEnabled(true);
......@@ -130,12 +130,12 @@ public class BrowserLayout extends LinearLayout {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (newProgress == 100) {
mProgressBar.setVisibility(View.GONE);
} else {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setProgress(newProgress);
}
// if (newProgress == 100) {
// mProgressBar.setVisibility(View.GONE);
// } else {
// mProgressBar.setVisibility(View.VISIBLE);
// mProgressBar.setProgress(newProgress);
// }
}
});
......
......@@ -9,7 +9,7 @@
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/main" />
<solid android:color="@color/main_mints" />
</shape>
</clip>
</item>
......
......@@ -11,15 +11,13 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20pt">
android:layout_gravity="center_horizontal">
<ImageView
android:id="@+id/iv_award_guang"
android:layout_width="600pt"
android:layout_height="600pt"
android:layout_height="580pt"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10pt"
android:src="@mipmap/bg_award_guang" />
<LinearLayout
......@@ -27,8 +25,7 @@
android:layout_width="660pt"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="110pt"
android:layout_marginBottom="10pt"
android:layout_marginTop="80pt"
android:background="@mipmap/bg_award"
android:orientation="vertical">
......@@ -37,7 +34,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="320pt"
android:layout_marginTop="400pt"
android:layout_marginBottom="20pt"
android:text="恭喜获取120金币"
android:textColor="@color/black_text"
......@@ -57,7 +54,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30pt"
android:layout_marginBottom="20pt"
android:background="@drawable/shape_tv_gold"
android:paddingLeft="40pt"
......@@ -73,79 +69,25 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20pt"
android:layout_marginTop="10pt"
android:textColor="@color/black_text"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/fl_award_bannerad"
android:layout_width="520pt"
android:layout_height="140pt"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20pt"
android:background="@mipmap/bg_sign_card"
android:orientation="horizontal"
android:visibility="gone">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="30pt"
android:background="@drawable/shape_bg_write">
<ImageView
android:id="@+id/iv_award_icon"
android:layout_width="80pt"
android:layout_height="80pt"
android:layout_margin="10pt"
android:src="@mipmap/ic_launcher" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="80pt">
<TextView
android:id="@+id/tv_award_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="优惠卡券"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_award_copies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_award_title"
android:text="查看优惠卡券"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<com.lechuan.midunovel.view.FoxStreamerView
android:id="@+id/fsv_award"
android:layout_marginTop="16pt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:fox_size="foxBr" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/fl_award_ad"
android:layout_width="wrap_content"
android:layout_height="430pt"
android:layout_gravity="center_horizontal"
android:background="@color/full_transparent">
</FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-2pt">
android:layout_marginTop="-1pt">
<TextView
android:id="@+id/tv_award_back"
......@@ -166,4 +108,14 @@
android:src="@mipmap/ic_drink_cancel"
android:visibility="gone" />
</RelativeLayout>
<FrameLayout
android:id="@+id/fl_award_ad"
android:layout_width="wrap_content"
android:layout_height="430pt"
android:layout_gravity="center_horizontal"
android:background="@color/full_transparent">
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -48,6 +48,17 @@
android:textSize="14sp" />
</RelativeLayout>
<ProgressBar
android:id="@+id/pb_web"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="2pt"
android:background="@null"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/progress_bar_horizontal" />
<com.mints.library.widgets.BrowserLayout
android:id="@+id/common_web_browser_layout_daichao"
android:layout_width="match_parent"
......
......@@ -47,6 +47,15 @@
android:textColor="@color/product_net_text"
android:textSize="14sp" />
</RelativeLayout>
<ProgressBar
android:id="@+id/pb_web"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="2pt"
android:background="@null"
android:indeterminateOnly="false"
android:max="100"
android:progressDrawable="@drawable/progress_bar_horizontal" />
<WebView
android:id="@+id/wb_news"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="rewardName:" />
<TextView
android:id="@+id/tv_rewardName"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RewardAmout:" />
<TextView
android:id="@+id/tv_RewardAmout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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