Commit 154bb8a9 authored by mengcuiguang's avatar mengcuiguang

添加视频逻辑,界面调整,解决冲突

parent fde0f721
...@@ -107,8 +107,8 @@ android { ...@@ -107,8 +107,8 @@ android {
} }
productFlavors { productFlavors {
// goodmoneypkg {} goodmoneypkg {}
share_goodmoney {} // share_goodmoney {}
} }
productFlavors.all { productFlavors.all {
......
...@@ -281,17 +281,6 @@ ...@@ -281,17 +281,6 @@
android:name="com.qq.e.ads.LandscapeADActivity" android:name="com.qq.e.ads.LandscapeADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
<!-- 变现猫 -->
<!-- <provider-->
<!-- android:name="android.support.v4.content.FileProvider"-->
<!-- android:authorities="${applicationId}.fileprovider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/new_app_file_paths" />-->
<!-- </provider>-->
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -4,6 +4,7 @@ import android.content.Context; ...@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.text.TextUtils; import android.text.TextUtils;
import android.webkit.WebView;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.multidex.MultiDex; import androidx.multidex.MultiDex;
...@@ -85,12 +86,12 @@ public class MintsApplication extends MultiDexApplication { ...@@ -85,12 +86,12 @@ public class MintsApplication extends MultiDexApplication {
initMiitHelper(); initMiitHelper();
//Android 9 or above must be set //Android 9 or above must be set
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// String processName = getProcessName(); String processName = getProcessName();
// if (!getPackageName().equals(processName)) { if (!getPackageName().equals(processName)) {
// WebView.setDataDirectorySuffix(processName); WebView.setDataDirectorySuffix(processName);
// } }
// } }
// 子线程初始化三方SDK // 子线程初始化三方SDK
String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid()); String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid());
......
package com.mints.goodmoney.ad.video
import android.app.Activity
import android.content.DialogInterface
import android.text.TextUtils
import android.view.KeyEvent
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.mvp.views.BaseView
import com.mints.goodmoney.ui.widgets.LoadingDialog
import com.mints.goodmoney.utils.ToastUtil
open class BaseVideoAd(activity: Activity) : BaseView {
var activity: Activity
var progressDialog: LoadingDialog? = null
init {
this.activity = activity
}
override fun getBaseApplication(): MintsApplication {
return activity.getApplication() as MintsApplication
}
/**
* 显示加载进度条(自定义message)
*
* @param message
*/
override fun showLoading(message: String?) {
if (activity.getWindow() != null && !activity.isFinishing()) {
if (progressDialog == null) {
progressDialog = LoadingDialog(activity)
progressDialog!!.setLoadText(message)
}
progressDialog?.show()
setProgressOnTouchOutside(false)
setProgressNoDismiss()
}
}
/**
* 设置Progress是否手触消失
*
* @param onTouchOutside
*/
open fun setProgressOnTouchOutside(onTouchOutside: Boolean) {
if (progressDialog != null) progressDialog!!.setCanceledOnTouchOutside(onTouchOutside)
}
/**
* 设置点击返回是否消失加载进度条
*/
fun setProgressNoDismiss() {
if (progressDialog != null && progressDialog!!.isShowing()) {
progressDialog!!.setOnKeyListener(DialogInterface.OnKeyListener { dialog, keyCode, event ->
if (keyCode == KeyEvent.KEYCODE_BACK) {
true
} else false
})
}
}
/**
* 消失加载进度条
*/
override fun hideLoading() {
try {
if (activity.getWindow() != null && !activity.isFinishing()) {
if (progressDialog != null && progressDialog!!.isShowing()) {
progressDialog!!.dismiss()
progressDialog = null
}
}
} catch (e: Exception) {
e.printStackTrace()
} finally {
progressDialog = null
}
}
override fun showToast(msg: String?) {
if (!TextUtils.isEmpty(msg)) ToastUtil.show(MintsApplication.getContext(), msg)
}
open fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String){}
open fun onDestory(){}
}
\ No newline at end of file
package com.mints.goodmoney.ad.video; package com.mints.goodmoney.ad.video;
import android.app.Activity; import android.app.Activity;
import android.content.DialogInterface;
import android.text.TextUtils;
import android.view.KeyEvent;
import com.bytedance.sdk.openadsdk.AdSlot; import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant; import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdNative; import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd; import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.mints.goodmoney.BuildConfig; import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.TTNativeExpressManager; import com.mints.goodmoney.manager.TTNativeExpressManager;
import com.mints.goodmoney.manager.TrackManager; import com.mints.goodmoney.manager.TrackManager;
...@@ -18,11 +14,9 @@ import com.mints.goodmoney.manager.TtCsjAdManager; ...@@ -18,11 +14,9 @@ import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.UserManager; import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.mvp.presenters.CsjVedioAdPresenter; import com.mints.goodmoney.mvp.presenters.CsjVedioAdPresenter;
import com.mints.goodmoney.mvp.views.VedioAdManagerView; import com.mints.goodmoney.mvp.views.VedioAdManagerView;
import com.mints.goodmoney.ui.widgets.LoadingDialog;
import com.mints.goodmoney.utils.LogUtil; import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.MD5; import com.mints.goodmoney.utils.MD5;
import com.mints.goodmoney.utils.SPUtil; import com.mints.goodmoney.utils.SPUtil;
import com.mints.goodmoney.utils.ToastUtil;
import com.mints.library.utils.json.JsonUtil; import com.mints.library.utils.json.JsonUtil;
import java.util.HashMap; import java.util.HashMap;
...@@ -30,7 +24,7 @@ import java.util.HashMap; ...@@ -30,7 +24,7 @@ import java.util.HashMap;
/** /**
* 穿山甲激励视频广告 * 穿山甲激励视频广告
*/ */
public class CsjVedioAdManager implements VedioAdManagerView { public class CsjVedioAdManager extends BaseVideoAd {
private static CsjVedioAdManager _inst; private static CsjVedioAdManager _inst;
private SPUtil spUtil; private SPUtil spUtil;
...@@ -42,7 +36,6 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -42,7 +36,6 @@ public class CsjVedioAdManager implements VedioAdManagerView {
Activity activity; Activity activity;
private TTAdNative ttAdNative; private TTAdNative ttAdNative;
private TTRewardVideoAd mttRewardVideoAd; private TTRewardVideoAd mttRewardVideoAd;
protected LoadingDialog progressDialog;
private UserManager userManager; private UserManager userManager;
private boolean isClickScreen = true; // 是否点击屏幕跳转广告 private boolean isClickScreen = true; // 是否点击屏幕跳转广告
...@@ -57,6 +50,7 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -57,6 +50,7 @@ public class CsjVedioAdManager implements VedioAdManagerView {
} }
private CsjVedioAdManager(Activity activity) { private CsjVedioAdManager(Activity activity) {
super(activity);
init(activity); init(activity);
return; return;
} }
...@@ -69,19 +63,20 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -69,19 +63,20 @@ public class CsjVedioAdManager implements VedioAdManagerView {
TTNativeExpressManager ttNativeExpressManager = new TTNativeExpressManager(); TTNativeExpressManager ttNativeExpressManager = new TTNativeExpressManager();
ttAdNative = ttNativeExpressManager.initTTAd(false); ttAdNative = ttNativeExpressManager.initTTAd(false);
csjVedioAdPresenter = new CsjVedioAdPresenter(); // csjVedioAdPresenter = new CsjVedioAdPresenter();
csjVedioAdPresenter.attachView(this); // csjVedioAdPresenter.attachView(this);
} }
public void destory() { @Override
public void onDestory() {
if (mttRewardVideoAd != null) { if (mttRewardVideoAd != null) {
mttRewardVideoAd.setRewardAdInteractionListener(null); mttRewardVideoAd.setRewardAdInteractionListener(null);
} }
if (csjVedioAdPresenter != null) { // if (csjVedioAdPresenter != null) {
csjVedioAdPresenter.dispose(); // csjVedioAdPresenter.dispose();
csjVedioAdPresenter.detachView(); // csjVedioAdPresenter.detachView();
} // }
activity = null; activity = null;
} }
...@@ -91,7 +86,8 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -91,7 +86,8 @@ public class CsjVedioAdManager implements VedioAdManagerView {
* *
* @param carrierType * @param carrierType
*/ */
public void loadCsjAd(Activity activity,int curCoin, String carrierType, String extraId) { @Override
public void loadAd(Activity activity, int curCoin, String carrierType, String extraId) {
this.activity = activity; this.activity = activity;
isClickScreen = true; isClickScreen = true;
this.curCoin = curCoin; this.curCoin = curCoin;
...@@ -145,7 +141,7 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -145,7 +141,7 @@ public class CsjVedioAdManager implements VedioAdManagerView {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_ONE, String.valueOf(code), message); TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_ONE, String.valueOf(code), message);
LogUtil.d("CsjVedioAdManager","onError "+code +message); LogUtil.d("CsjVedioAdManager", "onError " + code + message);
if (csjVedioAdListener != null) { if (csjVedioAdListener != null) {
csjVedioAdListener.csjVedioAdFail(); csjVedioAdListener.csjVedioAdFail();
} }
...@@ -225,13 +221,6 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -225,13 +221,6 @@ public class CsjVedioAdManager implements VedioAdManagerView {
}); });
} }
@Override
public void checkSuc(boolean lyCmtFlag) {
if (csjVedioAdListener != null) {
csjVedioAdListener.csjVedioAdSuccess();
}
}
/** /**
* 封装广告数据,请求服务器 * 封装广告数据,请求服务器
* *
...@@ -266,88 +255,10 @@ public class CsjVedioAdManager implements VedioAdManagerView { ...@@ -266,88 +255,10 @@ public class CsjVedioAdManager implements VedioAdManagerView {
return vo; return vo;
} }
@Override
public MintsApplication getBaseApplication() {
return (MintsApplication) activity.getApplication();
}
/**
* 显示加载进度条(自定义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 setCsjVedioAdListener(CsjVedioAdListener csjVedioAdListener) { public void setCsjVedioAdListener(CsjVedioAdListener csjVedioAdListener) {
this.csjVedioAdListener = csjVedioAdListener; this.csjVedioAdListener = csjVedioAdListener;
} }
public interface CsjVedioAdListener { public interface CsjVedioAdListener {
void csjVedioAdFail(); void csjVedioAdFail();
......
...@@ -189,12 +189,12 @@ public class VedioAdingManager { ...@@ -189,12 +189,12 @@ public class VedioAdingManager {
public void onDestory() { public void onDestory() {
if (csjVedioAdManager != null) { if (csjVedioAdManager != null) {
csjVedioAdManager.setCsjVedioAdListener(null); csjVedioAdManager.setCsjVedioAdListener(null);
csjVedioAdManager.destory(); csjVedioAdManager.onDestory();
csjVedioAdManager = null; csjVedioAdManager = null;
} }
if (ylhVedioAdManager != null) { if (ylhVedioAdManager != null) {
ylhVedioAdManager.setYlhVedioAdListener(null); ylhVedioAdManager.setYlhVedioAdListener(null);
ylhVedioAdManager.destory(); ylhVedioAdManager.onDestory();
ylhVedioAdManager = null; ylhVedioAdManager = null;
} }
...@@ -210,7 +210,9 @@ public class VedioAdingManager { ...@@ -210,7 +210,9 @@ public class VedioAdingManager {
*/ */
public interface VedioAdingListener { public interface VedioAdingListener {
void vedioAdingListenerError(String adType); void vedioAdingListenerError(String adType);
void vedioAdingListenerFail(String adType); void vedioAdingListenerFail(String adType);
void vedioAdingListenerSuccess(String adType); void vedioAdingListenerSuccess(String adType);
} }
...@@ -255,7 +257,7 @@ public class VedioAdingManager { ...@@ -255,7 +257,7 @@ public class VedioAdingManager {
isVedioAdDownload = true; isVedioAdDownload = true;
} }
}); });
ylhVedioAdManager.loanYlhAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId()); ylhVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} else if (TextUtils.equals(vedioAdType, Constant.CSJ_VEDIO_AD)) { } else if (TextUtils.equals(vedioAdType, Constant.CSJ_VEDIO_AD)) {
// 穿山甲激励视频 // 穿山甲激励视频
if (csjVedioAdManager == null) { if (csjVedioAdManager == null) {
...@@ -290,7 +292,7 @@ public class VedioAdingManager { ...@@ -290,7 +292,7 @@ public class VedioAdingManager {
isVedioAdDownload = true; isVedioAdDownload = true;
} }
}); });
csjVedioAdManager.loadCsjAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId()); csjVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
package com.mints.goodmoney.ad.video; package com.mints.goodmoney.ad.video;
import android.app.Activity; import android.app.Activity;
import android.content.DialogInterface;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils;
import android.view.KeyEvent;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.TrackManager; import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.manager.YlhAdManager; import com.mints.goodmoney.manager.YlhAdManager;
import com.mints.goodmoney.mvp.presenters.YlhVedioAdPresenter; import com.mints.goodmoney.mvp.presenters.YlhVedioAdPresenter;
import com.mints.goodmoney.mvp.views.VedioAdManagerView; import com.mints.goodmoney.mvp.views.VedioAdManagerView;
import com.mints.goodmoney.ui.widgets.LoadingDialog;
import com.mints.goodmoney.utils.LogUtil; import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import com.qq.e.ads.rewardvideo.RewardVideoAD; import com.qq.e.ads.rewardvideo.RewardVideoAD;
import com.qq.e.ads.rewardvideo.RewardVideoADListener; import com.qq.e.ads.rewardvideo.RewardVideoADListener;
import com.qq.e.comm.util.AdError; import com.qq.e.comm.util.AdError;
...@@ -24,7 +18,7 @@ import java.util.HashMap; ...@@ -24,7 +18,7 @@ import java.util.HashMap;
/** /**
* 优量汇视频 * 优量汇视频
*/ */
public class YlhVedioAdManager implements VedioAdManagerView { public class YlhVedioAdManager extends BaseVideoAd implements VedioAdManagerView {
private static YlhVedioAdManager _inst; private static YlhVedioAdManager _inst;
...@@ -38,8 +32,6 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -38,8 +32,6 @@ public class YlhVedioAdManager implements VedioAdManagerView {
Activity activity; Activity activity;
protected LoadingDialog progressDialog;
private boolean isClickScreen = true; // 是否点击屏幕跳转广告 private boolean isClickScreen = true; // 是否点击屏幕跳转广告
public static YlhVedioAdManager getInstance(Activity activity) { public static YlhVedioAdManager getInstance(Activity activity) {
...@@ -52,6 +44,7 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -52,6 +44,7 @@ public class YlhVedioAdManager implements VedioAdManagerView {
} }
private YlhVedioAdManager(Activity activity) { private YlhVedioAdManager(Activity activity) {
super(activity);
init(activity); init(activity);
return; return;
} }
...@@ -63,7 +56,8 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -63,7 +56,8 @@ public class YlhVedioAdManager implements VedioAdManagerView {
ylhVedioAdPresenter.attachView(this); ylhVedioAdPresenter.attachView(this);
} }
public void destory() { @Override
public void onDestory() {
if (ylhVedioAdPresenter != null) { if (ylhVedioAdPresenter != null) {
ylhVedioAdPresenter.dispose(); ylhVedioAdPresenter.dispose();
ylhVedioAdPresenter.detachView(); ylhVedioAdPresenter.detachView();
...@@ -75,7 +69,8 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -75,7 +69,8 @@ public class YlhVedioAdManager implements VedioAdManagerView {
/** /**
* 加载优量汇激励视频 * 加载优量汇激励视频
*/ */
public void loanYlhAd(Activity activity, int curCoin, String carrierType, String extraId) { @Override
public void loadAd(Activity activity, int curCoin, String carrierType, String extraId) {
this.activity = activity; this.activity = activity;
isClickScreen = true; isClickScreen = true;
this.curCoin = curCoin; this.curCoin = curCoin;
...@@ -203,10 +198,6 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -203,10 +198,6 @@ public class YlhVedioAdManager implements VedioAdManagerView {
rewardVideoAD.loadAD(); rewardVideoAD.loadAD();
} }
@Override
public void checkSuc(boolean lyCmtFlag) {
}
/** /**
* 第四步 封装广告数据,请求服务器 * 第四步 封装广告数据,请求服务器
* *
...@@ -236,83 +227,6 @@ public class YlhVedioAdManager implements VedioAdManagerView { ...@@ -236,83 +227,6 @@ public class YlhVedioAdManager implements VedioAdManagerView {
return vo; return vo;
} }
@Override
public MintsApplication getBaseApplication() {
return (MintsApplication) activity.getApplication();
}
/**
* 显示加载进度条(自定义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 setYlhVedioAdListener(YlhVedioAdListener ylhVedioAdListener) { public void setYlhVedioAdListener(YlhVedioAdListener ylhVedioAdListener) {
this.ylhVedioAdListener = ylhVedioAdListener; this.ylhVedioAdListener = ylhVedioAdListener;
} }
......
...@@ -99,6 +99,10 @@ object Constant { ...@@ -99,6 +99,10 @@ object Constant {
const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹 const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹
const val CARRIER_ZHANGYUE = "ZHANGYUE" //阅读书城 const val CARRIER_ZHANGYUE = "ZHANGYUE" //阅读书城
const val CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE = "CHALLENGE_SHAREFRIEND_DOUBLE" //邀请好友翻倍 const val CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE = "CHALLENGE_SHAREFRIEND_DOUBLE" //邀请好友翻倍
const val CARRIER_HOMEVEDIO = "HOMEVEDIO" //首页红包
const val CARRIER_HOMEVEDIO_DOUBLE = "HOMEVEDIO_DOUBLE" //首页红包翻倍
const val CARRIER_SMALLHOMEVEDIO = "SMALLHOMEVEDIO" //首页红包
const val CARRIER_SMALLHOMEVEDIO_DOUBLE = "SMALLHOMEVEDIO_DOUBLE" //首页红包翻倍
const val SHAREFRIEND_COMPLETE_1 = "SHAREFRIEND_COMPLETE_1" //邀请任务1 const val SHAREFRIEND_COMPLETE_1 = "SHAREFRIEND_COMPLETE_1" //邀请任务1
const val SHAREFRIEND_COMPLETE_2 = "SHAREFRIEND_COMPLETE_2" //邀请任务2 const val SHAREFRIEND_COMPLETE_2 = "SHAREFRIEND_COMPLETE_2" //邀请任务2
......
...@@ -40,10 +40,14 @@ object BxmManager { ...@@ -40,10 +40,14 @@ object BxmManager {
fun loadButtonAd(activity: Activity?, viewGroup: ViewGroup) { fun loadButtonAd(activity: Activity?, viewGroup: ViewGroup) {
if (activity == null) return if (activity == null) return
try {
if (bdAdvanceButtonAd == null) { if (bdAdvanceButtonAd == null) {
bdAdvanceButtonAd = BDAdvanceButtonAd(activity, viewGroup, BUTTON_AD_SPOT_ID) bdAdvanceButtonAd = BDAdvanceButtonAd(activity, viewGroup, BUTTON_AD_SPOT_ID)
} }
bdAdvanceButtonAd?.loadAd() bdAdvanceButtonAd?.loadAd()
} catch (e: Exception) {
e.printStackTrace()
}
} }
fun onDestory() { fun onDestory() {
......
...@@ -5,20 +5,20 @@ import java.io.Serializable; ...@@ -5,20 +5,20 @@ import java.io.Serializable;
public class MainVedioMsgBean implements Serializable { public class MainVedioMsgBean implements Serializable {
private boolean toCreateReward; private boolean toCreateReward;
private int bigRewardCoin; private int rewardDoubleCoin;
private int smallRewardCoin; private int rewardCoin;
private int createRewardNeedTime; private int createRewardNeedTime;
public boolean isToCreateReward() { public boolean isToCreateReward() {
return toCreateReward; return toCreateReward;
} }
public int getBigRewardCoin() { public int getRewardDoubleCoin() {
return bigRewardCoin; return rewardDoubleCoin;
} }
public int getSmallRewardCoin() { public int getRewardCoin() {
return smallRewardCoin; return rewardCoin;
} }
public int getCreateRewardNeedTime() { public int getCreateRewardNeedTime() {
......
...@@ -117,28 +117,6 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -117,28 +117,6 @@ class HomePresenter : BasePresenter<HomeView>() {
}) })
} }
fun requestAddHomeVedioReward() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.requestAddHomeVedioReward(),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.getStatus()
when (code) {
200 -> getHomeVedioMsg()
}
}
})
}
/** /**
* 游客登录 * 游客登录
*/ */
......
...@@ -2,5 +2,4 @@ package com.mints.goodmoney.mvp.views; ...@@ -2,5 +2,4 @@ package com.mints.goodmoney.mvp.views;
public interface VedioAdManagerView extends BaseView { public interface VedioAdManagerView extends BaseView {
void checkSuc(boolean lyCmtFlag);
} }
...@@ -310,17 +310,9 @@ public interface LoanService { ...@@ -310,17 +310,9 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/getHomeVedioMsg") @POST("api/getHomeVedioBaseMsg")
Observable<BaseResponse<MainVedioMsgBean>> getHomeVedioMsg(); Observable<BaseResponse<MainVedioMsgBean>> getHomeVedioMsg();
/**
* 请求红包
*
* @return
*/
@POST("api/requestAddHomeVedioReward")
Observable<BaseResponse<Object>> requestAddHomeVedioReward();
/** /**
* 阅读时长 * 阅读时长
* *
......
...@@ -33,7 +33,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -33,7 +33,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
private var curCoin = 0 //传入金币 private var curCoin = 0 //传入金币
private var extraId = ""//传入key private var extraId = ""//传入key
private var carrierType = ""//传入载体 private var carrierType = ""//传入载体
private var loadVedioFailCount = 0 private var loadVedioFailCount = 0 // 视频失败次数
override fun getContentViewLayoutID() = R.layout.activity_award override fun getContentViewLayoutID() = R.layout.activity_award
...@@ -66,11 +66,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -66,11 +66,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
startTime() startTime()
when (carrierType) { when (carrierType) {
Constant.CHALLENGE_SHAREFRIEND,
Constant.SHAREFRIEND_COMPLETE_1, Constant.SHAREFRIEND_COMPLETE_2, Constant.SHAREFRIEND_COMPLETE_1, Constant.SHAREFRIEND_COMPLETE_2,
Constant.SHAREFRIEND_COMPLETE_3, Constant.SHAREFRIEND_COMPLETE_4, Constant.SHAREFRIEND_COMPLETE_3, Constant.SHAREFRIEND_COMPLETE_4,
Constant.SHAREFRIEND_COMPLETE_5, Constant.SHAREFRIEND_COMPLETE_6, Constant.SHAREFRIEND_COMPLETE_5, Constant.SHAREFRIEND_COMPLETE_6,
Constant.CARRIER_HOMEVEDIO_SMALL, Constant.CARRIER_GAME_ONLINE -> { Constant.CARRIER_GAME_ONLINE -> {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
...@@ -78,16 +77,26 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -78,16 +77,26 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
} }
// Constant.CHALLENGE_SHAREFRIEND -> { Constant.CARRIER_HOMEVEDIO -> {
// val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
// vo["carrierType"] = carrierType vo["carrierType"] = carrierType
// awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
//
// tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText(curCoin.toString() + "金币已到账")
// tvAwardNext.setText("金币翻倍") tvAwardNext.setText("看视频赚${extraId}金币")
//
// carrierType = Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE carrierType = Constant.CARRIER_HOMEVEDIO_DOUBLE
// } }
Constant.CHALLENGE_SHAREFRIEND -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardNext.setText("金币翻倍")
carrierType = Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
}
Constant.CARRIER_NEW_USER -> { Constant.CARRIER_NEW_USER -> {
tvAwardContent.setText("新人红包") tvAwardContent.setText("新人红包")
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
...@@ -112,8 +121,14 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -112,8 +121,14 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
} }
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
} }
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
tvAwardContent.setText("看视频领取" + curCoin + "金币")
}
else -> { else -> {
tvAwardContent.setText("点击领取" + curCoin + "金币") tvAwardContent.setText(curCoin.toString() + "金币已到账")
} }
} }
} }
...@@ -171,10 +186,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -171,10 +186,11 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
R.id.tvAwardNext -> { R.id.tvAwardNext -> {
when (carrierType) { when (carrierType) {
// 只有看视频才能领金币 // 只有看视频才能领金币
Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE,
Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD, Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE,Constant.CARRIER_HOMEVEDIO_BIG, Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER-> { Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
awardVedio() awardVedio()
} }
else -> { else -> {
......
...@@ -24,7 +24,7 @@ class CoinRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListen ...@@ -24,7 +24,7 @@ class CoinRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListen
override fun getContentViewLayoutID() = R.layout.activity_drawcash_record override fun getContentViewLayoutID() = R.layout.activity_drawcash_record
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
tv_title.text = "金币记录" tv_title.text = "金币明细"
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.setOnClickListener(this) iv_left_icon.setOnClickListener(this)
......
...@@ -90,7 +90,7 @@ class DrawcashActivity : BaseActivity(), ...@@ -90,7 +90,7 @@ class DrawcashActivity : BaseActivity(),
readyGo(DrawcashRecordActivity::class.java) readyGo(DrawcashRecordActivity::class.java)
} }
R.id.rl_coin -> { R.id.rl_coin -> {
readyGo(CoinRecordActivity::class.java) // readyGo(CoinRecordActivity::class.java)
} }
R.id.tvDrawcashWx -> { R.id.tvDrawcashWx -> {
if (!TextUtils.isEmpty(userConfig?.openid)) { if (!TextUtils.isEmpty(userConfig?.openid)) {
......
...@@ -110,6 +110,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -110,6 +110,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
item_title_id.setOnClickListener(this) item_title_id.setOnClickListener(this)
iv_right_icon.setOnClickListener(this) iv_right_icon.setOnClickListener(this)
btn_withdraw.setOnClickListener(this) btn_withdraw.setOnClickListener(this)
btn_coinRecord.setOnClickListener(this)
item_title_invitecode.setOnClickListener(this) item_title_invitecode.setOnClickListener(this)
item_title_invitecode_copy.setOnClickListener(this) item_title_invitecode_copy.setOnClickListener(this)
ll_my_login.setOnClickListener(this) ll_my_login.setOnClickListener(this)
...@@ -577,6 +578,15 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -577,6 +578,15 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(DrawcashActivity::class.java) readyGo(DrawcashActivity::class.java)
} }
R.id.btn_coinRecord -> {
if (userConfig == null) {
showToast("网络异常,请检测网络!")
myPresenter.getUserHallBaseMsg()
return
}
readyGo(CoinRecordActivity::class.java)
}
R.id.item_title_invitecode -> { R.id.item_title_invitecode -> {
if (userConfig != null) { if (userConfig != null) {
val invitedCode = userConfig!!.userMsg.idcode val invitedCode = userConfig!!.userMsg.idcode
......
...@@ -39,21 +39,13 @@ ...@@ -39,21 +39,13 @@
android:id="@+id/tvDrawcashGold" android:id="@+id/tvDrawcashGold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toStartOf="@id/iv_coin"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="0" android:text="0"
android:layout_alignParentRight="true"
android:textColor="@color/main_mints" android:textColor="@color/main_mints"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
<ImageView
android:id="@+id/iv_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:padding="4dp"
android:src="@mipmap/ic_arrow_more" />
</RelativeLayout> </RelativeLayout>
<View <View
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp" android:layout_height="204dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="90dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
...@@ -112,15 +112,32 @@ ...@@ -112,15 +112,32 @@
android:textColor="@color/my_color_orange" android:textColor="@color/my_color_orange"
android:textSize="28sp" /> android:textSize="28sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/btn_coinRecord"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:background="@drawable/shape_btn_switch"
android:text="明细"
android:textColor="@color/white"
android:textSize="16sp" />
<Button <Button
android:id="@+id/btn_withdraw" android:id="@+id/btn_withdraw"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="32dp" android:layout_marginTop="10dp"
android:layout_height="30dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:background="@drawable/shape_btn_switch" android:background="@drawable/shape_btn_switch"
android:text="提现" android:text="提现"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
......
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