Commit 9b833f06 authored by 张释方's avatar 张释方

大转盘添加小满科技

parents 912e23d8 cb2ffa05
......@@ -14,8 +14,8 @@ android {
applicationId "com.mints.goodmoney"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 25
versionName "1.2.4"
versionCode 30
versionName "1.3.0"
flavorDimensions "default"
// dex突破65535的限制
......@@ -199,7 +199,8 @@ dependencies {
implementation 'com.github.SheHuan:NiceImageView:1.0.5'
// 跑马灯
implementation 'com.sunfusheng:marqueeview:1.2.0'
// 检测运行设备是否模拟器
implementation 'com.snail:antifake:1.4'
// 工具类
// gson
......
{
"version": 1,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.mints.goodmoney",
"variantName": "goodmoneypkgRelease",
"elements": [
{
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 25,
"versionName": "1.2.4",
"enabled": true,
"outputFile": "goodmoneypkg_1.2.4.apk"
}
]
}
\ No newline at end of file
......@@ -131,4 +131,8 @@ public class AppConfig {
*/
public static boolean isSuperTask = false;
/**
* 激励视频是否休眠 false-不休眠 提示:加载失败,请稍后重试。
*/
public static boolean isVideoSleep = false;
}
......@@ -1017,6 +1017,39 @@ class DeviceInfo private constructor() {
return 0
}
/**
* 获取后台运行APP
*/
fun getRunningApp(): String {
try {
val appList: MutableList<MutableMap<String, String>> = ArrayList()
val localPackageManager = mContext?.packageManager
localPackageManager?.let {
val localList = localPackageManager.getInstalledPackages(0)
for (i in 0 until localList.size) {
val pinfo = localList.get(i) as PackageInfo
if (pinfo.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM > 0) {
//系统程序 忽略
continue
}
if (ApplicationInfo.FLAG_UPDATED_SYSTEM_APP and pinfo.applicationInfo.flags == 0
&& ApplicationInfo.FLAG_STOPPED and pinfo.applicationInfo.flags == 0) {
val appMap: MutableMap<String, String> = HashMap()
appMap["appName"] = pinfo.applicationInfo.loadLabel(mContext!!.packageManager) as String
appMap["appPkg"] = pinfo.packageName
appList.add(appMap)
}
}
return JsonUtil.toJson(appList)
}
}catch (e:Exception){
}
return ""
}
companion object {
private var _inst: DeviceInfo? = null
val instance: DeviceInfo
......
package com.mints.goodmoney.manager
import com.mints.goodmoney.MintsApplication
import com.snail.antifake.jni.EmulatorDetectUtil
/**
* 描述:模拟器校验
* 作者:孟崔广
*/
object SimulatorManager {
/**
* 是否是模拟器 0-不是模拟器
*/
fun isEmulator(): Int {
try {
return if (EmulatorDetectUtil.isEmulator(MintsApplication.getContext())) 1 else 0
} catch (e: Exception) {
e.printStackTrace()
}
return 0
}
}
\ No newline at end of file
......@@ -131,4 +131,16 @@ public class TrackManager {
trackPresenter.reportErrornterface(url, request);
}
}
public void getAdWeight() {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.getAdWeight();
}
}
public void riskinfo() {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
trackPresenter.riskinfo();
}
}
}
package com.mints.goodmoney.manager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.ui.fragment.MainFragment
import com.mints.goodmoney.utils.ForegroundOrBackground
import com.mints.goodmoney.utils.LogUtil
/**
* 描述:用户广告视频数和权重
* 作者:孟崔广
*/
object UserWeight {
private val TAG = UserWeight::class.java.simpleName
private val videoAdingManager by lazy { VideoAdingManager.getInstance(ForegroundOrBackground.getApp_activity()) }
fun initAdWeight(data: UserTaskMsgBean) {
AppConfig.isVideoSleep=data.vedioRules.isVedioSleep
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,
data.vedioRules.rtA_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} " +
"rtaWeight:${data.vedioRules.rtA_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
AppConfig.rtaVideoAdCount = data.vedioRules.rtA_VEDIO.surplus
AppConfig.csjFullVideoAdCount = data.vedioRules.csjfulL_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}"
)
}
}
\ No newline at end of file
......@@ -13,6 +13,8 @@ public class VedioRulesBean implements Serializable {
private KSVedioBean KS_VEDIO;
private RTAVedioBean RTA_VEDIO;
private boolean flVideoFlag;
private boolean vedioSleep;
public class CsjVedioBean implements Serializable {
private int surplus;//剩余可看视频数
......@@ -158,4 +160,8 @@ public class VedioRulesBean implements Serializable {
public boolean isFlVideoFlag() {
return flVideoFlag;
}
public boolean isVedioSleep() {
return vedioSleep;
}
}
......@@ -199,53 +199,4 @@ public class AwardPresenter extends BasePresenter<AwardView> {
});
}
public void riskinfo() {
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
setT(deviceInfo.getAppInfoMap());
}
@Override
public void doInUIThread() {
HashMap<String, Object> vo = new HashMap<>();
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("os", "android");
vo.put("model", deviceInfo.getBrand() + " " + deviceInfo.getMobileModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("applist", getT());
vo.put("eventid", Constant.RISK_EVENT_ID_TASK);
vo.put("ischarge", deviceInfo.isCharging());
vo.put("isusbdebug", deviceInfo.getGetUsbStatus());
vo.put("iswifi", deviceInfo.getGetWifiConnected());
vo.put("isroot", deviceInfo.isRoot());
vo.put("isvpn", deviceInfo.isVPN());
vo.put("memory", deviceInfo.getTotalMemory() + "+" + deviceInfo.getTotalStorage());
vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", MintsApplication.OAID);
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
});
}
}
......@@ -8,6 +8,7 @@ import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.ShumeiManager;
import com.mints.goodmoney.manager.TrackManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean;
......@@ -152,7 +153,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("oaid", MintsApplication.OAID);
}
riskinfo(deviceInfo, getT());
TrackManager.getInstance().riskinfo();
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
......@@ -314,46 +315,4 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
});
}
/**
* 风控信息
*/
private void riskinfo(DeviceInfo deviceInfo, String appPkgList) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("os", "android");
vo.put("model", deviceInfo.getBrand() + " " + deviceInfo.getMobileModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("applist", appPkgList);
vo.put("eventid", Constant.RISK_EVENT_ID_DRAWCASH);
vo.put("ischarge", deviceInfo.isCharging());
vo.put("isusbdebug", deviceInfo.getGetUsbStatus());
vo.put("iswifi", deviceInfo.getGetWifiConnected());
vo.put("isroot", deviceInfo.isRoot());
vo.put("isvpn", deviceInfo.isVPN());
vo.put("memory", deviceInfo.getTotalMemory() + "+" + deviceInfo.getTotalStorage());
vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", MintsApplication.OAID);
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
}
......@@ -4,10 +4,7 @@ import android.text.TextUtils
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.JpushManager
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.*
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.views.LoginView
......@@ -251,7 +248,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = t.toString()
riskinfo(deviceInfo, t.toString())
TrackManager.getInstance().riskinfo()
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
......@@ -281,42 +278,4 @@ class LoginPresenter : BasePresenter<LoginView>() {
}
/**
* 风控信息
*/
fun riskinfo(deviceInfo: DeviceInfo, appPkgList: String) {
val vo = HashMap<String, Any>()
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["applist"] = appPkgList
vo["eventid"] = Constant.RISK_EVENT_ID_LOGIN
vo["ischarge"] = deviceInfo.isCharging
vo["isusbdebug"] = deviceInfo.getUsbStatus
vo["iswifi"] = deviceInfo.getWifiConnected
vo["isroot"] = deviceInfo.isRoot
vo["isvpn"] = deviceInfo.isVPN
vo["memory"] = deviceInfo.totalMemory + "+" + deviceInfo.totalStorage
vo["operator"] = deviceInfo.operator
vo["idfa"] = ""
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = MintsApplication.OAID
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
object : BaseSubscriber<BaseResponse<Object>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<Object>) {
}
})
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.presenters;
import android.app.Activity;
import android.text.TextUtils;
import com.google.gson.JsonObject;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.SimulatorManager;
import com.mints.goodmoney.manager.UserWeight;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.CommonParamBean;
import com.mints.goodmoney.mvp.model.UserTaskMsgBean;
import com.mints.goodmoney.utils.AccessibilityUtils;
import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.goodmoney.utils.rxutil.CommonRxTask;
import com.mints.goodmoney.utils.rxutil.RxjavaUtil;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
......@@ -66,6 +75,9 @@ public class TrackPresenter extends BaseTrackPresenter {
@Override
public void onNext(BaseResponse<Object> baseResponse) {
if (TextUtils.equals(Constant.EVENT_TYPE_ONE, eventType)) {
getAdWeight();
}
}
});
}
......@@ -302,4 +314,90 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
/**
* 获取权重
*/
public void getAdWeight() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.vedioPlans(),
new BaseSubscriber<BaseResponse<UserTaskMsgBean>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<UserTaskMsgBean> baseResponse) {
UserWeight.INSTANCE.initAdWeight(baseResponse.getData());
}
});
}
public void riskinfo() {
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
HashMap<String, Object> vo = new HashMap<>();
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
setT(deviceInfo.getAppInfoMap());
}
@Override
public void doInUIThread() {
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("os", "android");
vo.put("model", deviceInfo.getBrand() + " " + deviceInfo.getMobileModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("applist", getT());
vo.put("eventid", Constant.RISK_EVENT_ID_TASK);
vo.put("ischarge", deviceInfo.isCharging());
vo.put("isusbdebug", deviceInfo.getGetUsbStatus());
vo.put("iswifi", deviceInfo.getGetWifiConnected());
vo.put("isroot", deviceInfo.isRoot());
vo.put("isvpn", deviceInfo.isVPN());
vo.put("memory", deviceInfo.getTotalMemory() + "+" + deviceInfo.getTotalStorage());
vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", MintsApplication.OAID);
vo.put("isSimulator", SimulatorManager.INSTANCE.isEmulator());
vo.put("isAccessibility", AccessibilityUtils.isAccessibilityEnabled());
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
setT(deviceInfo.getRunningApp());
}
@Override
public void doInUIThread() {
vo.put("appRunningPkgList", getT());
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
});
}
});
}
}
......@@ -582,7 +582,6 @@ public interface LoanService {
Observable<BaseResponse<JsonObject>> reportErrornterface(@Body Map<String, Object> vo);
/**
* <<<<<<< Updated upstream
* 获取大转盘信息
*
* @return
......@@ -630,6 +629,17 @@ public interface LoanService {
@POST("api/setWechatTipsStatus")
Observable<BaseResponse<JsonObject>> setWechatTipsStatus(@Body Map<String, Object> vo);
<<<<<<< HEAD
=======
/**
* 获取权重信息
*
* @return
*/
@POST("api/vedioPlans")
Observable<BaseResponse<UserTaskMsgBean>> vedioPlans();
>>>>>>> cb2ffa05e5c027ec30d75fc7298c1e0c249a8eb5
/**
* 默认http工厂
*/
......
......@@ -502,7 +502,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
* 获取激励视频
*/
private fun awardVideo() {
if (videoAdingManager.videoFinishFlag) {
if (AppConfig.isVideoSleep) {
showToast("加载失败,请稍后重试。")
return
} else if (videoAdingManager.videoFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
}
......@@ -529,7 +532,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......@@ -608,7 +611,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 上传风控信息
if (riskFlag) {
awardPresenter.riskinfo()
TrackManager.getInstance().riskinfo()
}
}
......
......@@ -25,6 +25,7 @@ import com.mints.goodmoney.call.business.VideoDBHelper
import com.mints.goodmoney.call.detail.DetailApplyActivity
import com.mints.goodmoney.call.permission.PermissionActivity
import com.mints.goodmoney.call.permission.PermissionManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.DrawVideoBean
......@@ -321,7 +322,10 @@ class DrawNativeVideoActivity : BaseActivity(),
* 获取激励视频
*/
private fun awardVideo() {
if (videoAdingManager.videoFinishFlag) {
if (AppConfig.isVideoSleep) {
showToast("加载失败,请稍后重试。")
return
} else if (videoAdingManager.videoFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
}
......@@ -345,7 +349,7 @@ class DrawNativeVideoActivity : BaseActivity(),
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -14,6 +14,7 @@ import com.mints.goodmoney.call.business.VideoDBHelper
import com.mints.goodmoney.call.detail.DetailApplyActivity
import com.mints.goodmoney.call.permission.PermissionActivity
import com.mints.goodmoney.call.permission.PermissionManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.KylBean
......@@ -163,7 +164,10 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
* 获取激励视频
*/
private fun awardVideo() {
if (videoAdingManager.videoFinishFlag) {
if (AppConfig.isVideoSleep) {
showToast("加载失败,请稍后重试。")
return
} else if (videoAdingManager.videoFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
}
......@@ -187,7 +191,7 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -8,6 +8,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MorningClockBean
import com.mints.goodmoney.mvp.model.VideoAdingBean
......@@ -107,7 +108,10 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
* 获取激励视频
*/
private fun awardVideo() {
if (videoAdingManager.videoFinishFlag) {
if (AppConfig.isVideoSleep) {
showToast("加载失败,请稍后重试。")
return
} else if (videoAdingManager.videoFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
}
......@@ -131,7 +135,7 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......
......@@ -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);
}
......
......@@ -239,7 +239,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 新人福利 放到个人中心展示 防止首页红包转动异常
// 设置视频权重
initAdWeight(data)
UserWeight.initAdWeight(data)
initExpress(data.flowAdRules)
// 调用金币视频信息接口
......@@ -642,48 +642,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,
data.vedioRules.rtA_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} " +
"rtaWeight:${data.vedioRules.rtA_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
AppConfig.rtaVideoAdCount = data.vedioRules.rtA_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"ylhCount:${AppConfig.ylhAdCount} " +
"sdhzCount:${AppConfig.wnVideoAdCount} " +
"csjFullCount:${AppConfig.csjFullVideoAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " +
"ratCount:${AppConfig.rtaVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount}"
)
}
private fun initExpress(flowAdRules: FlowAdRulesBean) {
PreLoadExpressManager.init(flowAdRules.csj, flowAdRules.ylh, flowAdRules.ks)
}
......
......@@ -329,8 +329,8 @@ class MyFragment : BaseFragment(),
AppConfig.wzReadCoin = data.shareNews.readCoin
}
// 更新权重
initAdWeight(data)
// 设置视频权重
UserWeight.initAdWeight(data)
initExpress(data.flowAdRules)
AppConfig.app_black_name = data.userRiskApps.userRiskAppName
AppConfig.app_black_pkg = data.userRiskApps.userRiskAppPkg
......@@ -1179,7 +1179,10 @@ class MyFragment : BaseFragment(),
* 获取激励视频
*/
private fun awardVideo(coin: Int, carrierType: String) {
if (videoAdingManager.videoFinishFlag) {
if (AppConfig.isVideoSleep) {
showToast("加载失败,请稍后重试。")
return
} else if (videoAdingManager.videoFinishFlag) {
showToast("今日视频已看完,请明天再来吧")
return
}
......@@ -1206,7 +1209,7 @@ class MyFragment : BaseFragment(),
override fun videoAdingListenerFail(adType: String) {
loadVideoFailCount++
if (loadVideoFailCount >= 2) {
if (loadVideoFailCount >= 3) {
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
......@@ -1335,48 +1338,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,
data.vedioRules.rtA_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} " +
"rtaWeight:${data.vedioRules.rtA_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
AppConfig.rtaVideoAdCount = data.vedioRules.rtA_VEDIO.surplus
AppConfig.csjFullVideoAdCount = data.vedioRules.csjfulL_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)
}
......
......@@ -18,6 +18,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.MokuManager
import com.mints.goodmoney.manager.TrackManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.XmManager
import com.mints.goodmoney.mvp.model.ClickTurnBean
......@@ -133,6 +134,8 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
}
override fun getTurnTableSuc(data: TurnBean) {
TrackManager.getInstance().getAdWeight()
if (AppConfig.fragmentClickFlag != Constant.FRAGMENT_CLICK_THREE ||
activity == null || requireActivity().isFinishing) {
return
......
......@@ -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)
......
package com.mints.goodmoney.utils;
import android.content.Context;
import android.view.accessibility.AccessibilityManager;
import com.mints.goodmoney.MintsApplication;
/**
* 无障碍服务
*/
public class AccessibilityUtils {
/**
* 判断用户是否开启无障碍服务
*
* @return 0-未开启无障碍功能
* @throws RuntimeException
*/
public static int isAccessibilityEnabled() {
try {
// 检查AccessibilityService是否开启
AccessibilityManager am = (AccessibilityManager) MintsApplication.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
boolean isAccessibilityEnabled_flag = am.isEnabled();
return isAccessibilityEnabled_flag ? 1 : 0;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
// boolean isExploreByTouchEnabled_flag = false;
//
// // 检查无障碍服务是否以语音播报的方式开启
// isExploreByTouchEnabled_flag = isScreenReaderActive(context);
//
// return (isAccessibilityEnabled_flag && isExploreByTouchEnabled_flag);
}
}
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