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
72c45791
Commit
72c45791
authored
Jul 20, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化后台弹出逻辑
parent
fd3309b6
Changes
28
Show 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 @
72c45791
...
...
@@ -8,6 +8,7 @@
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
/>
<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.REORDER_TASKS"
/>
<uses-permission
android:name=
"android.permission.READ_CALL_LOG"
/>
<uses-permission
android:name=
"android.permission.CALL_PHONE"
/>
...
...
@@ -193,9 +194,15 @@
<activity
android:name=
".ui.activitys.keepalive.TransparentActivity"
android:excludeFromRecents=
"true"
android:launchMode=
"single
Task
"
android:launchMode=
"single
Instance
"
android:theme=
"@style/CustomerTransparentTheme"
/>
<!-- <activity-->
<!-- android:name=".ui.activitys.keepalive.TransPlaceActivity"-->
<!-- android:excludeFromRecents="true"-->
<!-- android:launchMode="singleTask"-->
<!-- android:theme="@style/CustomerTransparentTheme" />-->
<activity
android:name=
".ui.activitys.keepalive.BoostFastActivity"
android:excludeFromRecents=
"true"
...
...
app/src/main/java/com/mints/flowbox/MintsApplication.java
View file @
72c45791
...
...
@@ -36,6 +36,7 @@ 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.SystemUtils
;
import
com.mints.flowbox.utils.keepalive.IntentUtils
;
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
;
import
com.module.legacy.oreo.RegisterJobUtils
;
import
com.orhanobut.logger.AndroidLogAdapter
;
...
...
@@ -186,6 +187,8 @@ public class MintsApplication extends BaseApp {
// Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
// }
// OutAppRouter.INSTANCE.startTransPlace(this);
WifiStateWatch
.
getInstance
(
this
).
begin
(
new
WifiStateWatch
.
WifiStateListener
()
{
@Override
public
void
onWifiOpen
()
{
...
...
@@ -269,6 +272,9 @@ public class MintsApplication extends BaseApp {
BatteryWatch
.
getInstance
(
this
).
begin
(
new
BatteryWatch
.
BatteryStateListener
()
{
@Override
public
void
onCharging
()
{
if
(
IntentUtils
.
isRunningForeground
(
MintsApplication
.
getContext
()))
{
return
;
}
if
(
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
mContext
))
{
return
;
}
...
...
app/src/main/java/com/mints/flowbox/keepalive/AlarmManager.java
View file @
72c45791
...
...
@@ -142,6 +142,7 @@ public class AlarmManager implements WeakHandler.IHandler {
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
TransparentActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
);
intent
.
putExtra
(
TransparentActivity
.
TIMING_TYPE
,
currentType
++);
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
IntentUtils
.
startActivity
(
intent
);
}
else
{
...
...
app/src/main/java/com/mints/flowbox/keepalive/OutAppRouter.kt
View file @
72c45791
package
com.mints.flowbox.keepalive
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ui.activitys.keepalive.ApkActivity
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.utils.ForegroundOrBackground
import
com.mints.flowbox.utils.LogUtil
import
com.mints.flowbox.utils.keepalive.IntentUtils
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils.canShowScreenLocker
import
net.phone.PhoneBrandUtils
...
...
@@ -64,13 +67,6 @@ object OutAppRouter {
}
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
())
{
IntentUtils
.
startActivity
(
intent
)
}
else
{
...
...
@@ -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 {
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 {
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_TIME
,
time
)
intent
.
putExtra
(
TriggerActivity
.
CALL_PHONE_NUM
,
phone
)
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
or
Intent
.
FLAG_ACTIVITY_NO_ANIMATION
if
(
PhoneBrandUtils
.
isLockScreenProtected
())
{
IntentUtils
.
startActivity
(
intent
)
}
else
{
IntentUtils
.
startActivity3
(
intent
)
}
}
IntentUtils
.
startActivity2
(
intent
)
}
}
/**
* 展示弹出页面
...
...
app/src/main/java/com/mints/flowbox/mvp/presenters/BonusPresenter.kt
View file @
72c45791
package
com.mints.flowbox.mvp.presenters
import
android.app.Activity
import
com.google.gson.JsonObject
import
com.mints.flowbox.common.Constant
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.SignRedbagsBean
import
com.mints.flowbox.mvp.views.BonusView
...
...
@@ -74,7 +76,7 @@ class BonusPresenter : BasePresenter<BonusView>() {
* 设置邀请成功
*
*/
fun
cmtShareStatus
()
{
fun
cmtShareStatus
(
activity
:
Activity
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
vo
[
"value"
]
=
"1"
...
...
@@ -92,8 +94,10 @@ class BonusPresenter : BasePresenter<BonusView>() {
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
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 @
72c45791
...
...
@@ -55,10 +55,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
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
var
mCleanExpandAdapter
:
CleanExpandAdapter
?
=
null
...
...
@@ -79,7 +80,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
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 {
1
->
btnClean
.
text
=
"正在扫描 系统缓存..."
2
->
btnClean
.
text
=
"正在扫描 临时文件..."
3
->
btnClean
.
text
=
"正在扫描 广告垃圾..."
4
->
btnClean
.
text
=
"正在扫描 安装包..."
//
4 -> btnClean.text = "正在扫描 安装包..."
}
elv_clean
.
setSelectedGroup
(
taskType
)
...
...
@@ -247,7 +248,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
isCleanCompleted
=
true
mCleanTimer
?.
cancel
()
if
(
scanMax
==
5
)
{
if
(
scanMax
==
4
)
{
toResult
()
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
View file @
72c45791
...
...
@@ -67,10 +67,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
super
.
onCreate
(
savedInstanceState
)
}
override
fun
onAttachedToWindow
()
{
super
.
onAttachedToWindow
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_increasespeed
override
fun
initViewsAndEvents
()
{
...
...
@@ -96,7 +92,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
container
.
visibility
=
View
.
GONE
containerAnim
.
visibility
=
View
.
VISIBLE
mTimerMax
=
11
mTimerMax
=
26
startTimer
()
}
else
if
(
mIncreaseType
==
INCREASE_CLEAN
&&
AppConfig
.
isCanClean
)
{
container
.
visibility
=
View
.
GONE
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
72c45791
package
com.mints.flowbox.ui.activitys
import
android.Manifest
import
android.content.Context
import
android.media.AudioManager
import
android.os.Build
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.KeyEvent
...
...
@@ -29,10 +31,13 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.ui.fragment.*
import
com.mints.flowbox.ui.widgets.dialog.DialogListener
import
com.mints.flowbox.ui.widgets.dialog.PowerDialog
import
com.mints.flowbox.utils.LogUtil
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.GlideUtils
import
com.tbruyelle.rxpermissions.RxPermissions
import
kotlinx.android.synthetic.main.activity_main.*
import
rx.Observable
/**
* 描述:main
...
...
@@ -103,6 +108,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
onResume
()
{
super
.
onResume
()
TrackManager
.
getInstance
().
getOuterAdConfig
()
TrackManager
.
getInstance
().
getAdWeight
()
}
...
...
@@ -327,11 +333,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
currentFragment
=
fourFragment
}
override
fun
onNetworkConnected
(
type
:
NetUtils
.
NetType
?)
{
super
.
onNetworkConnected
(
type
)
TrackManager
.
getInstance
().
getOuterAdConfig
()
}
private
var
mRefreshType
=
-
1
private
var
powerDialog
:
PowerDialog
?
=
null
...
...
@@ -383,6 +384,34 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
checkPermission
()
}
}
}
}
})
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
)
...
...
@@ -392,13 +421,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
IncreasespeedActivity
.
INCREASE_BOOST
)
readyGo
(
IncreasespeedActivity
::
class
.
java
)
}
else
{
showMissingPermissionDialog
(
"位置,存储"
)
}
}
}
}
})
powerDialog
?.
show
()
}
/**
* 游客登录
...
...
@@ -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 @
72c45791
...
...
@@ -5,6 +5,7 @@ import android.graphics.Color
import
android.view.View
import
androidx.core.content.ContextCompat
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.wifi.WifiAdManager
...
...
@@ -45,18 +46,13 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
override
fun
adFail
()
{
}
override
fun
adClose
()
{
}
override
fun
adClose
()
{}
})
}
fun
startTimer
()
{
if
(
mTimer
!=
null
)
{
mTimer
?.
cancel
()
mTimer
=
null
mStep
=
0
}
mTimer
=
Timer
()
mTimer
?.
schedule
(
object
:
TimerTask
()
{
override
fun
run
()
{
...
...
@@ -64,11 +60,9 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
runOnUiThread
{
mStep
++
if
(
mStep
==
2
)
{
if
(
mStep
==
4
)
{
WifiAdManager
.
instance
.
showInterstitial
(
this
@SpeedFastActivity
)
}
if
(
mStep
==
4
)
{
tv_tab
.
text
=
topStr
[
2
]
btn
.
background
=
ContextCompat
.
getDrawable
(
this
@SpeedFastActivity
,
...
...
@@ -122,15 +116,23 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
finish
()
}
R
.
id
.
btn
->
{
if
(
mStep
==
0
)
{
when
{
mStep
==
0
->
{
startTimer
()
btn
.
visibility
=
View
.
INVISIBLE
tv_progress
.
visibility
=
View
.
VISIBLE
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
wifi_speed
,
iv_gif
)
tv_tab
.
text
=
topStr
[
1
]
}
else
if
(
mStep
>=
4
)
{
}
mStep
>=
4
->
{
finish
()
}
else
->
{
ToastUtils
.
show
(
"正在加速中..."
)
}
}
}
}
}
...
...
@@ -156,8 +158,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
}
override
fun
onDestroy
()
{
WifiAdManager
.
instance
.
onDestroy
()
fl_ad
?.
removeAllViews
()
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
View file @
72c45791
...
...
@@ -42,9 +42,10 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
resetWindowTransparentBackground
()
// 设置锁屏页全屏
val
isUsingShowWhenLockedFlag
=
ScreenLockerUtils
.
isLockScreenProtected
(
this
)
val
isUsingShowWhenLockedFlag
=
!
ScreenLockerUtils
.
isLockScreenProtected
(
this
)
if
(
isUsingShowWhenLockedFlag
)
{
ScreenLockerUtils
.
updateWindowFlags
(
window
.
decorView
)
ScreenLockerUtils
.
makeLockWindowFullScreen
(
this
,
window
.
attributes
,
true
)
}
}
...
...
@@ -56,7 +57,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
!=
0
)
{
window
.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
parseColor
(
"
4
0000000"
)))
window
.
setBackgroundDrawable
(
ColorDrawable
(
Color
.
parseColor
(
"
#2
0000000"
)))
}
else
{
try
{
val
wallpaperManager
=
WallpaperManager
.
getInstance
(
this
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/TransPlaceActivity.kt
0 → 100644
View file @
72c45791
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 @
72c45791
...
...
@@ -7,13 +7,13 @@ import android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
androidx.core.content.ContextCompat
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.video.PreCsjGroMoreVideoAdManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.ad.video.base.VideoAdStatusListener
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.TrackManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.mvp.model.SignRedbagsBean
import
com.mints.flowbox.mvp.model.VideoAdingBean
...
...
@@ -62,6 +62,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
private
var
todayMoney
=
0
private
var
allMoney
=
0
private
var
isButtonCanClick
=
false
override
fun
onResume
()
{
super
.
onResume
()
...
...
@@ -170,14 +171,14 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
shareImgDialog
()
}
1
->
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
Constant
.
CHALLENGE_SHAREFRIEND
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
requireActivity
(),
vo
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
refreshData
()
},
500
);
//
val vo = HashMap<String, Any>()
//
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
//
TrackManager.getInstance()
//
.reportAddCoinMsg(requireActivity(), vo)
//
//
Handler(Looper.getMainLooper()).postDelayed({
//
refreshData()
// }, 500)
}
}
}
...
...
@@ -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
...
...
@@ -236,7 +242,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
val
shareDialog
=
ShareDialog
(
requireActivity
())
shareDialog
.
setOnShareOKListener
(
object
:
ShareDialog
.
OnShareOKListener
{
override
fun
onShareOk
()
{
bonusPresenter
.
cmtShareStatus
()
bonusPresenter
.
cmtShareStatus
(
requireActivity
()
)
}
})
val
userManager
=
UserManager
.
getInstance
()
...
...
@@ -283,8 +289,12 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
when
(
v
?.
id
)
{
R
.
id
.
btn_sign
->
{
if
(
isButtonCanClick
)
{
// 签到
bonusPresenter
.
sign
()
}
else
{
ToastUtils
.
show
(
"请先完成今日任务!"
)
}
}
else
->
{
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
View file @
72c45791
...
...
@@ -859,6 +859,7 @@ class MyFragment : BaseFragment(),
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
AppUtil
.
openUsageStats
(
mContext
)
dialog
?.
dismiss
()
}
})
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/TurnTableFragment.kt
View file @
72c45791
...
...
@@ -735,8 +735,8 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
DialogUtils
.
showDialog
(
requireActivity
(),
"提示"
,
content
,
"提示"
,
leftStr
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
)
{
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/base/BaseFragment.java
View file @
72c45791
...
...
@@ -126,7 +126,7 @@ public abstract class BaseFragment extends BaseAppFragment {
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
());
builder
.
setTitle
(
R
.
string
.
notifyTitle
);
//当前应用缺少必要权限。\n\n请点击\"设置\"-\"权限\"-打开所需权限。
builder
.
setMessage
(
"当前应用缺少 "
+
msg
+
"授权\n\n请点击 设置-权限-打开所需权限"
);
builder
.
setMessage
(
"当前应用缺少 "
+
msg
+
"
授权\n\n请点击 设置-权限-打开所需权限"
);
// 拒绝, 退出应用
builder
.
setNegativeButton
(
R
.
string
.
cancel
,
...
...
app/src/main/java/com/mints/flowbox/ui/widgets/DrawHookView.java
View file @
72c45791
...
...
@@ -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
);
//根据进度画圆弧
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 @
72c45791
...
...
@@ -29,6 +29,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
//获取当前最上层的activity
private
static
WeakReference
<
Activity
>
app_activity
;
private
static
WeakReference
<
Activity
>
main_activity
;
private
static
WeakReference
<
Activity
>
trans_activity
;
private
WeakReference
<
VersionUpdatePresenter
>
vupWeakReference
;
private
VersionUpdatePresenter
vup
;
private
WeakReference
<
Activity
>
reference
;
...
...
@@ -59,10 +60,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return
instance
;
}
public
static
Activity
getApp_activity
()
{
return
app_activity
.
get
();
}
public
static
Activity
getMain_activity
()
{
try
{
if
(
main_activity
.
get
()
!=
null
)
{
...
...
@@ -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
public
void
onActivityResumed
(
Activity
activity
)
{
if
(
activity
==
null
)
...
...
@@ -114,6 +135,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
main_activity
=
new
WeakReference
<>(
activity
);
}
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"TransPlaceActivity"
))
{
trans_activity
=
new
WeakReference
<>(
activity
);
}
}
@Override
...
...
app/src/main/java/com/mints/flowbox/utils/keepalive/IntentUtils.java
View file @
72c45791
...
...
@@ -4,7 +4,6 @@ import android.app.Activity;
import
android.app.ActivityManager
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.provider.Settings
;
import
com.activityutil.ActivityManagerProxy
;
...
...
@@ -13,6 +12,7 @@ import com.activityutil.ContextLike;
import
com.mints.flowbox.MintsApplication
;
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.LogUtil
;
import
net.phone.PhoneBrandUtils
;
...
...
@@ -30,8 +30,8 @@ public class IntentUtils {
public
static
final
String
TAG
=
"IntentUtils"
;
public
static
void
startActivity2
(
Intent
intent
)
{
if
(
PhoneBrandUtils
.
isHuaweiHonor
()
||
(
PhoneBrandUtils
.
isXiaomi
()
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
))
{
if
(
ForegroundOrBackground
.
get
Main
_activity
()
!=
null
)
{
if
(
(
PhoneBrandUtils
.
isHuaweiOriginal
()
||
isHarmonyOs
()
))
{
if
(
ForegroundOrBackground
.
get
App
_activity
()
!=
null
)
{
startActivity
(
intent
);
return
;
}
...
...
@@ -79,10 +79,10 @@ public class IntentUtils {
moveToFront
(
activity
);
activity
.
startActivity
(
intent
);
activity
.
moveTaskToBack
(
fals
e
);
activity
.
moveTaskToBack
(
tru
e
);
return
;
}
startActivity3
(
intent
);
//
startActivity3(intent);
}
public
static
void
startActivity3
(
Intent
intent
)
{
...
...
@@ -95,6 +95,10 @@ public class IntentUtils {
@Override
public
void
onResult
(
boolean
b
)
{
if
(!
b
)
{
LogUtil
.
d
(
"AAAAAAa"
);
startActivity
(
intent
);
}
}
},
null
);
}
catch
(
Exception
e
)
{
...
...
@@ -102,12 +106,12 @@ public class IntentUtils {
}
}
public
static
Boolean
isRunningForeground
(
Activity
activity
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
activity
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
public
static
Boolean
isRunningForeground
(
Context
context
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
10
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
activity
.
getPackageName
()))
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
return
true
;
}
}
...
...
@@ -121,7 +125,7 @@ public class IntentUtils {
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
//遍历找到本应用的 task,并将它切换到前台
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
0
);
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
ActivityManager
.
MOVE_TASK_WITH_HOME
);
return
;
}
}
...
...
@@ -135,4 +139,14 @@ public class IntentUtils {
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 @
72c45791
...
...
@@ -70,7 +70,8 @@ public class GlideUtils {
//加载Gif
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
...
...
app/src/main/res/drawable-xhdpi/battery.gif
View replaced file @
fd3309b6
View file @
72c45791
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 @
72c45791
3.45 KB
app/src/main/res/layout/activity_apk.xml
View file @
72c45791
...
...
@@ -29,6 +29,7 @@
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
...
...
app/src/main/res/layout/activity_increasespeed.xml
View file @
72c45791
...
...
@@ -12,7 +12,7 @@
<ImageView
android:id=
"@+id/iv_gif"
android:layout_width=
"2
5
0dp"
android:layout_width=
"2
8
0dp"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
/>
...
...
app/src/main/res/layout/activity_screen.xml
View file @
72c45791
...
...
@@ -13,8 +13,8 @@
android:id=
"@+id/tvTime"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_
marginStart=
"20dp
"
android:layout_marginTop=
"
4
0dp"
android:layout_
centerHorizontal=
"true
"
android:layout_marginTop=
"
6
0dp"
android:text=
"-"
android:textColor=
"@color/white"
android:textSize=
"60sp"
/>
...
...
@@ -24,6 +24,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tvTime"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"30dp"
android:text=
"-"
android:textColor=
"@color/white"
...
...
@@ -103,10 +104,12 @@
android:textSize=
"20sp"
/>
<TextView
android:layout_width=
"
wrap_content
"
android:layout_width=
"
78dp
"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end|bottom"
android:layout_marginTop=
"10dp"
android:layout_gravity=
"top"
android:layout_marginStart=
"10dp"
android:layout_marginTop=
"30dp"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
...
...
app/src/main/res/layout/activity_timing.xml
View file @
72c45791
...
...
@@ -28,6 +28,7 @@
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:drawablePadding=
"4dp"
android:gravity=
"center_vertical"
android:text=
"@string/appName"
android:textColor=
"@color/color_40000000"
...
...
@@ -41,7 +42,7 @@
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end|center_vertical"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_
close
"
android:src=
"@mipmap/ic_
activity_quit
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/layout/fragment_bonus.xml
View file @
72c45791
...
...
@@ -126,8 +126,7 @@
android:layout_height=
"80dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/btn_bonus_sign"
android:enabled=
"false"
android:background=
"@mipmap/ic_bouns_sign"
android:text=
"签到"
android:textColor=
"@color/white"
android:textSize=
"18sp"
/>
...
...
app/src/main/res/layout/fragment_home.xml
View file @
72c45791
...
...
@@ -24,7 +24,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"
4
0dp"
android:layout_marginTop=
"
5
0dp"
android:layout_marginBottom=
"10dp"
android:text=
"流量补贴"
android:textColor=
"@color/white"
...
...
app/src/main/res/layout/view_wifi.xml
View file @
72c45791
...
...
@@ -53,7 +53,7 @@
android:layout_marginTop=
"5dp"
android:text=
"每5分钟可领取一次补贴金币"
android:textColor=
"@color/white"
android:textSize=
"1
2
sp"
/>
android:textSize=
"1
4
sp"
/>
</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