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
7a7f546e
Commit
7a7f546e
authored
Jul 21, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
4c7c4645
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
56 additions
and
70 deletions
+56
-70
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-4
MintsApplication.java
app/src/main/java/com/mints/flowbox/MintsApplication.java
+2
-9
WifiAdManager.kt
app/src/main/java/com/mints/flowbox/ad/wifi/WifiAdManager.kt
+13
-3
ScreenObserver.kt
...java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
+0
-1
CleanActivity.kt
...main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
+14
-21
Increasespeed2Activity.kt
.../com/mints/flowbox/ui/activitys/Increasespeed2Activity.kt
+2
-6
IncreasespeedActivity.kt
...a/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
+3
-3
SpeedFastActivity.kt
.../java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
+1
-1
SpeedTestActivity.kt
.../java/com/mints/flowbox/ui/activitys/SpeedTestActivity.kt
+1
-1
OutAppActivity.kt
...ava/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
+7
-7
ApkActivity.kt
...a/com/mints/flowbox/ui/activitys/keepalive/ApkActivity.kt
+1
-1
BoostFastActivity.kt
...mints/flowbox/ui/activitys/keepalive/BoostFastActivity.kt
+0
-5
activity_increasespeed2.xml
app/src/main/res/layout/activity_increasespeed2.xml
+4
-7
activity_timing.xml
app/src/main/res/layout/activity_timing.xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
7a7f546e
...
...
@@ -167,27 +167,30 @@
<activity
android:name=
".ui.activitys.keepalive.ScreenActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale|density|fontScale|layoutDirection|navigation|uiMode|screenLayout|mcc|mnc"
android:excludeFromRecents=
"true"
android:immersive=
"true"
android:launchMode=
"singleTask"
android:showOnLockScreen=
"true"
android:taskAffinity=
"org.etron.dd1"
android:theme=
"@style/AppTheme.LockScreen"
/>
<activity
android:name=
".ui.activitys.keepalive.ApkActivity"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Instance
"
android:launchMode=
"single
Task
"
android:theme=
"@style/CustomerTransparentTheme"
/>
<activity
android:name=
".ui.activitys.keepalive.TriggerActivity"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Instance
"
android:launchMode=
"single
Task
"
android:theme=
"@style/CustomerTransparentTheme"
/>
<activity
android:name=
".ui.activitys.keepalive.TransparentActivity"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Instance
"
android:launchMode=
"single
Task
"
android:theme=
"@style/CustomerTransparentTheme"
/>
<!-- <activity-->
...
...
@@ -199,7 +202,7 @@
<activity
android:name=
".ui.activitys.keepalive.BoostFastActivity"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Instance
"
android:launchMode=
"single
Task
"
android:theme=
"@style/CustomerTransparentTheme"
/>
<service
...
...
app/src/main/java/com/mints/flowbox/MintsApplication.java
View file @
7a7f546e
...
...
@@ -35,6 +35,7 @@ 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.mints.flowbox.utils.keepalive.IntentUtils
;
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
;
...
...
@@ -178,20 +179,12 @@ public class MintsApplication extends BaseApp {
// TODO 这里可以初始化广告SDK
thirdConfig
();
// AdHelper.getInstance().init(this);
// 这个用来在release版本出toast,方便测试
// if (TextUtils.isEmpty(channel) || "BUG".equalsIgnoreCase(channel)) {
// // release 模式下,无渠道号就弹这个TOAST,这样方便监测进程启动,可以去掉
// Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
// }
new
ScreenLockerObserver
(
this
).
start
(
this
);
CoreAdContext
.
Companion
.
setLockerResumeCallback
(
new
Function1
<
Activity
,
Boolean
>()
{
@Override
public
Boolean
invoke
(
Activity
activity
)
{
LogUtil
.
d
(
activity
.
getComponentName
());
// TODO 这里利用activity实例,载入所有的体外广告,比如全屏视频、开屏等等
return
true
;
}
...
...
app/src/main/java/com/mints/flowbox/ad/wifi/WifiAdManager.kt
View file @
7a7f546e
...
...
@@ -18,7 +18,6 @@ class WifiAdManager private constructor() {
private
val
TAG
=
WifiAdManager
::
class
.
java
.
simpleName
companion
object
{
val
instance
:
WifiAdManager
by
lazy
(
mode
=
LazyThreadSafetyMode
.
SYNCHRONIZED
)
{
WifiAdManager
()
...
...
@@ -121,10 +120,21 @@ class WifiAdManager private constructor() {
fun
showInterstitial
(
_activity
:
Activity
)
{
when
(
currentAdType
)
{
Constant
.
GROMORE_INSERTSCREEN_AD
->
{
interstitialGroManager
?.
showInteractionAd
(
_activity
,
wifiAdStatusListener
)
if
(
interstitialGroManager
!=
null
)
{
interstitialGroManager
?.
showInteractionAd
(
_activity
,
wifiAdStatusListener
)
}
else
{
this
.
wifiAdStatusListener
?.
adFail
()
}
}
Constant
.
GROMORE_FULL_AD
->
{
fullGroManager
?.
showFullAd
(
_activity
,
wifiAdStatusListener
)
if
(
fullGroManager
!=
null
)
{
fullGroManager
?.
showFullAd
(
_activity
,
wifiAdStatusListener
)
}
else
{
this
.
wifiAdStatusListener
?.
adFail
()
}
}
else
->
{
this
.
wifiAdStatusListener
?.
adFail
()
}
}
}
...
...
app/src/main/java/com/mints/flowbox/keepalive/screen/ScreenObserver.kt
View file @
7a7f546e
...
...
@@ -77,7 +77,6 @@ class ScreenLockerObserver(private val context: Context) {
)
)
// context.startActivity(Intent(context.unwrap(), LockerActivity::class.java))
}
override
fun
onResult
(
succeed
:
Boolean
)
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
View file @
7a7f546e
...
...
@@ -26,7 +26,6 @@ import com.mints.flowbox.ui.adapter.clean.CleanExpandAdapter
import
com.mints.flowbox.ui.adapter.clean.ExpandInfo
import
com.mints.flowbox.ui.adapter.clean.ExpandInfo.ChildInfo
import
com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import
com.mints.flowbox.utils.FileUtils
import
com.mints.flowbox.utils.SpanUtils
import
kotlinx.android.synthetic.main.activity_clean.*
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -94,7 +93,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
override
fun
initViewsAndEvents
()
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{}
...
...
@@ -106,6 +104,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
toResult
()
}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
initView
()
initCleanData
()
...
...
@@ -248,7 +247,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
isCleanCompleted
=
true
mCleanTimer
?.
cancel
()
if
(
scanMax
==
4
)
{
if
(
scanMax
==
3
)
{
toResult
()
}
...
...
@@ -260,7 +259,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
1
->
btnClean
.
text
=
"正在清理 系统缓存..."
2
->
btnClean
.
text
=
"正在清理 临时文件..."
3
->
btnClean
.
text
=
"正在清理 广告垃圾..."
4
->
btnClean
.
text
=
"正在清理 安装包..."
//
4 -> btnClean.text = "正在清理 安装包..."
}
mCleanExpandAdapter
?.
let
{
...
...
@@ -271,11 +270,9 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
if
(
taskType
==
0
)
{
cleaningOperation
(
mContext
,
mCleanList
[
taskType
].
childList
)
if
(
scanMax
==
1
)
{
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
WifiAdManager
.
instance
.
showInterstitial
(
this
@CleanActivity
)
},
2000
)
}
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
WifiAdManager
.
instance
.
showInterstitial
(
this
@CleanActivity
)
},
2000
)
}
// if (taskType == 1) {
...
...
@@ -285,14 +282,14 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
// }
// }
if
(
taskType
==
4
)
{
for
(
childInfo
in
mCleanList
[
taskType
].
childList
)
{
if
(
childInfo
.
filePath
!=
null
)
{
FileUtils
.
deleteFile
(
childInfo
.
filePath
)
FileUtils
.
updateFile
(
childInfo
.
filePath
,
this
@CleanActivity
)
}
}
}
//
if (taskType == 4) {
//
for (childInfo in mCleanList[taskType].childList) {
//
if (childInfo.filePath != null) {
//
FileUtils.deleteFile(childInfo.filePath)
//
FileUtils.updateFile(childInfo.filePath, this@CleanActivity)
//
}
//
}
//
}
// 清理动画
for
(
i
in
0
until
mCleanList
[
taskType
].
childList
.
size
)
{
...
...
@@ -309,10 +306,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
taskType
++
// if (taskType == scanMax) {
// 防止下标越界
// taskType--
// }
}
}
},
200
,
STEP_Interval
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/Increasespeed2Activity.kt
View file @
7a7f546e
...
...
@@ -62,7 +62,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
private
var
mIncreaseAdapter
:
IncreaseAdapter
?
=
null
private
var
mIncreaseType
=
INCREASE2_WIFI_BOOST
private
var
mTimer
:
Timer
?
=
null
...
...
@@ -72,7 +71,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_increasespeed2
override
fun
initViewsAndEvents
()
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{}
...
...
@@ -84,6 +82,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
showUiStatus
()
}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
initView
()
...
...
@@ -99,7 +98,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
}
else
{
containerAnim
.
setBackgroundColor
(
Color
.
parseColor
(
"#8278DC"
))
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
safe_check
,
iv_gif
)
mTimerMax
=
9
NumAnimUtil
.
startAnim
(
tv_progress
,
100f
,
((
mTimerMax
-
6
)
*
STEP_Interval
))
}
...
...
@@ -111,7 +109,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
step
++
if
(
step
==
mTimerMax
-
2
)
{
WifiAdManager
.
instance
.
showInterstitial
(
this
@Increasespeed2Activity
)
mTimer
?.
cancel
()
}
}
}
...
...
@@ -121,6 +118,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
private
fun
showUiStatus
()
{
containerAnim
.
visibility
=
View
.
GONE
container
.
visibility
=
View
.
VISIBLE
headerContainer
.
visibility
=
View
.
VISIBLE
if
(
mIncreaseType
==
INCREASE2_SAFE_CHECK
)
{
ivGif2
.
visibility
=
View
.
VISIBLE
tvInfo2
.
visibility
=
View
.
VISIBLE
...
...
@@ -203,8 +201,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
mTimer
?.
cancel
()
mTimer
=
null
WifiAdManager
.
instance
.
onDestroy
()
fl_ad
?.
removeAllViews
()
super
.
onDestroy
()
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
View file @
7a7f546e
...
...
@@ -77,7 +77,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
containerAnim
.
visibility
=
View
.
VISIBLE
startTimer
()
}
else
if
(
mIncreaseType
==
INCREASE_SAVE_ELECTRICITY
&&
AppConfig
.
isCanSaveBattery
)
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{}
...
...
@@ -89,6 +88,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
showUiStatus
()
}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
container
.
visibility
=
View
.
GONE
containerAnim
.
visibility
=
View
.
VISIBLE
...
...
@@ -137,13 +137,13 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
mTimer
?.
cancel
()
// 一键清理
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
5
)
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
4
)
readyGoThenKill
(
CleanActivity
::
class
.
java
,
bundle
)
return
@runOnUiThread
}
INCREASE_BOOST
->
{
mTimer
?.
cancel
()
// 一键
清理
// 一键
加速
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
1
)
readyGoThenKill
(
CleanActivity
::
class
.
java
,
bundle
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
View file @
7a7f546e
...
...
@@ -38,7 +38,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
initView
()
// 动画结束后 展示插屏广告
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{
}
...
...
@@ -48,6 +47,7 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
override
fun
adClose
()
{}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
}
fun
startTimer
()
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/SpeedTestActivity.kt
View file @
7a7f546e
...
...
@@ -49,7 +49,6 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
initViewsAndEvents
()
{
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
WifiAdManager
.
instance
.
setWifiAdStatusListener
(
object
:
WifiAdStatusListener
{
override
fun
adSuccess
()
{
}
...
...
@@ -62,6 +61,7 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
endTest
()
}
})
WifiAdManager
.
instance
.
loadWifiAd
(
this
)
initView
()
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
View file @
7a7f546e
...
...
@@ -55,13 +55,13 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity(), ScreenMonitor.Lis
if
(!
useNewWay
)
{
window
.
setWindowAnimations
(
R
.
style
.
AppTheme_LockScreen_Animation
)
val
layoutParams
=
window
.
attributes
val
isUsingShowWhenLockedFlag
=
!
ScreenLockerUtils
.
isLockScreenProtected
(
this
)
&&
!
ScreenLockerObserver
.
shouldShowLockerAfterUserPresent
()
ScreenLockerUtils
.
makeLockWindowFullScreen
(
this
,
layoutParams
,
isUsingShowWhenLockedFlag
)
//
val isUsingShowWhenLockedFlag =
//
!ScreenLockerUtils.isLockScreenProtected(this) && !ScreenLockerObserver.shouldShowLockerAfterUserPresent()
//
ScreenLockerUtils.makeLockWindowFullScreen(
//
this,
//
layoutParams,
//
isUsingShowWhenLockedFlag
//
)
window
.
attributes
=
layoutParams
window
.
statusBarColor
=
Color
.
TRANSPARENT
window
.
navigationBarColor
=
Color
.
TRANSPARENT
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/ApkActivity.kt
View file @
7a7f546e
...
...
@@ -87,7 +87,7 @@ class ApkActivity : BaseActivity() {
btnClean
.
setOnClickListener
{
// 一键清理
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
5
)
bundle
.
putInt
(
Constant
.
SCAN_TYPE
,
4
)
readyGoThenKill
(
CleanActivity
::
class
.
java
,
bundle
)
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/BoostFastActivity.kt
View file @
7a7f546e
...
...
@@ -138,11 +138,6 @@ class BoostFastActivity : BaseActivity() {
}
}
override
fun
onDestroy
()
{
WifiAdManager
.
instance
.
onDestroy
()
super
.
onDestroy
()
}
override
fun
onResume
()
{
super
.
onResume
()
initExpress
()
...
...
app/src/main/res/layout/activity_increasespeed2.xml
View file @
7a7f546e
...
...
@@ -14,6 +14,10 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/header_layout"
android:visibility=
"gone"
/>
<RelativeLayout
android:id=
"@+id/containerAnim"
android:layout_width=
"match_parent"
...
...
@@ -47,8 +51,6 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/header_layout"
/>
<RelativeLayout
android:id=
"@+id/header"
android:layout_width=
"wrap_content"
...
...
@@ -56,11 +58,6 @@
android:layout_gravity=
"center_horizontal"
android:visibility=
"gone"
>
<!-- <com.mints.flowbox.ui.widgets.DrawHookView-->
<!-- android:id="@+id/dhv"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp" />-->
<ImageView
android:id=
"@+id/ivGif"
android:layout_width=
"200dp"
...
...
app/src/main/res/layout/activity_timing.xml
View file @
7a7f546e
...
...
@@ -11,7 +11,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"
10
0dp"
android:layout_marginTop=
"
8
0dp"
android:layout_marginEnd=
"15dp"
android:background=
"@drawable/shape_bg_write"
android:orientation=
"vertical"
>
...
...
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