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
ac2f1ffe
Commit
ac2f1ffe
authored
Jul 21, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://39.97.65.143:81/android/android_flowbox
parents
ba1bed4e
72c45791
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
251 additions
and
134 deletions
+251
-134
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+8
-1
MintsApplication.java
app/src/main/java/com/mints/flowbox/MintsApplication.java
+6
-0
AlarmManager.java
...c/main/java/com/mints/flowbox/keepalive/AlarmManager.java
+1
-0
OutAppRouter.kt
...src/main/java/com/mints/flowbox/keepalive/OutAppRouter.kt
+16
-21
BonusPresenter.kt
...n/java/com/mints/flowbox/mvp/presenters/BonusPresenter.kt
+7
-3
CleanActivity.kt
...main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
+6
-5
IncreasespeedActivity.kt
...a/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
+1
-5
MainActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
+41
-23
SpeedFastActivity.kt
.../java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
+21
-21
OutAppActivity.kt
...ava/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
+3
-2
TransPlaceActivity.kt
...ints/flowbox/ui/activitys/keepalive/TransPlaceActivity.kt
+33
-0
BonusFragment.kt
.../main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
+23
-13
MyFragment.kt
...src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
+13
-12
TurnTableFragment.kt
...n/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
+1
-1
BaseFragment.java
...java/com/mints/flowbox/ui/fragment/base/BaseFragment.java
+1
-1
DrawHookView.java
.../main/java/com/mints/flowbox/ui/widgets/DrawHookView.java
+1
-1
ForegroundOrBackground.java
.../java/com/mints/flowbox/utils/ForegroundOrBackground.java
+29
-4
IntentUtils.java
...n/java/com/mints/flowbox/utils/keepalive/IntentUtils.java
+23
-9
GlideUtils.java
app/src/main/java/com/mints/library/utils/GlideUtils.java
+2
-1
battery.gif
app/src/main/res/drawable-xhdpi/battery.gif
+0
-0
ic_launcher_app_out.png
app/src/main/res/drawable-xhdpi/ic_launcher_app_out.png
+0
-0
activity_apk.xml
app/src/main/res/layout/activity_apk.xml
+1
-0
activity_increasespeed.xml
app/src/main/res/layout/activity_increasespeed.xml
+1
-1
activity_screen.xml
app/src/main/res/layout/activity_screen.xml
+8
-5
activity_timing.xml
app/src/main/res/layout/activity_timing.xml
+2
-1
fragment_bonus.xml
app/src/main/res/layout/fragment_bonus.xml
+1
-2
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+1
-1
view_wifi.xml
app/src/main/res/layout/view_wifi.xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
ac2f1ffe
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
/>
<uses-permission
android:name=
"android.permission.CHANGE_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.CHANGE_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.USE_FULL_SCREEN_INTENT"
/>
<uses-permission
android:name=
"android.permission.USE_FULL_SCREEN_INTENT"
/>
<uses-permission
android:name=
"android.permission.REORDER_TASKS"
/>
<uses-permission
android:name=
"android.permission.READ_CALL_LOG"
/>
<uses-permission
android:name=
"android.permission.READ_CALL_LOG"
/>
<uses-permission
android:name=
"android.permission.CALL_PHONE"
/>
<uses-permission
android:name=
"android.permission.CALL_PHONE"
/>
...
@@ -193,9 +194,15 @@
...
@@ -193,9 +194,15 @@
<activity
<activity
android:name=
".ui.activitys.keepalive.TransparentActivity"
android:name=
".ui.activitys.keepalive.TransparentActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Task
"
android:launchMode=
"single
Instance
"
android:theme=
"@style/CustomerTransparentTheme"
/>
android:theme=
"@style/CustomerTransparentTheme"
/>
<!-- <activity-->
<!-- android:name=".ui.activitys.keepalive.TransPlaceActivity"-->
<!-- android:excludeFromRecents="true"-->
<!-- android:launchMode="singleTask"-->
<!-- android:theme="@style/CustomerTransparentTheme" />-->
<activity
<activity
android:name=
".ui.activitys.keepalive.BoostFastActivity"
android:name=
".ui.activitys.keepalive.BoostFastActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
...
...
app/src/main/java/com/mints/flowbox/MintsApplication.java
View file @
ac2f1ffe
...
@@ -36,6 +36,7 @@ import com.mints.flowbox.net.LoanService;
...
@@ -36,6 +36,7 @@ import com.mints.flowbox.net.LoanService;
import
com.mints.flowbox.ui.activitys.keepalive.TriggerActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.TriggerActivity
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.SystemUtils
;
import
com.mints.flowbox.utils.SystemUtils
;
import
com.mints.flowbox.utils.keepalive.IntentUtils
;
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
;
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
;
import
com.module.legacy.oreo.RegisterJobUtils
;
import
com.module.legacy.oreo.RegisterJobUtils
;
import
com.orhanobut.logger.AndroidLogAdapter
;
import
com.orhanobut.logger.AndroidLogAdapter
;
...
@@ -186,6 +187,8 @@ public class MintsApplication extends BaseApp {
...
@@ -186,6 +187,8 @@ public class MintsApplication extends BaseApp {
// Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
// Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
// }
// }
// OutAppRouter.INSTANCE.startTransPlace(this);
WifiStateWatch
.
getInstance
(
this
).
begin
(
new
WifiStateWatch
.
WifiStateListener
()
{
WifiStateWatch
.
getInstance
(
this
).
begin
(
new
WifiStateWatch
.
WifiStateListener
()
{
@Override
@Override
public
void
onWifiOpen
()
{
public
void
onWifiOpen
()
{
...
@@ -269,6 +272,9 @@ public class MintsApplication extends BaseApp {
...
@@ -269,6 +272,9 @@ public class MintsApplication extends BaseApp {
BatteryWatch
.
getInstance
(
this
).
begin
(
new
BatteryWatch
.
BatteryStateListener
()
{
BatteryWatch
.
getInstance
(
this
).
begin
(
new
BatteryWatch
.
BatteryStateListener
()
{
@Override
@Override
public
void
onCharging
()
{
public
void
onCharging
()
{
if
(
IntentUtils
.
isRunningForeground
(
MintsApplication
.
getContext
()))
{
return
;
}
if
(
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
mContext
))
{
if
(
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
mContext
))
{
return
;
return
;
}
}
...
...
app/src/main/java/com/mints/flowbox/keepalive/AlarmManager.java
View file @
ac2f1ffe
...
@@ -142,6 +142,7 @@ public class AlarmManager implements WeakHandler.IHandler {
...
@@ -142,6 +142,7 @@ public class AlarmManager implements WeakHandler.IHandler {
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
TransparentActivity
.
class
);
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
TransparentActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
);
intent
.
putExtra
(
TransparentActivity
.
TIMING_TYPE
,
currentType
++);
intent
.
putExtra
(
TransparentActivity
.
TIMING_TYPE
,
currentType
++);
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
IntentUtils
.
startActivity
(
intent
);
IntentUtils
.
startActivity
(
intent
);
}
else
{
}
else
{
...
...
app/src/main/java/com/mints/flowbox/keepalive/OutAppRouter.kt
View file @
ac2f1ffe
package
com.mints.flowbox.keepalive
package
com.mints.flowbox.keepalive
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.net.Uri
import
android.net.Uri
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ui.activitys.keepalive.ApkActivity
import
com.mints.flowbox.ui.activitys.keepalive.ApkActivity
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
import
com.mints.flowbox.ui.activitys.keepalive.TransPlaceActivity
import
com.mints.flowbox.ui.activitys.keepalive.TriggerActivity
import
com.mints.flowbox.ui.activitys.keepalive.TriggerActivity
import
com.mints.flowbox.utils.ForegroundOrBackground
import
com.mints.flowbox.utils.ForegroundOrBackground
import
com.mints.flowbox.utils.LogUtil
import
com.mints.flowbox.utils.keepalive.IntentUtils
import
com.mints.flowbox.utils.keepalive.IntentUtils
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils.canShowScreenLocker
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils.canShowScreenLocker
import
net.phone.PhoneBrandUtils
import
net.phone.PhoneBrandUtils
...
@@ -64,13 +67,6 @@ object OutAppRouter {
...
@@ -64,13 +67,6 @@ object OutAppRouter {
}
}
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
or
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
or
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
// IntentUtils.startScreenActivity(intent)
if
(
PhoneBrandUtils
.
isHuaweiHonor
())
{
IntentUtils
.
startActivity
(
intent
)
return
}
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
IntentUtils
.
startActivity
(
intent
)
IntentUtils
.
startActivity
(
intent
)
}
else
{
}
else
{
...
@@ -78,6 +74,16 @@ object OutAppRouter {
...
@@ -78,6 +74,16 @@ object OutAppRouter {
}
}
}
}
/**
* 跳转拨号
*/
fun
startTransPlace
(
ctx
:
Context
)
{
val
intent
=
Intent
(
ctx
,
TransPlaceActivity
::
class
.
java
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
ctx
.
startActivity
(
intent
);
}
/**
/**
* 跳转拨号
* 跳转拨号
*/
*/
...
@@ -96,17 +102,6 @@ object OutAppRouter {
...
@@ -96,17 +102,6 @@ object OutAppRouter {
activity
.
startActivity
(
intent
);
activity
.
startActivity
(
intent
);
}
}
/**
* 展示加速页面
*/
// fun showBoostActivity() {
// // 预加载信息流
// ExpressManager.loadAppOutExpress()
// val intent = Intent(MintsApplication.getContext(), BoostActivity::class.java)
// intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
// IntentUtils.startActivity2(intent)
// }
/**
/**
* 展示弹出页面
* 展示弹出页面
*/
*/
...
@@ -124,12 +119,12 @@ object OutAppRouter {
...
@@ -124,12 +119,12 @@ object OutAppRouter {
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_TIME
,
time
)
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_TIME
,
time
)
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_NUM
,
phone
)
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_NUM
,
phone
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
or
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
or
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
IntentUtils
.
startActivity
(
intent
)
IntentUtils
.
startActivity
(
intent
)
}
else
{
}
else
{
IntentUtils
.
startActivity3
(
intent
)
IntentUtils
.
startActivity2
(
intent
)
}
}
}
}
/**
/**
* 展示弹出页面
* 展示弹出页面
...
...
app/src/main/java/com/mints/flowbox/mvp/presenters/BonusPresenter.kt
View file @
ac2f1ffe
package
com.mints.flowbox.mvp.presenters
package
com.mints.flowbox.mvp.presenters
import
android.app.Activity
import
com.google.gson.JsonObject
import
com.google.gson.JsonObject
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.AppHttpManager
import
com.mints.flowbox.manager.AppHttpManager
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.mvp.model.BaseResponse
import
com.mints.flowbox.mvp.model.BaseResponse
import
com.mints.flowbox.mvp.model.SignRedbagsBean
import
com.mints.flowbox.mvp.model.SignRedbagsBean
import
com.mints.flowbox.mvp.views.BonusView
import
com.mints.flowbox.mvp.views.BonusView
...
@@ -74,7 +76,7 @@ class BonusPresenter : BasePresenter<BonusView>() {
...
@@ -74,7 +76,7 @@ class BonusPresenter : BasePresenter<BonusView>() {
* 设置邀请成功
* 设置邀请成功
*
*
*/
*/
fun
cmtShareStatus
()
{
fun
cmtShareStatus
(
activity
:
Activity
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
vo
[
"value"
]
=
"1"
vo
[
"value"
]
=
"1"
...
@@ -92,8 +94,10 @@ class BonusPresenter : BasePresenter<BonusView>() {
...
@@ -92,8 +94,10 @@ class BonusPresenter : BasePresenter<BonusView>() {
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
if
(
isLinkView
)
return
when
(
baseResponse
.
status
)
{
val
vo2
=
HashMap
<
String
,
Any
>()
}
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
activity
,
vo
)
}
}
})
})
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
View file @
ac2f1ffe
...
@@ -55,10 +55,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
...
@@ -55,10 +55,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
const
val
STEP_Interval
=
2000L
const
val
STEP_Interval
=
2000L
}
}
private
val
typeArr
=
arrayOf
(
"运行程序"
,
"系统缓存"
,
"临时文件"
,
"广告垃圾"
,
"安装包"
)
// private val typeArr = arrayOf("运行程序", "系统缓存", "临时文件", "广告垃圾", "安装包")
private
val
typeArr
=
arrayOf
(
"运行程序"
,
"系统缓存"
,
"临时文件"
,
"广告垃圾"
)
// 扫描类型
// 扫描类型
private
var
scanMax
=
5
private
var
scanMax
=
4
private
val
mCleanList
=
mutableListOf
<
ExpandInfo
>()
private
val
mCleanList
=
mutableListOf
<
ExpandInfo
>()
private
var
mCleanExpandAdapter
:
CleanExpandAdapter
?
=
null
private
var
mCleanExpandAdapter
:
CleanExpandAdapter
?
=
null
...
@@ -79,7 +80,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
...
@@ -79,7 +80,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
extras
?.
let
{
scanMax
=
it
.
getInt
(
Constant
.
SCAN_TYPE
,
5
)
scanMax
=
it
.
getInt
(
Constant
.
SCAN_TYPE
,
4
)
}
}
}
}
...
@@ -140,7 +141,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
...
@@ -140,7 +141,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
1
->
btnClean
.
text
=
"正在扫描 系统缓存..."
1
->
btnClean
.
text
=
"正在扫描 系统缓存..."
2
->
btnClean
.
text
=
"正在扫描 临时文件..."
2
->
btnClean
.
text
=
"正在扫描 临时文件..."
3
->
btnClean
.
text
=
"正在扫描 广告垃圾..."
3
->
btnClean
.
text
=
"正在扫描 广告垃圾..."
4
->
btnClean
.
text
=
"正在扫描 安装包..."
//
4 -> btnClean.text = "正在扫描 安装包..."
}
}
elv_clean
.
setSelectedGroup
(
taskType
)
elv_clean
.
setSelectedGroup
(
taskType
)
...
@@ -247,7 +248,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
...
@@ -247,7 +248,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
isCleanCompleted
=
true
isCleanCompleted
=
true
mCleanTimer
?.
cancel
()
mCleanTimer
?.
cancel
()
if
(
scanMax
==
5
)
{
if
(
scanMax
==
4
)
{
toResult
()
toResult
()
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
View file @
ac2f1ffe
...
@@ -67,10 +67,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -67,10 +67,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
}
}
override
fun
onAttachedToWindow
()
{
super
.
onAttachedToWindow
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_increasespeed
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_increasespeed
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
...
@@ -96,7 +92,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
...
@@ -96,7 +92,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
container
.
visibility
=
View
.
GONE
container
.
visibility
=
View
.
GONE
containerAnim
.
visibility
=
View
.
VISIBLE
containerAnim
.
visibility
=
View
.
VISIBLE
mTimerMax
=
11
mTimerMax
=
26
startTimer
()
startTimer
()
}
else
if
(
mIncreaseType
==
INCREASE_CLEAN
&&
AppConfig
.
isCanClean
)
{
}
else
if
(
mIncreaseType
==
INCREASE_CLEAN
&&
AppConfig
.
isCanClean
)
{
container
.
visibility
=
View
.
GONE
container
.
visibility
=
View
.
GONE
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
ac2f1ffe
package
com.mints.flowbox.ui.activitys
package
com.mints.flowbox.ui.activitys
import
android.Manifest
import
android.content.Context
import
android.content.Context
import
android.media.AudioManager
import
android.media.AudioManager
import
android.os.Build
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.KeyEvent
import
android.view.KeyEvent
...
@@ -29,10 +31,13 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
...
@@ -29,10 +31,13 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.ui.fragment.*
import
com.mints.flowbox.ui.fragment.*
import
com.mints.flowbox.ui.widgets.dialog.DialogListener
import
com.mints.flowbox.ui.widgets.dialog.DialogListener
import
com.mints.flowbox.ui.widgets.dialog.PowerDialog
import
com.mints.flowbox.ui.widgets.dialog.PowerDialog
import
com.mints.flowbox.utils.LogUtil
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.GlideUtils
import
com.mints.library.utils.GlideUtils
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_main.*
import
rx.Observable
/**
/**
* 描述:main
* 描述:main
...
@@ -103,6 +108,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -103,6 +108,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
TrackManager
.
getInstance
().
getOuterAdConfig
()
TrackManager
.
getInstance
().
getAdWeight
()
TrackManager
.
getInstance
().
getAdWeight
()
}
}
...
@@ -327,11 +333,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -327,11 +333,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
currentFragment
=
fourFragment
currentFragment
=
fourFragment
}
}
override
fun
onNetworkConnected
(
type
:
NetUtils
.
NetType
?)
{
super
.
onNetworkConnected
(
type
)
TrackManager
.
getInstance
().
getOuterAdConfig
()
}
private
var
mRefreshType
=
-
1
private
var
mRefreshType
=
-
1
private
var
powerDialog
:
PowerDialog
?
=
null
private
var
powerDialog
:
PowerDialog
?
=
null
...
@@ -383,15 +384,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -383,15 +384,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 数美初始化
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
ShumeiManager
.
getInstance
().
initShumei
()
// 预加载信息流
checkPermission
()
ExpressManager
.
loadExpress
(
false
)
val
bundle
=
Bundle
()
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_BOOST
)
readyGo
(
IncreasespeedActivity
::
class
.
java
)
}
}
}
}
}
}
...
@@ -400,6 +393,40 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -400,6 +393,40 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
powerDialog
?.
show
()
powerDialog
?.
show
()
}
}
/** 检测权限 */
private
fun
checkPermission
()
{
val
request
:
Observable
<
Boolean
>
=
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
RxPermissions
(
this
)
.
request
(
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
}
else
{
RxPermissions
(
this
)
.
request
(
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
}
request
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
val
bundle
=
Bundle
()
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_BOOST
)
readyGo
(
IncreasespeedActivity
::
class
.
java
)
}
else
{
showMissingPermissionDialog
(
"位置,存储"
)
}
}
}
/**
/**
* 游客登录
* 游客登录
* refreshType fragment传入的下标
* refreshType fragment传入的下标
...
@@ -493,13 +520,4 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
...
@@ -493,13 +520,4 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
)
)
}
}
override
fun
moveTaskToBack
(
nonRoot
:
Boolean
):
Boolean
{
if
(!
nonRoot
)
{
if
(!
isTaskRoot
)
{
return
false
}
}
return
super
.
moveTaskToBack
(
nonRoot
)
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/activitys/SpeedFastActivity.kt
View file @
ac2f1ffe
...
@@ -5,6 +5,7 @@ import android.graphics.Color
...
@@ -5,6 +5,7 @@ import android.graphics.Color
import
android.view.View
import
android.view.View
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.wifi.WifiAdManager
import
com.mints.flowbox.ad.wifi.WifiAdManager
...
@@ -45,18 +46,13 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
...
@@ -45,18 +46,13 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
override
fun
adFail
()
{
override
fun
adFail
()
{
}
}
override
fun
adClose
()
{
override
fun
adClose
()
{}
}
})
})
}
}
fun
startTimer
()
{
fun
startTimer
()
{
if
(
mTimer
!=
null
)
{
mStep
=
0
mTimer
?.
cancel
()
mTimer
=
null
mStep
=
0
}
mTimer
=
Timer
()
mTimer
=
Timer
()
mTimer
?.
schedule
(
object
:
TimerTask
()
{
mTimer
?.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
override
fun
run
()
{
...
@@ -64,11 +60,9 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
...
@@ -64,11 +60,9 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
runOnUiThread
{
runOnUiThread
{
mStep
++
mStep
++
if
(
mStep
==
2
)
{
if
(
mStep
==
4
)
{
WifiAdManager
.
instance
.
showInterstitial
(
this
@SpeedFastActivity
)
WifiAdManager
.
instance
.
showInterstitial
(
this
@SpeedFastActivity
)
}
if
(
mStep
==
4
)
{
tv_tab
.
text
=
topStr
[
2
]
tv_tab
.
text
=
topStr
[
2
]
btn
.
background
=
ContextCompat
.
getDrawable
(
btn
.
background
=
ContextCompat
.
getDrawable
(
this
@SpeedFastActivity
,
this
@SpeedFastActivity
,
...
@@ -122,14 +116,22 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
...
@@ -122,14 +116,22 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
finish
()
finish
()
}
}
R
.
id
.
btn
->
{
R
.
id
.
btn
->
{
if
(
mStep
==
0
)
{
when
{
btn
.
visibility
=
View
.
INVISIBLE
mStep
==
0
->
{
tv_progress
.
visibility
=
View
.
VISIBLE
startTimer
()
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
wifi_speed
,
iv_gif
)
btn
.
visibility
=
View
.
INVISIBLE
tv_tab
.
text
=
topStr
[
1
]
tv_progress
.
visibility
=
View
.
VISIBLE
}
else
if
(
mStep
>=
4
)
{
finish
()
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
wifi_speed
,
iv_gif
)
tv_tab
.
text
=
topStr
[
1
]
}
mStep
>=
4
->
{
finish
()
}
else
->
{
ToastUtils
.
show
(
"正在加速中..."
)
}
}
}
}
}
}
}
...
@@ -156,8 +158,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
...
@@ -156,8 +158,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
WifiAdManager
.
instance
.
onDestroy
()
fl_ad
?.
removeAllViews
()
fl_ad
?.
removeAllViews
()
// 预加载信息流
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
ExpressManager
.
loadExpress
(
false
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
View file @
ac2f1ffe
...
@@ -42,9 +42,10 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
...
@@ -42,9 +42,10 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
resetWindowTransparentBackground
()
resetWindowTransparentBackground
()
// 设置锁屏页全屏
// 设置锁屏页全屏
val
isUsingShowWhenLockedFlag
=
ScreenLockerUtils
.
isLockScreenProtected
(
this
)
val
isUsingShowWhenLockedFlag
=
!
ScreenLockerUtils
.
isLockScreenProtected
(
this
)
if
(
isUsingShowWhenLockedFlag
)
{
if
(
isUsingShowWhenLockedFlag
)
{
ScreenLockerUtils
.
updateWindowFlags
(
window
.
decorView
)
ScreenLockerUtils
.
updateWindowFlags
(
window
.
decorView
)
ScreenLockerUtils
.
makeLockWindowFullScreen
(
this
,
window
.
attributes
,
true
)
}
}
}
}
...
@@ -56,7 +57,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
...
@@ -56,7 +57,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
!=
0
)
!=
0
)
{
)
{
window
.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
parseColor
(
"
4
0000000"
)))
window
.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
parseColor
(
"
#2
0000000"
)))
}
else
{
}
else
{
try
{
try
{
val
wallpaperManager
=
WallpaperManager
.
getInstance
(
this
)
val
wallpaperManager
=
WallpaperManager
.
getInstance
(
this
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/TransPlaceActivity.kt
0 → 100644
View file @
ac2f1ffe
package
com.mints.flowbox.ui.activitys.keepalive
import
android.os.Bundle
import
android.view.Gravity
import
com.mints.flowbox.R
import
com.mints.flowbox.ui.activitys.base.BaseActivity
/**
*
* 描述:透明activity,用于后台启动activity
*/
class
TransPlaceActivity
:
BaseActivity
()
{
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_trans
override
fun
initViewsAndEvents
()
{}
override
fun
isApplyKitKatTranslucency
()
=
true
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
val
window
=
window
window
.
setGravity
(
Gravity
.
START
or
Gravity
.
TOP
)
val
params
=
window
.
attributes
params
.
x
=
0
params
.
y
=
0
params
.
height
=
1
params
.
width
=
1
window
.
attributes
=
params
moveTaskToBack
(
true
)
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
View file @
ac2f1ffe
...
@@ -7,13 +7,13 @@ import android.os.Looper
...
@@ -7,13 +7,13 @@ import android.os.Looper
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.View
import
android.view.View
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.mvp.model.SignRedbagsBean
import
com.mints.flowbox.mvp.model.SignRedbagsBean
import
com.mints.flowbox.mvp.model.VideoAdingBean
import
com.mints.flowbox.mvp.model.VideoAdingBean
...
@@ -62,6 +62,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
...
@@ -62,6 +62,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
private
var
todayMoney
=
0
private
var
todayMoney
=
0
private
var
allMoney
=
0
private
var
allMoney
=
0
private
var
isButtonCanClick
=
false
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
...
@@ -170,14 +171,14 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
...
@@ -170,14 +171,14 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
shareImgDialog
()
shareImgDialog
()
}
}
1
->
{
1
->
{
val
vo
=
HashMap
<
String
,
Any
>()
//
val vo = HashMap<String, Any>()
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
//
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
TrackManager
.
getInstance
()
//
TrackManager.getInstance()
.
reportAddCoinMsg
(
requireActivity
(),
vo
)
//
.reportAddCoinMsg(requireActivity(), vo)
//
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
//
Handler(Looper.getMainLooper()).postDelayed({
refreshData
()
//
refreshData()
},
500
);
// }, 500)
}
}
}
}
}
}
...
@@ -203,7 +204,12 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
...
@@ -203,7 +204,12 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
}
}
// 当天是否可签到
// 当天是否可签到
btn_sign
.
isEnabled
=
data
.
isButtonCanClick
this
.
isButtonCanClick
=
data
.
isButtonCanClick
if
(
this
.
isButtonCanClick
)
{
btn_sign
.
setBackgroundResource
(
R
.
mipmap
.
ic_bouns_sign
)
}
else
{
btn_sign
.
setBackgroundResource
(
R
.
mipmap
.
ic_bonus_sign_unenable
)
}
btn_sign
.
text
=
data
.
buttonText
btn_sign
.
text
=
data
.
buttonText
...
@@ -236,7 +242,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
...
@@ -236,7 +242,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
val
shareDialog
=
ShareDialog
(
requireActivity
())
val
shareDialog
=
ShareDialog
(
requireActivity
())
shareDialog
.
setOnShareOKListener
(
object
:
ShareDialog
.
OnShareOKListener
{
shareDialog
.
setOnShareOKListener
(
object
:
ShareDialog
.
OnShareOKListener
{
override
fun
onShareOk
()
{
override
fun
onShareOk
()
{
bonusPresenter
.
cmtShareStatus
()
bonusPresenter
.
cmtShareStatus
(
requireActivity
()
)
}
}
})
})
val
userManager
=
UserManager
.
getInstance
()
val
userManager
=
UserManager
.
getInstance
()
...
@@ -283,8 +289,12 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
...
@@ -283,8 +289,12 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
btn_sign
->
{
R
.
id
.
btn_sign
->
{
// 签到
if
(
isButtonCanClick
)
{
bonusPresenter
.
sign
()
// 签到
bonusPresenter
.
sign
()
}
else
{
ToastUtils
.
show
(
"请先完成今日任务!"
)
}
}
}
else
->
{
else
->
{
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
View file @
ac2f1ffe
...
@@ -859,6 +859,7 @@ class MyFragment : BaseFragment(),
...
@@ -859,6 +859,7 @@ class MyFragment : BaseFragment(),
object
:
DialogListener
()
{
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
AppUtil
.
openUsageStats
(
mContext
)
AppUtil
.
openUsageStats
(
mContext
)
dialog
?.
dismiss
()
}
}
})
})
}
}
...
@@ -936,26 +937,26 @@ class MyFragment : BaseFragment(),
...
@@ -936,26 +937,26 @@ class MyFragment : BaseFragment(),
// 新人福利
// 新人福利
// 游客首次提示1500新人奖励 且 不是分享包
// 游客首次提示1500新人奖励 且 不是分享包
val
channel
=
CommonUtils
.
getAppMetaData
(
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
"CHANNEL_NAME"
)
)
if
(!
TextUtils
.
equals
(
if
(!
TextUtils
.
equals
(
channel
,
channel
,
Constant
.
CHANNEL_SHARE
Constant
.
CHANNEL_SHARE
)
&&
AppPreferencesManager
.
get
().
getBoolean
(
)
&&
AppPreferencesManager
.
get
().
getBoolean
(
Constant
.
FIRST_VISITOR_FLAG
,
Constant
.
FIRST_VISITOR_FLAG
,
true
true
)
)
)
{
)
{
AppPreferencesManager
.
get
().
put
(
Constant
.
FIRST_VISITOR_FLAG
,
false
)
AppPreferencesManager
.
get
().
put
(
Constant
.
FIRST_VISITOR_FLAG
,
false
)
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
bundle
.
putInt
(
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
Constant
.
MAIN_CUR_COIN
,
AppConfig
.
firstGiveCoin
AppConfig
.
firstGiveCoin
)
)
bundle
.
putString
(
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_NEW_VISITOR
Constant
.
CARRIER_NEW_VISITOR
)
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
View file @
ac2f1ffe
...
@@ -735,8 +735,8 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
...
@@ -735,8 +735,8 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
DialogUtils
.
showDialog
(
DialogUtils
.
showDialog
(
requireActivity
(),
requireActivity
(),
"提示"
,
content
,
content
,
"提示"
,
leftStr
,
leftStr
,
object
:
DialogListener
()
{
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
)
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
)
{
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/base/BaseFragment.java
View file @
ac2f1ffe
...
@@ -126,7 +126,7 @@ public abstract class BaseFragment extends BaseAppFragment {
...
@@ -126,7 +126,7 @@ public abstract class BaseFragment extends BaseAppFragment {
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
builder
.
setTitle
(
R
.
string
.
notifyTitle
);
builder
.
setTitle
(
R
.
string
.
notifyTitle
);
//当前应用缺少必要权限。\n\n请点击\"设置\"-\"权限\"-打开所需权限。
//当前应用缺少必要权限。\n\n请点击\"设置\"-\"权限\"-打开所需权限。
builder
.
setMessage
(
"当前应用缺少 "
+
msg
+
"授权\n\n请点击 设置-权限-打开所需权限"
);
builder
.
setMessage
(
"当前应用缺少 "
+
msg
+
"
授权\n\n请点击 设置-权限-打开所需权限"
);
// 拒绝, 退出应用
// 拒绝, 退出应用
builder
.
setNegativeButton
(
R
.
string
.
cancel
,
builder
.
setNegativeButton
(
R
.
string
.
cancel
,
...
...
app/src/main/java/com/mints/flowbox/ui/widgets/DrawHookView.java
View file @
ac2f1ffe
...
@@ -67,7 +67,7 @@ public class DrawHookView extends View {
...
@@ -67,7 +67,7 @@ public class DrawHookView extends View {
RectF
rectF
=
new
RectF
(
center
-
radius
-
1
,
center
-
radius
-
1
,
center
+
radius
+
1
,
center
+
radius
+
1
);
RectF
rectF
=
new
RectF
(
center
-
radius
-
1
,
center
-
radius
-
1
,
center
+
radius
+
1
,
center
+
radius
+
1
);
//根据进度画圆弧
//根据进度画圆弧
canvas
.
drawArc
(
rectF
,
-
180
,
-
360
*
progress
/
100
,
false
,
paint
);
canvas
.
drawArc
(
rectF
,
-
180
,
360
*
progress
/
100
,
false
,
paint
);
/*
/*
* 绘制对勾
* 绘制对勾
...
...
app/src/main/java/com/mints/flowbox/utils/ForegroundOrBackground.java
View file @
ac2f1ffe
...
@@ -29,6 +29,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -29,6 +29,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
//获取当前最上层的activity
//获取当前最上层的activity
private
static
WeakReference
<
Activity
>
app_activity
;
private
static
WeakReference
<
Activity
>
app_activity
;
private
static
WeakReference
<
Activity
>
main_activity
;
private
static
WeakReference
<
Activity
>
main_activity
;
private
static
WeakReference
<
Activity
>
trans_activity
;
private
WeakReference
<
VersionUpdatePresenter
>
vupWeakReference
;
private
WeakReference
<
VersionUpdatePresenter
>
vupWeakReference
;
private
VersionUpdatePresenter
vup
;
private
VersionUpdatePresenter
vup
;
private
WeakReference
<
Activity
>
reference
;
private
WeakReference
<
Activity
>
reference
;
...
@@ -59,10 +60,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -59,10 +60,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return
instance
;
return
instance
;
}
}
public
static
Activity
getApp_activity
()
{
return
app_activity
.
get
();
}
public
static
Activity
getMain_activity
()
{
public
static
Activity
getMain_activity
()
{
try
{
try
{
if
(
main_activity
.
get
()
!=
null
)
{
if
(
main_activity
.
get
()
!=
null
)
{
...
@@ -75,6 +72,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -75,6 +72,30 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
}
}
}
}
public
static
Activity
getApp_activity
()
{
try
{
if
(
app_activity
.
get
()
!=
null
)
{
return
app_activity
.
get
();
}
return
main_activity
.
get
();
}
catch
(
NullPointerException
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
//
// public static Activity getTrans_activity() {
// try {
// if (trans_activity.get() != null) {
// return trans_activity.get();
// }
// return app_activity.get();
// } catch (NullPointerException e) {
// e.printStackTrace();
// return null;
// }
// }
@Override
@Override
public
void
onActivityResumed
(
Activity
activity
)
{
public
void
onActivityResumed
(
Activity
activity
)
{
if
(
activity
==
null
)
if
(
activity
==
null
)
...
@@ -114,6 +135,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
...
@@ -114,6 +135,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
main_activity
=
new
WeakReference
<>(
activity
);
main_activity
=
new
WeakReference
<>(
activity
);
}
}
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"TransPlaceActivity"
))
{
trans_activity
=
new
WeakReference
<>(
activity
);
}
}
}
@Override
@Override
...
...
app/src/main/java/com/mints/flowbox/utils/keepalive/IntentUtils.java
View file @
ac2f1ffe
...
@@ -4,7 +4,6 @@ import android.app.Activity;
...
@@ -4,7 +4,6 @@ import android.app.Activity;
import
android.app.ActivityManager
;
import
android.app.ActivityManager
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.provider.Settings
;
import
com.activityutil.ActivityManagerProxy
;
import
com.activityutil.ActivityManagerProxy
;
...
@@ -13,6 +12,7 @@ import com.activityutil.ContextLike;
...
@@ -13,6 +12,7 @@ import com.activityutil.ContextLike;
import
com.mints.flowbox.MintsApplication
;
import
com.mints.flowbox.MintsApplication
;
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.LogUtil
;
import
net.phone.PhoneBrandUtils
;
import
net.phone.PhoneBrandUtils
;
...
@@ -30,8 +30,8 @@ public class IntentUtils {
...
@@ -30,8 +30,8 @@ public class IntentUtils {
public
static
final
String
TAG
=
"IntentUtils"
;
public
static
final
String
TAG
=
"IntentUtils"
;
public
static
void
startActivity2
(
Intent
intent
)
{
public
static
void
startActivity2
(
Intent
intent
)
{
if
(
PhoneBrandUtils
.
isHuaweiHonor
()
||
(
PhoneBrandUtils
.
isXiaomi
()
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
))
{
if
(
(
PhoneBrandUtils
.
isHuaweiOriginal
()
||
isHarmonyOs
()
))
{
if
(
ForegroundOrBackground
.
get
Main
_activity
()
!=
null
)
{
if
(
ForegroundOrBackground
.
get
App
_activity
()
!=
null
)
{
startActivity
(
intent
);
startActivity
(
intent
);
return
;
return
;
}
}
...
@@ -79,10 +79,10 @@ public class IntentUtils {
...
@@ -79,10 +79,10 @@ public class IntentUtils {
moveToFront
(
activity
);
moveToFront
(
activity
);
activity
.
startActivity
(
intent
);
activity
.
startActivity
(
intent
);
activity
.
moveTaskToBack
(
fals
e
);
activity
.
moveTaskToBack
(
tru
e
);
return
;
return
;
}
}
startActivity3
(
intent
);
//
startActivity3(intent);
}
}
public
static
void
startActivity3
(
Intent
intent
)
{
public
static
void
startActivity3
(
Intent
intent
)
{
...
@@ -95,6 +95,10 @@ public class IntentUtils {
...
@@ -95,6 +95,10 @@ public class IntentUtils {
@Override
@Override
public
void
onResult
(
boolean
b
)
{
public
void
onResult
(
boolean
b
)
{
if
(!
b
)
{
LogUtil
.
d
(
"AAAAAAa"
);
startActivity
(
intent
);
}
}
}
},
null
);
},
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -102,12 +106,12 @@ public class IntentUtils {
...
@@ -102,12 +106,12 @@ public class IntentUtils {
}
}
}
}
public
static
Boolean
isRunningForeground
(
Activity
activity
)
{
public
static
Boolean
isRunningForeground
(
Context
context
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
activity
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
ActivityManager
activityManager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
10
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
10
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
activity
.
getPackageName
()))
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
return
true
;
return
true
;
}
}
}
}
...
@@ -121,7 +125,7 @@ public class IntentUtils {
...
@@ -121,7 +125,7 @@ public class IntentUtils {
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
//遍历找到本应用的 task,并将它切换到前台
//遍历找到本应用的 task,并将它切换到前台
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
0
);
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
ActivityManager
.
MOVE_TASK_WITH_HOME
);
return
;
return
;
}
}
}
}
...
@@ -135,4 +139,14 @@ public class IntentUtils {
...
@@ -135,4 +139,14 @@ public class IntentUtils {
context
.
startActivity
(
intent
);
context
.
startActivity
(
intent
);
}
}
public
static
boolean
isHarmonyOs
()
{
try
{
Class
<?>
buildExClass
=
Class
.
forName
(
"com.huawei.system.BuildEx"
);
Object
osBrand
=
buildExClass
.
getMethod
(
"getOsBrand"
).
invoke
(
buildExClass
);
return
"harmony"
.
equalsIgnoreCase
(
osBrand
.
toString
());
}
catch
(
Throwable
e
)
{
return
false
;
}
}
}
}
app/src/main/java/com/mints/library/utils/GlideUtils.java
View file @
ac2f1ffe
...
@@ -70,7 +70,8 @@ public class GlideUtils {
...
@@ -70,7 +70,8 @@ public class GlideUtils {
//加载Gif
//加载Gif
public
static
void
loadImageViewGif
(
Context
mContext
,
int
drawable
,
ImageView
imageView
)
{
public
static
void
loadImageViewGif
(
Context
mContext
,
int
drawable
,
ImageView
imageView
)
{
Glide
.
with
(
mContext
).
load
(
drawable
).
into
(
imageView
);
Glide
.
with
(
mContext
).
clear
(
imageView
);
Glide
.
with
(
mContext
).
load
(
drawable
).
skipMemoryCache
(
true
).
diskCacheStrategy
(
DiskCacheStrategy
.
NONE
).
into
(
imageView
);
}
}
//加载Gif
//加载Gif
...
...
app/src/main/res/drawable-xhdpi/battery.gif
View replaced file @
ba1bed4e
View file @
ac2f1ffe
22.7 KB
|
W:
|
H:
387 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/drawable-xhdpi/ic_launcher_app_out.png
0 → 100644
View file @
ac2f1ffe
3.45 KB
app/src/main/res/layout/activity_apk.xml
View file @
ac2f1ffe
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
android:layout_gravity=
"end"
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
android:textColor=
"@color/color_40000000"
...
...
app/src/main/res/layout/activity_increasespeed.xml
View file @
ac2f1ffe
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<ImageView
<ImageView
android:id=
"@+id/iv_gif"
android:id=
"@+id/iv_gif"
android:layout_width=
"2
5
0dp"
android:layout_width=
"2
8
0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
/>
android:layout_centerInParent=
"true"
/>
...
...
app/src/main/res/layout/activity_screen.xml
View file @
ac2f1ffe
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
android:id=
"@+id/tvTime"
android:id=
"@+id/tvTime"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_
marginStart=
"20dp
"
android:layout_
centerHorizontal=
"true
"
android:layout_marginTop=
"
4
0dp"
android:layout_marginTop=
"
6
0dp"
android:text=
"-"
android:text=
"-"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"60sp"
/>
android:textSize=
"60sp"
/>
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tvTime"
android:layout_below=
"@id/tvTime"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"30dp"
android:layout_marginStart=
"30dp"
android:text=
"-"
android:text=
"-"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
...
@@ -103,10 +104,12 @@
...
@@ -103,10 +104,12 @@
android:textSize=
"20sp"
/>
android:textSize=
"20sp"
/>
<TextView
<TextView
android:layout_width=
"
wrap_content
"
android:layout_width=
"
78dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|bottom"
android:layout_gravity=
"top"
android:layout_marginTop=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginTop=
"30dp"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
android:textColor=
"@color/color_40000000"
...
...
app/src/main/res/layout/activity_timing.xml
View file @
ac2f1ffe
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
android:layout_gravity=
"end"
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
android:textColor=
"@color/color_40000000"
...
@@ -41,7 +42,7 @@
...
@@ -41,7 +42,7 @@
android:layout_alignParentEnd=
"true"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end|center_vertical"
android:layout_gravity=
"end|center_vertical"
android:layout_marginEnd=
"10dp"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_
close
"
android:src=
"@mipmap/ic_
activity_quit
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/layout/fragment_bonus.xml
View file @
ac2f1ffe
...
@@ -126,8 +126,7 @@
...
@@ -126,8 +126,7 @@
android:layout_height=
"80dp"
android:layout_height=
"80dp"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/btn_bonus_sign"
android:background=
"@mipmap/ic_bouns_sign"
android:enabled=
"false"
android:text=
"签到"
android:text=
"签到"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"18sp"
/>
android:textSize=
"18sp"
/>
...
...
app/src/main/res/layout/fragment_home.xml
View file @
ac2f1ffe
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"
4
0dp"
android:layout_marginTop=
"
5
0dp"
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"10dp"
android:text=
"流量补贴"
android:text=
"流量补贴"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
...
...
app/src/main/res/layout/view_wifi.xml
View file @
ac2f1ffe
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:text=
"每5分钟可领取一次补贴金币"
android:text=
"每5分钟可领取一次补贴金币"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"1
2
sp"
/>
android:textSize=
"1
4
sp"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
...
...
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