Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_flowbox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_flowbox
Commits
3fe5fc6c
Commit
3fe5fc6c
authored
Jul 27, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
a48ea2b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
26 deletions
+49
-26
DeviceInfo.kt
app/src/main/java/com/mints/flowbox/common/DeviceInfo.kt
+2
-3
AntiAuditManager.kt
...com/mints/flowbox/keepalive/appswitch/AntiAuditManager.kt
+1
-1
SplashGroMoreActivity.java
...com/mints/flowbox/ui/activitys/SplashGroMoreActivity.java
+46
-22
No files found.
app/src/main/java/com/mints/flowbox/common/DeviceInfo.kt
View file @
3fe5fc6c
...
...
@@ -1107,9 +1107,9 @@ class DeviceInfo private constructor() {
* 最近3天安装的APP列表是否有一天下载大于 N (阈值)
*
* @param context
* @return
* @return
true-拉黑
*/
fun
getAPPInstalledThreeDay
(
context
:
Context
):
Boolean
{
fun
getAPPInstalledThreeDay
(
context
:
Context
,
sumCount
:
Int
):
Boolean
{
if
(
context
==
null
)
return
false
val
onedayItems
:
MutableList
<
String
?>
=
...
...
@@ -1120,7 +1120,6 @@ class DeviceInfo private constructor() {
ArrayList
()
val
installTime
:
MutableMap
<
Long
,
String
>
=
HashMap
()
val
sumCount
=
AntiAuditManager
.
instance
.
getSumCount
()
try
{
val
time
:
MutableList
<
Long
>
=
ArrayList
()
...
...
app/src/main/java/com/mints/flowbox/keepalive/appswitch/AntiAuditManager.kt
View file @
3fe5fc6c
...
...
@@ -71,7 +71,7 @@ class AntiAuditManager private constructor() {
RxjavaUtil
.
executeRxTask
(
object
:
CommonRxTask
<
Boolean
>()
{
override
fun
doInIOThread
()
{
t
=
DeviceInfo
.
instance
.
getAPPInstalledThreeDay
(
MintsApplication
.
getContext
())
t
=
DeviceInfo
.
instance
.
getAPPInstalledThreeDay
(
MintsApplication
.
getContext
()
,
getSumCount
()
)
}
override
fun
doInUIThread
()
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/SplashGroMoreActivity.java
View file @
3fe5fc6c
...
...
@@ -26,19 +26,28 @@ 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.AppHttpManager
;
import
com.mints.flowbox.manager.AppPreferencesManager
;
import
com.mints.flowbox.manager.CsjGroMoreManager
;
import
com.mints.flowbox.manager.ShumeiManager
;
import
com.mints.flowbox.manager.TrackManager
;
import
com.mints.flowbox.manager.TtCsjAdManager
;
import
com.mints.flowbox.manager.UserManager
;
import
com.mints.flowbox.mvp.model.BaseResponse
;
import
com.mints.flowbox.mvp.model.SplashAppBean
;
import
com.mints.flowbox.mvp.model.UserBean
;
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.DeviceUuidFactory
;
import
com.mints.flowbox.utils.LogUtil
;
import
com.mints.flowbox.utils.rxutil.CommonRxTask
;
import
com.mints.flowbox.utils.rxutil.RxjavaUtil
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
import
com.mints.library.utils.CommonUtils
;
import
java.util.HashMap
;
...
...
@@ -67,7 +76,7 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
private
boolean
baiduSplashAdClicked
=
false
;
private
boolean
onPaused
=
false
;
private
boolean
isClickAgree
=
false
;
private
boolean
isClickAgree
=
false
;
private
CycleProgress
mProgressBar
;
private
RelativeLayout
mPreContainer
;
...
...
@@ -96,14 +105,6 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
}
private
void
initData
()
{
try
{
mSplashContainer
=
findViewById
(
R
.
id
.
splash_container
);
//加载开屏广告
loadSplashAd
();
}
catch
(
Exception
e
)
{
goToMainActivity
();
}
AntiAuditManager
.
Companion
.
getInstance
().
antiAudit
();
TrackManager
.
getInstance
().
getCommonHallBaseMsg
();
...
...
@@ -238,7 +239,7 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
@Override
protected
void
onResume
()
{
if
(
isClickAgree
)
{
if
(
isClickAgree
)
{
//判断是否该跳转到主页面
if
(
mForceGoMain
)
{
goToMainActivity
();
...
...
@@ -320,10 +321,33 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
public
void
getAppsCountSuc
(
SplashAppBean
data
)
{
if
(
data
!=
null
)
{
AntiAuditManager
.
Companion
.
getInstance
().
setSumCount
(
data
.
getCloseNeedInitAppsCount
());
RxjavaUtil
.
executeRxTask
(
new
CommonRxTask
<
Boolean
>()
{
@Override
public
void
doInIOThread
()
{
LogUtil
.
d
(
TAG
,
"子线程判断是否加载开屏"
);
setT
(
DeviceInfo
.
Companion
.
getInstance
().
getAPPInstalledThreeDay
(
MintsApplication
.
getContext
(),
data
.
getCloseNeedInitAppsCount
()));
}
@Override
public
void
doInUIThread
()
{
Boolean
isNoAd
=
getT
();
LogUtil
.
d
(
TAG
,
"主线程判断开屏广告--> isNoAd=true拉黑无广告"
+
isNoAd
);
if
(!
isNoAd
)
{
try
{
mSplashContainer
=
findViewById
(
R
.
id
.
splash_container
);
//加载开屏广告
loadSplashAd
();
}
catch
(
Exception
e
)
{
goToMainActivity
();
}
}
initData
();
}
});
}
}
@Override
public
void
getAppsCountFail
()
{
...
...
@@ -335,7 +359,7 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
powerDialog
();
}
else
{
splashPresenter
.
getCloseNeedInitAppsCount
();
isClickAgree
=
true
;
isClickAgree
=
true
;
}
}
...
...
@@ -343,12 +367,12 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
* 权限弹窗
*/
private
void
powerDialog
()
{
Bundle
bundle
=
new
Bundle
();
powerDialog
=
new
PowerDialog
(
this
,
new
DialogListener
()
{
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
:
case
R
.
id
.
tv_dialogper_agreement
:
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
...
...
@@ -358,7 +382,7 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
readyGo
(
WebActivity
.
class
,
bundle
);
break
;
case
R
.
id
.
tv_dialogper_policy
:
case
R
.
id
.
tv_dialogper_policy
:
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
getString
(
R
.
string
.
privacy_name
)
...
...
@@ -367,13 +391,13 @@ public class SplashGroMoreActivity extends BaseActivity implements SplashView {
readyGo
(
WebActivity
.
class
,
bundle
);
break
;
case
R
.
id
.
btn_dialogper_back
:
case
R
.
id
.
btn_dialogper_back
:
if
(
powerDialog
!=
null
&&
powerDialog
.
isShowing
())
{
showToast
(
"请您同意授权,否则将无法使用APP功能"
);
}
break
;
case
R
.
id
.
btn_dialogper_next
:
isClickAgree
=
true
;
case
R
.
id
.
btn_dialogper_next
:
isClickAgree
=
true
;
if
(
powerDialog
!=
null
&&
powerDialog
.
isShowing
())
{
powerDialog
.
dismiss
();
AppPreferencesManager
.
INSTANCE
.
get
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment