Commit 79cc1e34 authored by jyx's avatar jyx

优化体外弹出失败,弹出标记本地存储

parent 27953e96
......@@ -36,7 +36,6 @@ import com.mints.flowbox.manager.wifi.WifiDataManager;
import com.mints.flowbox.net.LoanService;
import com.mints.flowbox.ui.activitys.keepalive.TriggerActivity;
import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.SystemUtils;
import com.module.legacy.oreo.RegisterJobUtils;
import com.orhanobut.logger.AndroidLogAdapter;
......@@ -183,7 +182,6 @@ public class MintsApplication extends BaseApp {
CoreAdContext.Companion.setLockerResumeCallback(new Function1<Activity, Boolean>() {
@Override
public Boolean invoke(Activity activity) {
LogUtil.d("LockerResume -> " + activity.getComponentName());
// TODO 这里利用activity实例,载入所有的体外广告,比如全屏视频、开屏等等
return true;
}
......
......@@ -74,6 +74,32 @@ class AppOutScreenGroMoreCarrierExpressManager : TTSettingConfigCallback {
}
}
fun loadADFrameLayout(_frameLayout: FrameLayout) {
if (AntiShake.check(Random.nextInt(1234)) || AntiAuditManager.instance.isBlack()) return
val isOversped = TimeRender.isOverspedMin(adLoadTime, 45)
val isPreingOversped = TimeRender.isOverspedMin(adPreingTime, 2)
if ((isLoadSuccess == 0 // 加载失败
|| adLoadTime > 0 && isOversped // 超过45分钟
|| adPreingTime > 0 && isPreingOversped && isLoadSuccess == 1) // 预加载超时
) {
adPreingTime = System.currentTimeMillis()
isLoadSuccess = 1
// 销毁及移除事件
destroy()
frameLayout = _frameLayout
if (TTMediationAdSdk.configLoadSuccess()) {
loadAd()
} else {
TTMediationAdSdk.registerConfigCallback(this)
}
}
}
/**
* config成功,加载信息流
*/
......
......@@ -73,6 +73,32 @@ class AppOutSimpleGroMoreCarrierExpressManager : TTSettingConfigCallback {
}
}
fun loadADFrameLayout(_frameLayout: FrameLayout) {
if (AntiShake.check(Random.nextInt(1234)) || AntiAuditManager.instance.isBlack()) return
val isOversped = TimeRender.isOverspedMin(adLoadTime, 45)
val isPreingOversped = TimeRender.isOverspedMin(adPreingTime, 2)
if ((isLoadSuccess == 0 // 加载失败
|| adLoadTime > 0 && isOversped // 超过45分钟
|| adPreingTime > 0 && isPreingOversped && isLoadSuccess == 1) // 预加载超时
) {
adPreingTime = System.currentTimeMillis()
isLoadSuccess = 1
// 销毁及移除事件
destroy()
frameLayout = _frameLayout
if (TTMediationAdSdk.configLoadSuccess()) {
loadAd()
} else {
TTMediationAdSdk.registerConfigCallback(this)
}
}
}
/**
* config成功,加载信息流
*/
......
......@@ -42,6 +42,10 @@ public class CleanUtils {
// 应用图标
Drawable icon = localPackageInfo.applicationInfo.loadIcon(localPackageManager);
if (packageStr.equals(context.getPackageName())) {
continue;
}
CacheListItem cacheListItem = new CacheListItem(localPackageInfo.packageName, label, icon, 0);
runningList.add(cacheListItem);
}
......
......@@ -103,7 +103,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
} else {
containerAnim.setBackgroundColor(Color.parseColor("#8278DC"))
GlideUtils.loadImageViewGif(this, R.drawable.safe_check, iv_gif)
NumAnimUtil.startAnim(tv_progress, 100f, ((mTimerMax - 6) * STEP_Interval))
NumAnimUtil.startAnim(tv_progress, 100f, ((mTimerMax - 7) * STEP_Interval))
}
mTimer = Timer()
......
......@@ -28,7 +28,6 @@ import kotlinx.android.synthetic.main.activity_bind_mobile.tvLoginNext
import kotlinx.android.synthetic.main.activity_bind_mobile.tvLoginSendcode
import kotlinx.android.synthetic.main.activity_mobile_login.*
import kotlinx.android.synthetic.main.activity_mobile_login.tvLoginAgreement
import kotlinx.android.synthetic.main.activity_wx_login.*
import kotlinx.android.synthetic.main.header_layout.*
/**
......@@ -77,7 +76,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
}
R.id.tvLoginNext -> {
if (!tvLoginAgreement.isChecked) {
ToastUtils.show("请勾选同意《用户注册协议》及《用户隐私协议》")
ToastUtils.show("请阅读并勾选同意《用户注册协议》及《用户隐私协议》")
YoYo.with(Techniques.Shake).duration(1000).repeat(1).playOn(tvLoginAgreement)
return
}
......@@ -155,6 +154,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
SpanUtils.with(tvLoginAgreement)
.append("已阅读并同意")
.append("《用户注册协议》").setClickSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
......@@ -168,7 +168,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
ds.isUnderlineText = false
}
})
.append("")
.append("")
.append("《用户隐私协议》").setClickSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
......@@ -182,7 +182,6 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
ds.isUnderlineText = false
}
})
.append("与您的利益切身相关。请您注册前务必仔细阅读!")
.create()
}
......
......@@ -96,7 +96,7 @@ class WxLoginActivity : BaseActivity(), LoginView, View.OnClickListener, OnLogin
}
R.id.rlLoginWx -> {
if (!tvLoginAgreement.isChecked) {
ToastUtils.show("请勾选同意《用户注册协议》及《用户隐私协议》")
ToastUtils.show("请阅读并勾选同意《用户注册协议》及《用户隐私协议》")
YoYo.with(Techniques.Shake).duration(1000).repeat(1).playOn(tvLoginAgreement)
return
}
......@@ -175,6 +175,7 @@ class WxLoginActivity : BaseActivity(), LoginView, View.OnClickListener, OnLogin
private fun initView() {
SpanUtils.with(tvLoginAgreement)
.append("已阅读并同意")
.append("《用户注册协议》").setClickSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
......@@ -188,7 +189,7 @@ class WxLoginActivity : BaseActivity(), LoginView, View.OnClickListener, OnLogin
ds.isUnderlineText = false
}
})
.append("")
.append("")
.append("《用户隐私协议》").setClickSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val bundle = Bundle()
......@@ -202,9 +203,7 @@ class WxLoginActivity : BaseActivity(), LoginView, View.OnClickListener, OnLogin
ds.isUnderlineText = false
}
})
.append("与您的利益切身相关。请您注册前务必仔细阅读!")
.create()
}
private fun initListener() {
......
......@@ -19,8 +19,10 @@ import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_apk.*
import kotlinx.android.synthetic.main.activity_apk.btnClean
import kotlinx.android.synthetic.main.activity_apk.fl_ad
import kotlinx.android.synthetic.main.activity_apk.ivImg
import kotlinx.android.synthetic.main.activity_apk.iv_close
import kotlinx.android.synthetic.main.activity_apk.tvInfo
import kotlinx.android.synthetic.main.activity_timing.*
import kotlin.random.Random
/**
......@@ -125,6 +127,7 @@ class ApkActivity : BaseActivity() {
}
override fun loadingFail() {
AppOutSimpleGroMoreCarrierExpressManager.instance.loadADFrameLayout(fl_ad)
}
})
......
......@@ -140,6 +140,7 @@ class BoostFastActivity : Activity() {
}
override fun loadingFail() {
AppOutSimpleGroMoreCarrierExpressManager.instance.loadADFrameLayout(fl_ad)
}
})
......
......@@ -8,7 +8,6 @@ import android.widget.FrameLayout
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutScreenGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
import com.mints.flowbox.utils.TimeRender
......@@ -35,7 +34,7 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
// thread.start()
initExpress()
tvBoost.setOnClickListener(this)
tvClean.setOnClickListener(this)
tvSaveBattery.setOnClickListener(this)
......@@ -102,7 +101,7 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
}
override fun loadingFail() {
AppOutScreenGroMoreCarrierExpressManager.instance.loadADFrameLayout()
AppOutScreenGroMoreCarrierExpressManager.instance.loadADFrameLayout(fl_ad)
}
})
} catch (e: Exception) {
......
......@@ -241,6 +241,7 @@ class TriggerActivity : BaseActivity() {
}
override fun loadingFail() {
AppOutSimpleGroMoreCarrierExpressManager.instance.loadADFrameLayout(fl_ad)
}
})
......
......@@ -8,6 +8,7 @@ import android.util.AttributeSet;
import android.view.View;
import com.mints.flowbox.R;
import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils;
/**
* DrawHook
......@@ -25,38 +26,38 @@ public class DrawHookView extends View {
//线2的y轴
private int line2_y = 0;
private final Paint paint;
public DrawHookView(Context context) {
super(context);
this(context, null);
}
public DrawHookView(Context context, AttributeSet attrs) {
super(context, attrs);
this(context, attrs, 0);
}
public DrawHookView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
//绘制
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
progress++;
/**
* 绘制圆弧
*/
Paint paint = new Paint();
paint = new Paint();
//设置画笔颜色
paint.setColor(getResources().getColor(R.color.white));
//设置圆弧的宽度
paint.setStrokeWidth(8);
paint.setStrokeWidth(BubbleUtils.dp2px(3));
//设置圆弧为空心
paint.setStyle(Paint.Style.STROKE);
//消除锯齿
paint.setAntiAlias(true);
}
//绘制
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
progress++;
//获取圆心的x坐标
int center = getWidth() / 2;
int center1 = center - getWidth() / 4;
......@@ -67,7 +68,7 @@ public class DrawHookView extends View {
RectF rectF = new RectF(center - radius - 1, center - radius - 1, center + radius + 1, center + radius + 1);
//根据进度画圆弧
canvas.drawArc(rectF, -180, 360 * progress / 100, false, paint);
canvas.drawArc(rectF, 180, 360 * progress / 100, false, paint);
/*
* 绘制对勾
......@@ -96,6 +97,6 @@ public class DrawHookView extends View {
}
//每隔10毫秒界面刷新
postInvalidateDelayed(5);
postInvalidateDelayed(2);
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_check" android:state_checked="true" />
<item android:drawable="@mipmap/ic_uncheck" android:state_checked="false" />
</selector>
\ No newline at end of file
......@@ -34,7 +34,7 @@
<View
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_height="240dp"
android:background="@drawable/shape_bg_speed" />
<LinearLayout
......@@ -92,7 +92,7 @@
android:id="@+id/recy_clean"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_marginTop="50dp"
android:overScrollMode="never"
android:visibility="gone" />
......@@ -102,7 +102,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="15dp"
android:layout_marginTop="50dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
......
......@@ -120,12 +120,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:paddingStart="10dp"
android:layout_marginTop="15dp"
android:button="@drawable/selector_check"
android:paddingStart="4dp"
android:textColor="@color/color_707A8D"
android:textSize="12sp" />
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
......
......@@ -10,10 +10,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="40dp"
android:paddingTop="45dp"
android:paddingRight="25dp"
android:paddingBottom="10dp"
android:scaleType="center"
android:src="@mipmap/ic_activity_quit" />
<RelativeLayout
......@@ -72,11 +71,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:paddingStart="10dp"
android:button="@drawable/selector_check"
android:paddingStart="4dp"
android:textColor="@color/color_707A8D"
android:textSize="12sp" />
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......@@ -19,8 +19,8 @@
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back"
android:padding="15dp"
android:src="@mipmap/ic_close" />
android:padding="16dp"
android:src="@mipmap/ic_activity_quit" />
<TextView
android:id="@+id/tv_activity_title"
......
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