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
dd604309
Commit
dd604309
authored
Jul 10, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
696f22c4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
12 deletions
+47
-12
WifiDataManager.kt
...in/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
+37
-10
MainActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
+1
-1
TimeRender.java
app/src/main/java/com/mints/flowbox/utils/TimeRender.java
+9
-1
No files found.
app/src/main/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
View file @
dd604309
...
...
@@ -11,7 +11,7 @@ import com.mints.flowbox.utils.TimeRender
*/
object
WifiDataManager
{
// 新的一天
// 新的一天
(无需重置状态,自动修改)
private
val
NEW_DAY_FLAG
=
"NEW_DAY_FLAG"
// wifi连接 10次
...
...
@@ -26,14 +26,8 @@ object WifiDataManager {
// 拔电 10次
private
val
BATTERY_OFF
=
"BATTERY_OFF"
// 安装 引导
private
val
INSTALL_ON
=
"INSTALL_ON"
// 卸载 引导
private
val
UNINSTALL_OFF
=
"UNINSTALL_OFF"
// // 定时 15分钟 在定时器触发
// private val TIMER_15MIN = "TIMER_15MIN"
// 安装,卸载 引导 10秒
private
val
INSTALLANDUN_SEC
=
"INSTALLANDUN_SEC"
// 点击home键 30分钟
private
val
HOME_30MIN
=
"HOME_30MIN"
...
...
@@ -42,7 +36,7 @@ object WifiDataManager {
private
val
APPLIST_30MIN
=
"APPLIST_30MIN"
// 挂断电话 无广告
//
private val TELEPHONE_OFF = "TELEPHONE_OFF"
private
val
TELEPHONE_OFF
=
"TELEPHONE_OFF"
// 锁屏 100次
private
val
LOCK_ON
=
"LOCK_ON"
...
...
@@ -56,6 +50,9 @@ object WifiDataManager {
// 点击home键、最近任务列表 单位:分钟
var
HOME_TIMES
=
30
// 安装、卸载 单位:秒
var
INSTALL_TIMES
=
10
val
sp
by
lazy
{
AppPreferencesManager
.
get
()
}
/**
...
...
@@ -122,6 +119,18 @@ object WifiDataManager {
return
false
}
/**
* 是否挂断电脑
*/
fun
getTelephoneOff
():
Boolean
{
val
telephoneOff
=
sp
.
getInt
(
TELEPHONE_OFF
,
0
)
if
(
telephoneOff
<
LOCK_TIMES
)
{
sp
.
put
(
TELEPHONE_OFF
,
telephoneOff
+
1
)
return
true
}
return
false
}
/**
* 是否点击home键 满足30分钟后
...
...
@@ -155,6 +164,22 @@ object WifiDataManager {
return
true
}
/**
* 是否操作卸载安装 满足10秒后
*/
fun
getInstallAndUnstall
():
Boolean
{
// 保存的时间戳
val
preTime
=
sp
.
getLong
(
INSTALLANDUN_SEC
,
System
.
currentTimeMillis
())
val
currentTime
=
System
.
currentTimeMillis
()
// 当前时间-保存的时间戳=间隔时间
val
sec
=
TimeRender
.
getSecForTimestamp
(
preTime
,
currentTime
)
if
(
sec
<
INSTALL_TIMES
)
{
return
false
}
sp
.
put
(
INSTALLANDUN_SEC
,
currentTime
)
return
true
}
/**
* 是否当天
*/
...
...
@@ -183,7 +208,9 @@ object WifiDataManager {
sp
.
put
(
BATTERY_ON
,
0
)
sp
.
put
(
BATTERY_OFF
,
0
)
sp
.
put
(
LOCK_ON
,
0
)
sp
.
put
(
TELEPHONE_OFF
,
0
)
sp
.
put
(
HOME_30MIN
,
System
.
currentTimeMillis
())
sp
.
put
(
INSTALLANDUN_SEC
,
System
.
currentTimeMillis
())
sp
.
put
(
APPLIST_30MIN
,
System
.
currentTimeMillis
())
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
dd604309
...
...
@@ -455,7 +455,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
AppConfig
.
app_black_name
=
data
.
userRiskApps
.
userRiskAppName
AppConfig
.
app_black_pkg
=
data
.
userRiskApps
.
userRiskAppPkg
//
CsjGroMoreManager.updataIdByChannel(data.gromoreAdcodes)
CsjGroMoreManager
.
updataIdByChannel
(
data
.
gromoreAdcodes
)
// 更新权重
UserWeight
.
initAdWeight
(
data
)
...
...
app/src/main/java/com/mints/flowbox/utils/TimeRender.java
View file @
dd604309
...
...
@@ -279,7 +279,6 @@ public class TimeRender {
}
/**
* <<<<<<< Updated upstream
* 根据时间戳 计算分钟间隔
*
* @return
...
...
@@ -288,6 +287,15 @@ public class TimeRender {
return
(
curTime
-
lastTime
)
/
(
1000
*
60
);
}
/**
* 根据时间戳 计算秒间隔
*
* @return
*/
public
static
long
getSecForTimestamp
(
long
lastTime
,
long
curTime
)
{
return
(
curTime
-
lastTime
)
/
1000
;
}
/**
* 获取今天星期几
*
...
...
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