Commit b0fed741 authored by mengcuiguang's avatar mengcuiguang

添加风控信息

parent 2165a9dd
......@@ -9,8 +9,8 @@ android {
applicationId "com.mints.fairyland"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 8
versionName "1.0.5"
versionCode 9
versionName "1.0.6"
flavorDimensions "default"
// dex突破65535的限制
......@@ -197,7 +197,7 @@ dependencies {
// 三方接入
// leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
implementation 'cn.jiguang.sdk:jpush:3.6.6'
implementation 'cn.jiguang.sdk:jcore:2.3.8'
......
......@@ -80,27 +80,27 @@ public class AppConfig {
/**
* wnVideo 剩余广告播放数
*/
public static int wnVideoAdCount = 5;
public static int wnVideoAdCount = 0;
/**
* csjFull 剩余广告播放数
*/
public static int csjFullVideoAdCount = 5;
public static int csjFullVideoAdCount = 0;
/**
* flVideo 剩余广告播放数
*/
public static int flVideoAdCount = 5;
public static int flVideoAdCount = 0;
/**
* shVideo 剩余广告播放数
*/
public static int shVideoAdCount = 5;
public static int shVideoAdCount = 0;
/**
* ksVideo 剩余广告播放数
*/
public static int ksVideoAdCount = 5;
public static int ksVideoAdCount = 0;
/**
* rtaVideo 剩余广告播放数
*/
public static int rtaVideoAdCount = 5;
public static int rtaVideoAdCount = 0;
/**
* csjFull 剩余广告播放数
*/
......
......@@ -26,7 +26,7 @@ public class TtCsjAdManager {
public static String TT_AD_BANNER_MY = "945932596";// 个人中心
public static String TT_AD_BANNER_JULEYUN = "";// 聚乐云
/*激励视频*/
public static String TT_AD_VEDIO_MAIN_DEV = "945710875";// 开发使用
public static String TT_AD_VEDIO_MAIN_DEV = "945710859";// 开发使用
public static String TT_AD_VEDIO_DRINK = "945710875";//喝水打卡
public static String TT_AD_VEDIO_MAIN = "945710875";// 我的界面视频
......
package com.mints.fairyland.mvp.presenters;
import android.app.Activity;
import android.text.TextUtils;
import com.google.gson.JsonObject;
import com.mints.fairyland.MintsApplication;
......@@ -74,6 +75,9 @@ public class TrackPresenter extends BaseTrackPresenter {
@Override
public void onNext(BaseResponse<Object> baseResponse) {
if (TextUtils.equals(Constant.EVENT_TYPE_ONE, eventType)) {
getAdWeight();
}
}
});
}
......
......@@ -532,7 +532,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -345,7 +345,7 @@ class DrawNativeVideoActivity : BaseActivity(),
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -191,7 +191,7 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -135,7 +135,7 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -106,13 +106,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
}
item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "用户ID"
val invitedCode = ContextCompat.getDrawable(mContext, R.mipmap.icon_settings_invite)
invitedCode?.setBounds(0, 0, 56, 56)
item_invitedCode.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(invitedCode, null, null, null)
item_invitedCode.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_invitedCode.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
item_invitedCode.findViewById<TextView>(R.id.tv_right).text = UserManager.getInstance().codeID
item_invitedCode.findViewById<TextView>(R.id.tv_right).text = "ZZ-" + UserManager.getInstance().codeID
item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存"
val cleanCache = ContextCompat.getDrawable(this, R.mipmap.icon_settings_clean)
......
......@@ -34,6 +34,9 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
if (android.os.Build.VERSION.SDK_INT != Build.VERSION_CODES.O) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
......
......@@ -238,7 +238,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 新人福利 放到个人中心展示 防止首页红包转动异常
// 设置视频权重
initAdWeight(data)
UserWeight.initAdWeight(data)
initExpress(data.flowAdRules)
// 调用金币视频信息接口
......@@ -561,42 +561,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
})
}
/**
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
videoAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate,
data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate,
data.vedioRules.fL_VEDIO.rate,
data.vedioRules.corAl_VIDEO.rate,
data.vedioRules.csjfulL_VEDIO.rate,
data.vedioRules.kS_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " +
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " +
"flWeight:${data.vedioRules.fL_VEDIO.rate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
)
// 广告视频数
AppConfig.csjVideoAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVideoAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVideoAdCount = data.vedioRules.fL_VEDIO.surplus
AppConfig.csjFullVideoAdCount = data.vedioRules.csjfulL_VEDIO.surplus
AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus
AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"ylhCount:${AppConfig.ylhAdCount} " +
"sdhzCount:${AppConfig.wnVideoAdCount} " +
"csjFullCount:${AppConfig.csjFullVideoAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
private fun initExpress(flowAdRules: FlowAdRulesBean) {
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks)
......
......@@ -313,7 +313,7 @@ class MyFragment : BaseFragment(),
}
// 更新权重
initAdWeight(data)
UserWeight.initAdWeight(data)
initExpress(data.flowAdRules)
AppConfig.app_black_name = data.userRiskApps.userRiskAppName
AppConfig.app_black_pkg = data.userRiskApps.userRiskAppPkg
......@@ -1077,7 +1077,7 @@ class MyFragment : BaseFragment(),
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......@@ -1203,44 +1203,6 @@ class MyFragment : BaseFragment(),
mainMyAdapter?.setOnItemChildClickListener(this)
}
/**
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
videoAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate,
data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate,
data.vedioRules.fL_VEDIO.rate,
data.vedioRules.corAl_VIDEO.rate,
data.vedioRules.csjfulL_VEDIO.rate,
data.vedioRules.kS_VEDIO.rate
)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " +
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " +
"flWeight:${data.vedioRules.fL_VEDIO.rate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate}"
)
// 广告视频数
AppConfig.csjVideoAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVideoAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVideoAdCount = data.vedioRules.fL_VEDIO.surplus
AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus
AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"ylhCount:${AppConfig.ylhAdCount} " +
"sdhzCount:${AppConfig.wnVideoAdCount} " +
"csjFullCount:${AppConfig.csjFullVideoAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " +
"rtaCount:${AppConfig.rtaVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
private fun initExpress(flowAdRules: FlowAdRulesBean) {
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks)
}
......
......@@ -108,7 +108,7 @@ class DrawcashVideoDialog(activity: Activity) :
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
ToastUtil.show(activity, "加载超时,请休息一下")
} else {
loadVideo(videoAdingManager, bean, false)
......
......@@ -24,6 +24,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:text="请关注公众号:金币宝箱,获取更多赚钱资讯" />
android:text="请关注公众号:淘金空间,获取更多赚钱资讯" />
</merge>
\ 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