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
81bf7925
Commit
81bf7925
authored
Aug 04, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化弹出次数错乱问题
parent
86c4b55f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
85 deletions
+107
-85
WifiDataManager.kt
...in/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
+49
-72
ApkActivity.kt
...a/com/mints/flowbox/ui/activitys/keepalive/ApkActivity.kt
+33
-5
BoostFastActivity.kt
...mints/flowbox/ui/activitys/keepalive/BoostFastActivity.kt
+1
-0
ScreenActivity.kt
...om/mints/flowbox/ui/activitys/keepalive/ScreenActivity.kt
+3
-1
TriggerActivity.kt
...m/mints/flowbox/ui/activitys/keepalive/TriggerActivity.kt
+21
-7
No files found.
app/src/main/java/com/mints/flowbox/manager/wifi/WifiDataManager.kt
View file @
81bf7925
This diff is collapsed.
Click to expand it.
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/ApkActivity.kt
View file @
81bf7925
...
...
@@ -62,7 +62,7 @@ class ApkActivity : BaseActivity() {
private
fun
initView
()
{
GlideUtils
.
loadImageView
(
this
,
R
.
mipmap
.
ic_app_out_clean
,
ivImg
)
if
(
mApkState
==
0
||
mApkState
==
1
)
{
if
(
mApkState
==
0
)
{
// 应用安装
val
apkInfo2
=
AppUtil
.
getApkInfo2
(
this
,
mApkPkgName
)
tvTitle
.
text
=
"安装包残留提示"
...
...
@@ -78,11 +78,37 @@ class ApkActivity : BaseActivity() {
tvInfo2
.
visibility
=
View
.
VISIBLE
ivIcon
.
visibility
=
View
.
VISIBLE
WifiDataManager
.
increaseCount
(
WifiDataManager
.
INSTALL_APK
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
text
=
"
\n-
测试 -> 当前应用安装剩余次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前应用安装剩余次数:"
+
sp
.
getInt
(
WifiDataManager
.
INSTALL_APK
,
0
)
+
"当前应用安装总次数:"
+
WifiDataManager
.
INSTALL_APK_TIMES
)
+
"总次数:"
+
WifiDataManager
.
INSTALL_APK_TIMES
}
}
else
if
(
mApkState
==
1
)
{
// 应用安装
val
apkInfo2
=
AppUtil
.
getApkInfo2
(
this
,
mApkPkgName
)
tvTitle
.
text
=
"安装包残留提示"
tvInfo
.
text
=
SpanUtils
()
.
append
(
apkInfo2
.
applicationName
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_28BA75
))
.
append
(
" 安装完成,清理安装包可节省"
)
.
append
(
"大量"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_28BA75
))
.
append
(
"空间"
)
.
create
()
GlideUtils
.
loadImageView
(
this
,
apkInfo2
.
applicationIcon
,
ivIcon
)
tvInfo2
.
visibility
=
View
.
VISIBLE
ivIcon
.
visibility
=
View
.
VISIBLE
WifiDataManager
.
increaseCount
(
WifiDataManager
.
UPDATE_APK
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
text
=
"测试 -> 当前应用更新剩余次数:"
+
sp
.
getInt
(
WifiDataManager
.
UPDATE_APK
,
0
)
+
"总次数:"
+
WifiDataManager
.
UPDATE_APK_TIMES
}
}
else
if
(
mApkState
==
2
)
{
// 应用卸载
...
...
@@ -99,12 +125,14 @@ class ApkActivity : BaseActivity() {
tvInfo2
.
visibility
=
View
.
GONE
ivIcon
.
visibility
=
View
.
GONE
WifiDataManager
.
increaseCount
(
WifiDataManager
.
UNINSTALL_APK
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
\n-
测试 -> 当前应用卸载剩余次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前应用卸载剩余次数:"
+
sp
.
getInt
(
WifiDataManager
.
UNINSTALL_APK
,
0
)
+
"
当前应用卸载
总次数:"
+
WifiDataManager
.
UNINSTALL_APK_TIMES
)
+
"总次数:"
+
WifiDataManager
.
UNINSTALL_APK_TIMES
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/BoostFastActivity.kt
View file @
81bf7925
...
...
@@ -48,6 +48,7 @@ class BoostFastActivity : Activity() {
StatusBarUtil
.
transparencyBar
(
this
)
WifiDataManager
.
increaseCount
(
WifiDataManager
.
TIMING
)
// base extras
intent
.
extras
?.
let
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/ScreenActivity.kt
View file @
81bf7925
...
...
@@ -35,6 +35,8 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
)
},
500
)
WifiDataManager
.
increaseCount
(
WifiDataManager
.
LOCK_ON
)
// val thread = TimeThread(tvDate, tvTime)
// thread.start()
...
...
@@ -53,7 +55,7 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
private
fun
resetTime
()
{
val
date
=
Date
()
val
monthDay
=
TimeRender
.
formatDate
(
date
,
TimeRender
.
DEFAULT_FORMAT_MONTH_DAY
)
va
r
time
=
TimeRender
.
formatDate
(
date
,
TimeRender
.
DEFAULT_FORMAT_MINTER
)
va
l
time
=
TimeRender
.
formatDate
(
date
,
TimeRender
.
DEFAULT_FORMAT_MINTER
)
tvDate
.
text
=
TimeRender
.
getWeek
()
+
" "
+
monthDay
tvTime
.
text
=
time
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/TriggerActivity.kt
View file @
81bf7925
...
...
@@ -106,9 +106,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"立即提速"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
WIFI_ON
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
WIFI_ON
,
0
)
+
"总次数:"
+
WifiDataManager
.
WIFI_ON_TIMES
...
...
@@ -124,9 +126,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"WIFI测速"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
WIFI_ON
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
WIFI_ON
,
0
)
+
"总次数:"
+
WifiDataManager
.
WIFI_ON_TIMES
...
...
@@ -142,9 +146,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"WIFI安全检测"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
WIFI_ON
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 连接WIFI 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
WIFI_ON
,
0
)
+
"总次数:"
+
WifiDataManager
.
WIFI_ON_TIMES
...
...
@@ -157,9 +163,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"网络测速"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
WIFI_OFF
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 断开WIFI 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 断开WIFI 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
WIFI_OFF
,
0
)
+
"总次数:"
+
WifiDataManager
.
WIFI_OFF_TIMES
...
...
@@ -172,9 +180,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"网络优化"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
WIFI_OFF
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 断开WIFI 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 断开WIFI 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
WIFI_OFF
,
0
)
+
"总次数:"
+
WifiDataManager
.
WIFI_OFF_TIMES
...
...
@@ -207,9 +217,11 @@ class TriggerActivity : BaseActivity() {
.
create
()
btnClean
.
text
=
"一键省电"
WifiDataManager
.
increaseCount
(
WifiDataManager
.
BATTERY_OFF
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 拔电 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 拔电 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
BATTERY_OFF
,
0
)
+
"总次数:"
+
WifiDataManager
.
BATTERY_OFF_TIMES
...
...
@@ -225,9 +237,11 @@ class TriggerActivity : BaseActivity() {
phoneContainer
.
visibility
=
View
.
VISIBLE
btnClean
.
visibility
=
View
.
GONE
WifiDataManager
.
increaseCount
(
WifiDataManager
.
TELEPHONE_OFF
)
if
(
BuildConfig
.
DEBUG
)
{
tvInfo2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
text
=
"
-
测试 -> 当前 电话挂断 弹出次数:"
+
sp
.
getInt
(
tvInfo2
.
text
=
"测试 -> 当前 电话挂断 弹出次数:"
+
sp
.
getInt
(
WifiDataManager
.
TELEPHONE_OFF
,
0
)
+
"总次数:"
+
WifiDataManager
.
PHONE_OFF_TIMES
...
...
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