Commit 7e4866d2 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 515090bf
......@@ -242,4 +242,7 @@ object Constant {
// 大转盘是否自动转动 true-自动
const val TURNTABLE_SWITCH_BUTTON = "TURNTABLE_SWITCH_BUTTON"
// 是否第一次授权 true-是
const val IS_ONE_PERMISSIONS = "IS_ONE_PERMISSIONS"
}
......@@ -731,7 +731,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
val cashStr = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
if (AppConfig.awardCoin > 0) {
tvAwardContent.text = "${AppConfig.awardCoin}金币已到账"
tvAwardContent.text = "${AppConfig.awardCoin}金币已到账~"
tvAwardNext.visibility = View.GONE
}
......
......@@ -44,12 +44,12 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
}
private val mStringArr1 = mutableListOf(
"检测结果WiFi加密安全性",
"检ARP网络攻击异常",
"加强WiFi加密安全性",
"检测无ARP网络攻击异常",
"提升DNS劫持安全性",
"部署网页防篡改",
"增强部署网页防篡改",
"加固链路,避免SSL中间人攻击",
"检测是否钓鱼WiFi"
"检测钓鱼WiFi"
)
private val mStringArr2 = mutableListOf(
......
......@@ -393,15 +393,27 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private var userMsgBean: UserTaskMsgBean? = null
private fun showPowerDialog() {
if (AppPreferencesManager.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
powerDialog()
} else {
// 数美初始化
baseApplication.initMiitHelper()
ShumeiManager.getInstance().initShumei()
uploadDevice()
// if (AppPreferencesManager.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
// powerDialog()
// } else {
// // 数美初始化
// baseApplication.initMiitHelper()
// ShumeiManager.getInstance().initShumei()
// uploadDevice()
// }
// 第一次授权
if (AppPreferencesManager.get().getBoolean(Constant.IS_ONE_PERMISSIONS, true)) {
AppPreferencesManager.get().put(Constant.IS_ONE_PERMISSIONS, false)
checkPermission()
}
// 数美初始化
baseApplication.initMiitHelper()
ShumeiManager.getInstance().initShumei()
uploadDevice()
//闪电盒子传入oaid
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
WnManager.setOaid(MintsApplication.OAID)
......@@ -500,10 +512,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
* refreshType fragment传入的下标
*/
fun userLogin(refreshType: Int) {
if (!AppPreferencesManager.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
// if (!AppPreferencesManager.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
mRefreshType = refreshType
mainPresenter.userLogin()
}
// }
}
/**
......
package com.mints.flowbox.ui.activitys;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
......@@ -24,6 +26,7 @@ import com.mints.flowbox.ad.express.ExpressManager;
import com.mints.flowbox.common.Constant;
import com.mints.flowbox.common.DeviceInfo;
import com.mints.flowbox.keepalive.appswitch.AntiAuditManager;
import com.mints.flowbox.manager.AppPreferencesManager;
import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.TtCsjAdManager;
......@@ -33,6 +36,8 @@ import com.mints.flowbox.mvp.presenters.SplashPresenter;
import com.mints.flowbox.mvp.views.SplashView;
import com.mints.flowbox.ui.activitys.base.BaseActivity;
import com.mints.flowbox.ui.widgets.CycleProgress;
import com.mints.flowbox.ui.widgets.dialog.DialogListener;
import com.mints.flowbox.ui.widgets.dialog.PowerDialog;
import com.mints.flowbox.utils.LogUtil;
import com.mints.library.utils.CommonUtils;
......@@ -48,6 +53,8 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
private SplashPresenter splashPresenter;
PowerDialog powerDialog;
private static final String TAG = "SplashGroMoreActivity";
private TTSplashAd mTTSplashAd;
private FrameLayout mSplashContainer;
......@@ -63,6 +70,8 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
private boolean baiduSplashAdClicked = false;
private boolean onPaused = false;
private boolean isClickAgree=false;
private CycleProgress mProgressBar;
private RelativeLayout mPreContainer;
......@@ -232,14 +241,17 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
@Override
protected void onResume() {
//判断是否该跳转到主页面
if (mForceGoMain) {
goToMainActivity();
}
if (isBaiduSplashAd && onPaused && baiduSplashAdClicked) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity();
if(isClickAgree){
//判断是否该跳转到主页面
if (mForceGoMain) {
goToMainActivity();
}
if (isBaiduSplashAd && onPaused && baiduSplashAdClicked) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity();
}
}
super.onResume();
}
......@@ -275,7 +287,8 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
if (!deviceInfo.getSignInfo()) {
getBaseApplication().exitApp();
} else {
splashPresenter.getCloseNeedInitAppsCount();
// splashPresenter.getCloseNeedInitAppsCount();
showPowerDialog();
}
}
......@@ -319,4 +332,61 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
public void getAppsCountFail() {
initData();
}
private void showPowerDialog() {
if (AppPreferencesManager.INSTANCE.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
powerDialog();
} else {
splashPresenter.getCloseNeedInitAppsCount();
isClickAgree=true;
}
}
/**
* 权限弹窗
*/
private void powerDialog() {
Bundle bundle =new Bundle();
powerDialog =new PowerDialog(this, new DialogListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_dialogper_agreement :
bundle.putString(
WebActivity.WEB_TITLE,
getString(R.string.register_name)
);
bundle.putString(WebActivity.WEB_URL, Constant.INSTANCE.getREGISTER_URL());
readyGo(WebActivity.class, bundle);
break;
case R.id.tv_dialogper_policy :
bundle.putString(
WebActivity.WEB_TITLE,
getString(R.string.privacy_name)
);
bundle.putString(WebActivity.WEB_URL, Constant.INSTANCE.getPRIVACY_URL());
readyGo(WebActivity.class, bundle);
break;
case R.id.btn_dialogper_back :
if (powerDialog != null && powerDialog.isShowing()) {
showToast("请您同意授权,否则将无法使用APP功能");
}
break;
case R.id.btn_dialogper_next :
isClickAgree=true;
if (powerDialog != null && powerDialog.isShowing()) {
powerDialog.dismiss();
AppPreferencesManager.INSTANCE.get()
.put(Constant.LOAN_PERMISSION_FLAG, false);
}
splashPresenter.getCloseNeedInitAppsCount();
break;
}
}
});
powerDialog.show();
}
}
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