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
0b3c1526
Commit
0b3c1526
authored
Jul 14, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新应用外信息流展示,添加应用外弹窗权限
parent
030e7d21
Changes
48
Show whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
1406 additions
and
526 deletions
+1406
-526
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+10
-3
MintsApplication.java
app/src/main/java/com/mints/flowbox/MintsApplication.java
+101
-49
AppOutGroMoreCarrierExpressManager.kt
.../flowbox/ad/express/AppOutGroMoreCarrierExpressManager.kt
+6
-4
ExpressManager.kt
.../main/java/com/mints/flowbox/ad/express/ExpressManager.kt
+6
-0
AlarmManager.java
...c/main/java/com/mints/flowbox/keepalive/AlarmManager.java
+42
-16
ScreenWatch.java
...rc/main/java/com/mints/flowbox/keepalive/ScreenWatch.java
+4
-2
CsjGroMoreManager.kt
.../main/java/com/mints/flowbox/manager/CsjGroMoreManager.kt
+2
-4
UserWeight.kt
app/src/main/java/com/mints/flowbox/manager/UserWeight.kt
+30
-27
CleanActivity.kt
...main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
+13
-7
Increasespeed2Activity.kt
.../com/mints/flowbox/ui/activitys/Increasespeed2Activity.kt
+3
-3
IncreasespeedActivity.kt
...a/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
+38
-37
MainActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
+28
-17
ScanActivity.kt
.../main/java/com/mints/flowbox/ui/activitys/ScanActivity.kt
+49
-1
SpeedTestActivity.kt
.../java/com/mints/flowbox/ui/activitys/SpeedTestActivity.kt
+6
-0
OutAppActivity.kt
...ava/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
+57
-0
ApkActivity.kt
...a/com/mints/flowbox/ui/activitys/keepalive/ApkActivity.kt
+23
-3
BoostActivity.kt
...com/mints/flowbox/ui/activitys/keepalive/BoostActivity.kt
+2
-4
ScreenActivity.kt
...om/mints/flowbox/ui/activitys/keepalive/ScreenActivity.kt
+17
-49
TimingActivity.kt
...om/mints/flowbox/ui/activitys/keepalive/TimingActivity.kt
+191
-0
BonusTaskAdapter.kt
...ain/java/com/mints/flowbox/ui/adapter/BonusTaskAdapter.kt
+1
-1
GvSignAdapter.java
...main/java/com/mints/flowbox/ui/adapter/GvSignAdapter.java
+3
-0
MainWifiAdapter.kt
...main/java/com/mints/flowbox/ui/adapter/MainWifiAdapter.kt
+2
-0
BonusFragment.kt
.../main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
+5
-15
GetPacketFragment.kt
...n/java/com/mints/flowbox/ui/fragment/GetPacketFragment.kt
+2
-1
HomeFragment.kt
...c/main/java/com/mints/flowbox/ui/fragment/HomeFragment.kt
+22
-45
MyFragment.kt
...src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
+24
-24
VideoFragment.kt
.../main/java/com/mints/flowbox/ui/fragment/VideoFragment.kt
+2
-3
WifiFragment.kt
...c/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
+42
-25
WifiView.java
app/src/main/java/com/mints/flowbox/ui/widgets/WifiView.java
+6
-1
ForegroundOrBackground.java
.../java/com/mints/flowbox/utils/ForegroundOrBackground.java
+3
-0
TimeThread.java
app/src/main/java/com/mints/flowbox/utils/TimeThread.java
+2
-1
WifiUtils.java
app/src/main/java/com/mints/flowbox/utils/WifiUtils.java
+0
-1
IntentNotificationUtils.kt
.../mints/flowbox/utils/keepalive/IntentNotificationUtils.kt
+0
-0
IntentUtils.java
...n/java/com/mints/flowbox/utils/keepalive/IntentUtils.java
+77
-0
LockPermissionUtils.java
...om/mints/flowbox/utils/keepalive/LockPermissionUtils.java
+19
-68
ScreenLockerUtils.kt
...va/com/mints/flowbox/utils/keepalive/ScreenLockerUtils.kt
+282
-0
loading.gif
app/src/main/res/drawable-xhdpi/loading.gif
+0
-0
bg_gray_circle.xml
app/src/main/res/drawable/bg_gray_circle.xml
+1
-1
activity_aboutus.xml
app/src/main/res/layout/activity_aboutus.xml
+3
-4
activity_apk.xml
app/src/main/res/layout/activity_apk.xml
+53
-16
activity_award.xml
app/src/main/res/layout/activity_award.xml
+1
-0
activity_boost.xml
app/src/main/res/layout/activity_boost.xml
+18
-5
activity_screen.xml
app/src/main/res/layout/activity_screen.xml
+95
-73
activity_timing.xml
app/src/main/res/layout/activity_timing.xml
+102
-0
dialog_power.xml
app/src/main/res/layout/dialog_power.xml
+12
-15
fragment_wifi.xml
app/src/main/res/layout/fragment_wifi.xml
+1
-1
bg_right.png
app/src/main/res/mipmap-xhdpi/bg_right.png
+0
-0
ic_bouns_redbox.png
app/src/main/res/mipmap-xhdpi/ic_bouns_redbox.png
+0
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
0b3c1526
...
...
@@ -168,21 +168,28 @@
android:launchMode=
"singleInstance"
/>
<activity
android:name=
".ui.activitys.ScreenActivity"
android:name=
".ui.activitys.
keepalive.
ScreenActivity"
android:excludeFromRecents=
"true"
android:exported=
"false"
android:finishOnTaskLaunch=
"false"
android:launchMode=
"singleInstance"
android:theme=
"@style/CustomerTransparentTheme"
/>
<activity
android:name=
".ui.activitys.BoostActivity"
android:name=
".ui.activitys.
keepalive.
BoostActivity"
android:excludeFromRecents=
"true"
android:exported=
"false"
android:finishOnTaskLaunch=
"false"
android:launchMode=
"singleInstance"
android:theme=
"@style/CustomerTransparentTheme"
/>
<activity
android:name=
".ui.activitys.ApkActivity"
android:name=
".ui.activitys.keepalive.ApkActivity"
android:excludeFromRecents=
"true"
android:exported=
"false"
android:finishOnTaskLaunch=
"false"
android:launchMode=
"singleInstance"
android:theme=
"@style/CustomerTransparentTheme"
/>
<activity
android:name=
".ui.activitys.keepalive.TimingActivity"
android:excludeFromRecents=
"true"
android:exported=
"false"
android:finishOnTaskLaunch=
"false"
...
...
app/src/main/java/com/mints/flowbox/MintsApplication.java
View file @
0b3c1526
...
...
@@ -20,11 +20,9 @@ import com.mints.flowbox.ad.express.ExpressManager;
import
com.mints.flowbox.common.Constant
;
import
com.mints.flowbox.keepalive.BatteryWatch
;
import
com.mints.flowbox.keepalive.DemoEventLogger
;
import
com.mints.flowbox.keepalive.HomeKeyWatch
;
import
com.mints.flowbox.keepalive.NotificationService
;
import
com.mints.flowbox.keepalive.NotificationUtil
;
import
com.mints.flowbox.keepalive.PackageWatch
;
import
com.mints.flowbox.keepalive.PhoneWatch
;
import
com.mints.flowbox.keepalive.ServiceUtil
;
import
com.mints.flowbox.keepalive.ScreenWatch
;
import
com.mints.flowbox.keepalive.WifiStateWatch
;
...
...
@@ -33,25 +31,28 @@ import com.mints.flowbox.manager.MiitHelper;
import
com.mints.flowbox.manager.ad.OwManager
;
import
com.mints.flowbox.manager.ad.TzManager
;
import
com.mints.flowbox.manager.ad.WnManager
;
import
com.mints.flowbox.manager.ad.XmManager
;
import
com.mints.flowbox.net.LoanService
;
import
com.mints.flowbox.ui.activitys.ApkActivity
;
import
com.mints.flowbox.ui.activitys.BoostActivity
;
import
com.mints.flowbox.ui.activitys.ScreenActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.ApkActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.BoostActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.TimingActivity
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.IntentUtils
;
import
com.mints.flowbox.utils.
keepalive.
IntentUtils
;
import
com.mints.flowbox.utils.SystemUtils
;
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
;
import
com.module.legacy.oreo.RegisterJobUtils
;
import
com.orhanobut.logger.AndroidLogAdapter
;
import
com.orhanobut.logger.FormatStrategy
;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.PrettyFormatStrategy
;
import
com.tencent.bugly.crashreport.CrashReport
;
import
com.mints.flowbox.keepalive.PhoneWatch
;
import
net.DebugConfig
;
import
net.analytics.AnalyticsLogger
;
import
net.app.BaseApp
;
import
net.common.utils.InternalUtils
;
import
net.phone.PhoneBrandUtils
;
import
java.util.concurrent.Executors
;
...
...
@@ -104,8 +105,6 @@ public class MintsApplication extends BaseApp {
// TODO 加ua字段
initKeepAlive
();
// XmManager.INSTANCE.init(this);
// 三方配置
// thirdConfig();
}
...
...
@@ -125,8 +124,6 @@ public class MintsApplication extends BaseApp {
if
(
BuildConfig
.
DEBUG
)
Log
.
w
(
TAG
,
"init: umeng init"
);
System
.
out
.
println
(
"mints ------------> umengConfig <------------"
);
// UmengHelper.init(this, channel);
com
.
mints
.
flowbox
.
manager
.
UmengManager
.
INSTANCE
.
preInit
();
}
...
...
@@ -138,7 +135,6 @@ public class MintsApplication extends BaseApp {
Log
.
w
(
"ActivityThread"
,
"handleWindowVisibility: no activity for token android.os.BinderProxy@908533a "
+
channel
);
// TODO 这里初始化 bugly,必须在umeng之后,千万别反了。 如果bugly崩溃上传有问题,请使用我提供的umeng模块
// BuglyHelper.init(getApplicationContext(), channel);
CrashReport
.
initCrashReport
(
getApplicationContext
(),
"c9c6be5f3a"
,
BuildConfig
.
DEBUG
);
...
...
@@ -200,7 +196,7 @@ public class MintsApplication extends BaseApp {
WifiStateWatch
.
getInstance
(
this
).
begin
(
new
WifiStateWatch
.
WifiStateListener
()
{
@Override
public
void
onWifiOpen
()
{
ToastUtils
.
show
(
"--> 开启wifi <--"
);
//
ToastUtils.show("--> 开启wifi <--");
// 应用在前台,则不展示
if
(
ForegroundOrBackground
.
isForeground2
())
{
...
...
@@ -213,13 +209,13 @@ public class MintsApplication extends BaseApp {
@Override
public
void
onWifiClose
()
{
ToastUtils
.
show
(
"--> 关闭wifi <--"
);
//
ToastUtils.show("--> 关闭wifi <--");
// 应用在前台,则不展示
if
(
ForegroundOrBackground
.
isForeground2
())
{
return
;
}
// if (WifiDataManager.INSTANCE.getWifiOff()) {
show
Boost
(
);
show
TimingActivity
(
TimingActivity
.
TIMING_TYPE_SPEED_TEST
);
// }
}
});
...
...
@@ -228,56 +224,99 @@ public class MintsApplication extends BaseApp {
ScreenWatch
.
getInstance
(
this
).
begin
(
new
ScreenWatch
.
ScreenStateListener
()
{
@Override
public
void
onScreenOn
()
{
ToastUtils
.
show
(
"--> 亮屏 <--"
);
// ToastUtils.show("--> 亮屏 <--");
// if (ForegroundOrBackground.isForeground2() & !ScreenLockerUtils.INSTANCE.isOV()) {
// return;
// }
//
// LogUtil.d("亮屏");
//
// showScreen();
}
@Override
public
void
onScreenOff
()
{
ToastUtils
.
show
(
"--> 息屏 <--"
);
//
ToastUtils.show("--> 息屏 <--");
// 检测是否在前台及是否是oppo或vivo
if
(
ForegroundOrBackground
.
isForeground2
())
{
return
;
}
// if (WifiDataManager.INSTANCE.getLockOn()) {
showScreen
();
// }
if
(
PhoneBrandUtils
.
isOppo
()
&
!
ScreenLockerUtils
.
INSTANCE
.
isOppoScreenLockOpen
(
MintsApplication
.
getContext
()))
{
return
;
}
});
// 监听实体键状态
HomeKeyWatch
.
getInstance
(
this
).
begin
(
new
HomeKeyWatch
.
HomeKeyStateListener
()
{
@Override
public
void
onHOME_KEY
()
{
ToastUtils
.
show
(
"--> 点击HOME键 <--"
);
if
(
PhoneBrandUtils
.
isVivo
()
&
!
ScreenLockerUtils
.
INSTANCE
.
isVivoScreenLockOpen
(
MintsApplication
.
getContext
()))
{
return
;
}
if
(
ForegroundOrBackground
.
isForeground2
())
{
// 检测屏幕是否亮起
if
(!
ScreenLockerUtils
.
INSTANCE
.
canShowScreenLocker
(
MintsApplication
.
getContext
()))
{
return
;
}
// if (WifiDataManager.INSTANCE.getHomeKey()) {
showBoost
();
// }
showScreen
();
}
@Override
public
void
on
RECENT_APPS
()
{
ToastUtils
.
show
(
"--> 最近任务列表
<--"
);
public
void
on
UserPresent
()
{
// ToastUtils.show("--> 解锁屏幕
<--");
if
(
ForegroundOrBackground
.
isForeground2
())
{
if
(
ForegroundOrBackground
.
isForeground2
()
&
!
ScreenLockerUtils
.
INSTANCE
.
isOV
())
{
return
;
}
if
(
PhoneBrandUtils
.
isOppo
()
&
ScreenLockerUtils
.
INSTANCE
.
isOppoScreenLockOpen
(
MintsApplication
.
getContext
()))
{
return
;
}
// if (WifiDataManager.INSTANCE.getApplistKey()) {
showBoost
();
// }
if
(
PhoneBrandUtils
.
isVivo
()
&
ScreenLockerUtils
.
INSTANCE
.
isVivoScreenLockOpen
(
MintsApplication
.
getContext
()))
{
return
;
}
showScreen
();
}
});
// 监听实体键状态
// HomeKeyWatch.getInstance(this).begin(new HomeKeyWatch.HomeKeyStateListener() {
// @Override
// public void onHOME_KEY() {
//// ToastUtils.show("--> 点击HOME键 <--");
//
// if (ForegroundOrBackground.isForeground2()) {
// return;
// }
//// if (WifiDataManager.INSTANCE.getHomeKey()) {
// showBoost();
//// }
//
// }
//
// @Override
// public void onRECENT_APPS() {
//// ToastUtils.show("--> 最近任务列表 <--");
//
// if (ForegroundOrBackground.isForeground2()) {
// return;
// }
//// if (WifiDataManager.INSTANCE.getApplistKey()) {
// showBoost();
//// }
//
// }
// });
// 监听电话状态
PhoneWatch
.
getInstance
(
this
).
begin
(
new
PhoneWatch
.
PhoneStateListener
()
{
@Override
public
void
onIdle
()
{
ToastUtils
.
show
(
"--> 电话挂断 <--"
);
//
ToastUtils.show("--> 电话挂断 <--");
}
});
...
...
@@ -285,20 +324,19 @@ public class MintsApplication extends BaseApp {
BatteryWatch
.
getInstance
(
this
).
begin
(
new
BatteryWatch
.
BatteryStateListener
()
{
@Override
public
void
onCharging
()
{
ToastUtils
.
show
(
"--> 正在充电 <--"
);
//
ToastUtils.show("--> 正在充电 <--");
if
(
ForegroundOrBackground
.
isForeground2
())
{
return
;
}
// if (WifiDataManager.INSTANCE.getBatteryOn()) {
show
Boost
();
show
Screen
();
// }
}
@Override
public
void
onUnCharging
()
{
ToastUtils
.
show
(
"--> 停止充电 <--"
);
//
ToastUtils.show("--> 停止充电 <--");
if
(
ForegroundOrBackground
.
isForeground2
())
{
return
;
...
...
@@ -315,21 +353,21 @@ public class MintsApplication extends BaseApp {
public
void
onAdded
(
String
pkgName
)
{
showApk
(
0
,
pkgName
);
ToastUtils
.
show
(
"--> APK安装 <--"
);
//
ToastUtils.show("--> APK安装 <--");
}
@Override
public
void
onReplaced
(
String
pkgName
)
{
showApk
(
1
,
pkgName
);
ToastUtils
.
show
(
"--> APK卸载 <--"
);
//
ToastUtils.show("--> APK卸载 <--");
}
@Override
public
void
onRemoved
(
String
pkgName
)
{
showApk
(
2
,
pkgName
);
ToastUtils
.
show
(
"--> APK移除 <--"
);
//
ToastUtils.show("--> APK移除 <--");
}
});
}
...
...
@@ -338,6 +376,19 @@ public class MintsApplication extends BaseApp {
KeepAliveHelper
.
Companion
.
postInit
(
this
);
}
/**
* 展示定时页面
*/
private
void
showTimingActivity
(
int
currentType
)
{
// 预加载信息流
ExpressManager
.
INSTANCE
.
loadAppOutExpress
();
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
TimingActivity
.
class
);
intent
.
putExtra
(
TimingActivity
.
TIMING_TYPE
,
currentType
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
}
/**
* 展示apk管理页面
*
...
...
@@ -353,7 +404,7 @@ public class MintsApplication extends BaseApp {
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
ApkActivity
.
class
);
intent
.
putExtra
(
ApkActivity
.
APK_STATE
,
state
);
intent
.
putExtra
(
ApkActivity
.
APK_PKG_NAME
,
pkgName
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
}
...
...
@@ -365,7 +416,7 @@ public class MintsApplication extends BaseApp {
ExpressManager
.
INSTANCE
.
loadAppOutExpress
();
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
BoostActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
}
...
...
@@ -377,7 +428,7 @@ public class MintsApplication extends BaseApp {
ExpressManager
.
INSTANCE
.
loadAppOutExpress
();
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
ScreenActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
}
...
...
@@ -405,7 +456,8 @@ public class MintsApplication extends BaseApp {
System
.
out
.
println
(
"mints ------------> MainProgress <------------"
);
XmManager
.
INSTANCE
.
init
(
this
);
// TODO 喜马拉雅初始化须放在最前面,否则听不到声音,暂时注掉
// XmManager.INSTANCE.init(this);
// 天卓珊瑚
TzManager
.
INSTANCE
.
initTz
(
this
);
...
...
app/src/main/java/com/mints/flowbox/ad/express/AppOutGroMoreCarrierExpressManager.kt
View file @
0b3c1526
...
...
@@ -24,7 +24,7 @@ import com.mints.flowbox.utils.VideoOptionUtil
import
java.util.ArrayList
import
java.util.HashMap
private
val
TAG
=
GroMoreCarrierExpressManager
::
class
.
java
.
simpleName
private
val
TAG
=
AppOut
GroMoreCarrierExpressManager
::
class
.
java
.
simpleName
class
AppOutGroMoreCarrierExpressManager
:
TTSettingConfigCallback
{
...
...
@@ -69,7 +69,10 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
private
fun
loadAd
()
{
mTTAdNative
=
TTUnifiedNativeAd
(
MintsApplication
.
getContext
(),
CsjGroMoreManager
.
APP_OUT_AD_UNIT_EXPRESS_ID
)
TTUnifiedNativeAd
(
MintsApplication
.
getContext
(),
CsjGroMoreManager
.
APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
)
//视频声音控制设置
var
videoOption
:
TTVideoOption
=
VideoOptionUtil
.
getTTVideoOption
()
...
...
@@ -86,7 +89,6 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
.
setRequestMultipleImages
(
true
).
isReturnUrlsForImageAssets
=
true
//设置为true,SDK会仅提供Uri字段的值,允许自行决定是否下载实际图片,同时不会提供Drawable字段的值
// 针对Gdt Native自渲染广告,可以自定义gdt logo的布局参数。该参数可选,非必须。
val
gdtNativeAdLogUtiloParams
=
FrameLayout
.
LayoutParams
(
BubbleUtils
.
dp2px
(
40
),
...
...
@@ -150,7 +152,7 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
vo
[
"ecpm"
]
=
ttNativeAd
.
preEcpm
vo
[
"adSource"
]
=
ttNativeAd
.
adNetworkPlatformId
vo
[
"adType"
]
=
Constant
.
GRO_MORE_ADTYPE1
vo
[
"adid"
]
=
CsjGroMoreManager
.
APP_OUT_AD_UNIT_EXPRESS_ID
vo
[
"adid"
]
=
CsjGroMoreManager
.
APP_OUT_AD_UNIT_
LOCK_
EXPRESS_ID
TrackManager
.
getInstance
().
cmtGroMoreInfo
(
vo
)
}
}
...
...
app/src/main/java/com/mints/flowbox/ad/express/ExpressManager.kt
View file @
0b3c1526
...
...
@@ -8,6 +8,9 @@ import com.mints.flowbox.common.AppConfig
*/
object
ExpressManager
{
/**
* @param isMain 是否是网赚信息流
*/
fun
loadExpress
(
isMain
:
Boolean
)
{
if
(
AppConfig
.
groMoreVideoAdCount
>
0
)
{
GroMoreCarrierExpressManager
.
instance
.
loadADFrameLayout
(
isMain
)
...
...
@@ -18,6 +21,7 @@ object ExpressManager {
}
}
/** 加载应用外信息流 */
fun
loadAppOutExpress
()
{
if
(
AppConfig
.
groMoreVideoAdCount
>
0
)
{
AppOutGroMoreCarrierExpressManager
.
instance
.
loadADFrameLayout
()
...
...
@@ -28,6 +32,7 @@ object ExpressManager {
// }
}
/** 获取应用内信息流 */
fun
getExpressFrameLayout
():
FrameLayout
?
{
if
(
AppConfig
.
groMoreVideoAdCount
>
0
)
{
return
GroMoreCarrierExpressManager
.
instance
.
getADFrameLayout
()
...
...
@@ -37,6 +42,7 @@ object ExpressManager {
}
}
/** 获取应用外信息流 */
fun
getAppOutExpressFrameLayout
():
FrameLayout
?
{
if
(
AppConfig
.
groMoreVideoAdCount
>
0
)
{
return
AppOutGroMoreCarrierExpressManager
.
instance
.
getADFrameLayout
()
...
...
app/src/main/java/com/mints/flowbox/keepalive/AlarmManager.java
View file @
0b3c1526
...
...
@@ -9,9 +9,11 @@ import com.mints.flowbox.MintsApplication;
import
com.mints.flowbox.ad.express.ExpressManager
;
import
com.mints.flowbox.common.AppConfig
;
import
com.mints.flowbox.manager.TrackManager
;
import
com.mints.flowbox.ui.activitys.BoostActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.BoostActivity
;
import
com.mints.flowbox.ui.activitys.keepalive.TimingActivity
;
import
com.mints.flowbox.utils.ForegroundOrBackground
;
import
com.mints.flowbox.utils.IntentUtils
;
import
com.mints.flowbox.utils.LogUtil
;
import
com.mints.flowbox.utils.keepalive.IntentUtils
;
/**
* 描述:应用外广告定时器
...
...
@@ -24,7 +26,7 @@ public class AlarmManager implements WeakHandler.IHandler {
public
static
final
int
WIFI_MINTER
=
3
;
//单位-分钟,wifi页重置
public
static
final
int
USER_ACTIVE_MINTER
=
10
;
//单位-分钟,用户激活接口
public
static
final
int
APP_OUT_CLEAR_MINTER
=
1
0
;
//单位-分钟,应用外清理
public
static
final
int
APP_OUT_CLEAR_MINTER
=
1
;
//单位-分钟,应用外清理
public
static
final
long
ONE_MINTER_Interval
=
60
*
1000
;
//60秒
public
static
final
long
TEN_SECOND_Interval
=
10
*
1000
;
//10秒
...
...
@@ -33,6 +35,9 @@ public class AlarmManager implements WeakHandler.IHandler {
private
volatile
int
curTime
=
1
;
//每分钟变一次
public
volatile
int
userTime
=
1
;
//应用外用户操作时间
// 定时展示页面的类型
public
volatile
int
currentType
=
0
;
private
WeakHandler
mHandler
;
public
static
AlarmManager
getInstance
()
{
...
...
@@ -69,6 +74,8 @@ public class AlarmManager implements WeakHandler.IHandler {
// 防止userTime超出Integer范围
if
(
userTime
<
20
)
userTime
++;
LogUtil
.
d
(
"AAAAAAAAAA"
);
// 固定时间增长
exeActionForTime
(
curTime
);
// 用户操作按时间增长
...
...
@@ -90,19 +97,20 @@ public class AlarmManager implements WeakHandler.IHandler {
// 应用在前台时,不弹出应用外广告
if
(
ForegroundOrBackground
.
isForeground2
())
{
this
.
resetUserActionTime
();
return
;
}
// 预加载信息流
ExpressManager
.
INSTANCE
.
loadAppOutExpress
();
//用户关闭界面后10分钟调用
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
BoostActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
Bundle
bundle
=
new
Bundle
();
bundle
.
putBoolean
(
BoostActivity
.
IS_FROM_ALARM
,
true
);
intent
.
putExtras
(
bundle
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
this
.
resetUserActionTime
();
showTimingActivity
();
// // 预加载信息流
// ExpressManager.INSTANCE.loadAppOutExpress();
// //用户关闭界面后10分钟调用
// Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
// Bundle bundle = new Bundle();
// bundle.putBoolean(BoostActivity.IS_FROM_ALARM, true);
// intent.putExtras(bundle);
// IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
}
}
...
...
@@ -114,9 +122,9 @@ public class AlarmManager implements WeakHandler.IHandler {
private
void
exeActionForTime
(
int
curTime
)
{
if
(
curTime
%
WIFI_MINTER
==
0
)
{
//每3分钟 wifi界面功能重置
AppConfig
.
isCanBoost
=
true
;
AppConfig
.
isCanClean
=
true
;
AppConfig
.
isCanSaveBattery
=
true
;
//
AppConfig.isCanBoost = true;
//
AppConfig.isCanClean = true;
//
AppConfig.isCanSaveBattery = true;
AppConfig
.
fakeBoostCount
=
0
;
AppConfig
.
fakeCleanCount
=
0
;
...
...
@@ -127,6 +135,24 @@ public class AlarmManager implements WeakHandler.IHandler {
}
}
/**
* 展示定时页面
*/
private
void
showTimingActivity
()
{
// 预加载信息流
ExpressManager
.
INSTANCE
.
loadAppOutExpress
();
currentType
++;
if
(
currentType
>
2
)
{
currentType
=
0
;
}
Intent
intent
=
new
Intent
(
MintsApplication
.
getContext
(),
TimingActivity
.
class
);
intent
.
putExtra
(
TimingActivity
.
TIMING_TYPE
,
currentType
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
IntentUtils
.
startActivity
(
ForegroundOrBackground
.
getMain_activity
(),
intent
);
}
/**
* 重置用户操作时长
*/
...
...
app/src/main/java/com/mints/flowbox/keepalive/ScreenWatch.java
View file @
0b3c1526
...
...
@@ -40,6 +40,8 @@ public class ScreenWatch {
mScreenStateListener
.
onScreenOn
();
}
else
if
(
Intent
.
ACTION_SCREEN_OFF
.
equals
(
intent
.
getAction
()))
{
// 息屏
mScreenStateListener
.
onScreenOff
();
}
else
if
(
Intent
.
ACTION_USER_PRESENT
.
equals
(
intent
.
getAction
()))
{
// 解锁屏幕
mScreenStateListener
.
onScreenOff
();
}
}
}
...
...
@@ -75,8 +77,8 @@ public class ScreenWatch {
void
onScreenOn
();
void
onScreenOff
();
//
// public
void onUserPresent();
void
onUserPresent
();
}
}
app/src/main/java/com/mints/flowbox/manager/CsjGroMoreManager.kt
View file @
0b3c1526
package
com.mints.flowbox.manager
import
android.text.TextUtils
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.manager.ad.TTGroMoreAdManagerHolder
import
com.mints.flowbox.mvp.model.GroAdcodeBean
/**
* 穿山甲GroMore
*/
...
...
@@ -25,12 +23,12 @@ object CsjGroMoreManager {
* 应用外:
* 普通:
* 新插屏 -> 946333773
* 信息流 -> 94633992
* 信息流 -> 94633
3
992
* 锁屏:
* 信息流 -> 946334023
*/
var
APP_OUT_AD_UNIT_EXPRESS_ID
=
"94633992"
// 应用外普通信息流
var
APP_OUT_AD_UNIT_EXPRESS_ID
=
"94633
3
992"
// 应用外普通信息流
var
APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
=
"946334023"
// 应用外锁屏信息流
var
APP_OUT_AD_UNIT_INTERSTITIAL_ID
=
"946333773"
// 应用外插屏
...
...
app/src/main/java/com/mints/flowbox/manager/UserWeight.kt
View file @
0b3c1526
...
...
@@ -26,7 +26,8 @@ object UserWeight {
groMoreCount
=
data
.
vedioRules
.
gromorE_VEDIO
.
surplus
}
videoAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
videoAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
0
,
...
...
@@ -37,7 +38,8 @@ object UserWeight {
data
.
vedioRules
.
oW_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} "
+
...
...
@@ -57,7 +59,8 @@ object UserWeight {
AppConfig
.
owVideoAdCount
=
data
.
vedioRules
.
oW_VEDIO
.
surplus
AppConfig
.
csjFullVedioAdCount
=
data
.
vedioRules
.
csjfulL_VEDIO
.
surplus
AppConfig
.
groMoreVideoAdCount
=
groMoreCount
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"csjFullCount:${AppConfig.csjFullVedioAdCount} "
+
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/CleanActivity.kt
View file @
0b3c1526
...
...
@@ -254,7 +254,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
if
(
taskType
==
0
)
{
AppConfig
.
isCanClean
=
false
// cleaningOperation(mContext)
}
...
...
@@ -279,16 +278,23 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
private
fun
toResult
()
{
AppConfig
.
isCanClean
=
false
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
val
bundle
=
Bundle
()
if
(
scanMax
==
1
)
{
// AppConfig.isCanBoost = false
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_BOOST
)
}
else
{
// AppConfig.isCanClean = false
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_CLEAN
)
}
readyGoThenKill
(
IncreasespeedActivity
::
class
.
java
,
bundle
)
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/Increasespeed2Activity.kt
View file @
0b3c1526
...
...
@@ -49,7 +49,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
private
val
mStringArr1
=
mutableListOf
(
"检测结果WiFi加密安全性"
,
"检查ARP网络攻击异常"
,
"提升DNS劫持安
STEP_Interval
全性"
,
"提升DNS劫持安全性"
,
"部署网页防篡改"
,
"加固链路,避免SSL中间人攻击"
,
"检测是否钓鱼WiFi"
...
...
@@ -105,8 +105,8 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
}
else
{
containerAnim
.
setBackgroundColor
(
Color
.
parseColor
(
"#8278DC"
))
GlideUtils
.
loadImageViewGif
(
this
,
R
.
drawable
.
safe_check
,
iv_gif
)
mTimerMax
=
10
NumAnimUtil
.
startAnim
(
tv_progress
,
100f
,
((
mTimerMax
-
4
)
*
STEP_Interval
))
mTimerMax
=
9
NumAnimUtil
.
startAnim
(
tv_progress
,
100f
,
((
mTimerMax
-
6
)
*
STEP_Interval
))
}
mTimer
=
Timer
()
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/IncreasespeedActivity.kt
View file @
0b3c1526
...
...
@@ -95,31 +95,30 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
}
})
if
(
mIncreaseType
==
INCREASE_BOOST
&&
AppConfig
.
isCanBoost
)
{
//
if (mIncreaseType == INCREASE_BOOST) {
//
if (mIncreaseType == INCREASE_BOOST && AppConfig.isCanBoost) {
if
(
mIncreaseType
==
INCREASE_BOOST
)
{
startTimer
()
}
else
if
(
mIncreaseType
==
INCREASE_SAVE_ELECTRICITY
&&
AppConfig
.
isCanSaveBattery
)
{
//
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) {
//
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) {
}
else
if
(
mIncreaseType
==
INCREASE_SAVE_ELECTRICITY
)
{
startTimer
()
mTimerMax
=
11
}
else
if
(
mIncreaseType
==
INCREASE_CLEAN
&&
AppConfig
.
isCanClean
)
{
//
} else if (mIncreaseType == INCREASE_CLEAN) {
//
} else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) {
}
else
if
(
mIncreaseType
==
INCREASE_CLEAN
)
{
startTimer
()
mTimerMax
=
14
}
else
{
initView
()
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
// 动画结束后 展示插屏广告
mWifiAdManager
?.
showInterstitial
()
showFirstGive
()
},
3000
)
}
initView
()
}
private
fun
showFirstGive
()
{
// 新人福利
if
(
AppConfig
.
isShowFirstGive
)
{
// 游客首次提示1500新人奖励 且 不是分享包
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
...
...
@@ -146,7 +145,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
}
private
fun
startTimer
()
{
container
.
visibility
=
View
.
GONE
...
...
@@ -178,6 +176,8 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
runOnUiThread
{
step
++
if
(
step
==
mTimerMax
-
2
)
{
initView
()
YoYo
.
with
(
Techniques
.
FadeOut
).
duration
(
600
).
playOn
(
containerAnim
)
if
(
mIncreaseType
==
INCREASE_CLEAN
)
{
// 一键清理
...
...
@@ -224,10 +224,10 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
infoStr
=
"网速像飞一样快~"
}
INCREASE_BOOST
->
{
AppConfig
.
isCanBoost
=
false
if
(
AppConfig
.
fakeBoostCount
==
0
)
{
AppConfig
.
fakeBoostCount
=
10
+
Random
.
nextInt
(
15
)
}
// AppConfig.isCanBoost = false
headTitleStr
=
"一键加速"
titleStr
=
SpanUtils
()
.
append
(
"运行速度已提升"
)
...
...
@@ -237,6 +237,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
infoStr
=
"成功清理完成"
}
INCREASE_CLEAN
->
{
// AppConfig.isCanClean = false
headTitleStr
=
"一键清理"
titleStr
=
SpanUtils
()
.
append
(
"已经清理后台软件"
)
...
...
@@ -247,9 +248,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
}
INCREASE_SAVE_ELECTRICITY
->
{
AppConfig
.
isCanSaveBattery
=
false
if
(
AppConfig
.
fakeBoost
Count
==
0
)
{
// if (AppConfig.fakeSaveBattery
Count == 0) {
AppConfig
.
fakeSaveBatteryCount
=
20
+
Random
.
nextInt
(
40
)
}
//
}
headTitleStr
=
"超强省电"
titleStr
=
SpanUtils
()
.
append
(
"延长待机时间"
)
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/MainActivity.kt
View file @
0b3c1526
...
...
@@ -11,6 +11,7 @@ import androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
com.mints.flowbox.MintsApplication
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.express.PreLoadExpressManager
import
com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.flowbox.ad.video.VideoAdingManager
...
...
@@ -27,8 +28,9 @@ 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.utils.Common
Utils
import
com.mints.
flowbox.utils.keepalive.ScreenLocker
Utils
import
com.mints.library.utils.GlideUtils
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -55,8 +57,16 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
// 奖励页预加载 信息流广告
ExpressManager
.
loadExpress
(
true
)
PreLoadExpressManager
.
loadADFrameLayout
()
mainPresenter
.
attachView
(
this
)
LogUtil
.
d
(
"是否有系统锁屏 -> "
+
ScreenLockerUtils
.
hasSystemLockScreen
(
this
))
LogUtil
.
d
(
"是否是OV -> "
+
ScreenLockerUtils
.
isOV
())
LogUtil
.
d
(
"canShowScreenLocker -> "
+
ScreenLockerUtils
.
canShowScreenLocker
(
this
))
if
(
threeFragment
==
null
)
{
threeFragment
=
WifiFragment
()
}
...
...
@@ -144,17 +154,17 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
}
fun
selectVideo
()
{
twoFragment
?.
let
{
(
it
as
MoneyFragment
).
selectVideo
()
}
}
//
fun selectVideo() {
//
twoFragment?.let {
//
(it as MoneyFragment).selectVideo()
//
}
//
}
fun
selectXmly
()
{
twoFragment
?.
let
{
(
it
as
MoneyFragment
).
selectXmly
()
}
}
//
fun selectXmly() {
//
twoFragment?.let {
//
(it as MoneyFragment).selectXmly()
//
}
//
}
fun
turnDayTask
()
{
clickTab4Layout
()
...
...
@@ -190,7 +200,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
fun
clickTab2Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_TWO
if
(
twoFragment
==
null
)
{
twoFragment
=
Money
Fragment
()
twoFragment
=
Video
Fragment
()
}
addOrShowFragment
(
supportFragmentManager
,
twoFragment
!!
,
Constant
.
FRAGMENT_TAG_TWO
)
tab_iv_one
.
isSelected
=
false
...
...
@@ -398,7 +408,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// token失效之后刷新数据
when
(
mRefreshType
)
{
Constant
.
FRAGMENT_CLICK_ONE
->
(
oneFragment
as
HomeFragment
).
refreshData
()
Constant
.
FRAGMENT_CLICK_TWO
->
(
twoFragment
as
MoneyFragment
).
refreshData
()
Constant
.
FRAGMENT_CLICK_TWO
->
{
}
Constant
.
FRAGMENT_CLICK_THREE
->
{
}
Constant
.
FRAGMENT_CLICK_FOUR
->
{
...
...
@@ -442,10 +453,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 是否上报点击广告
AppConfig
.
needReportClickAdEvent
=
data
.
isNeedReportClickAdEvent
if
(
data
.
userMsg
.
firstGiveCoin
>
0
)
{
AppConfig
.
isShowFirstGive
=
true
AppConfig
.
firstGiveCoin
=
data
.
userMsg
.
firstGiveCoin
}
//
if (data.userMsg.firstGiveCoin > 0) {
//
AppConfig.isShowFirstGive = true
//
AppConfig.firstGiveCoin = data.userMsg.firstGiveCoin
//
}
// 离线收益
if
(
data
.
offlineBean
.
offlineIncome
>
0
)
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/ScanActivity.kt
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.graphics.ImageFormat
import
android.text.TextUtils
import
android.util.Size
...
...
@@ -13,10 +14,13 @@ import com.google.common.util.concurrent.ListenableFuture
import
com.google.zxing.BinaryBitmap
import
com.google.zxing.PlanarYUVLuminanceSource
import
com.google.zxing.common.HybridBinarizer
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.ui.widgets.dialog.DialogListener
import
com.mints.flowbox.ui.widgets.dialog.DialogUtils
import
com.mints.flowbox.utils.DecodeCodeTools
import
com.mints.flowbox.utils.WifiUtils
import
kotlinx.android.synthetic.main.activity_scan.*
import
java.nio.ByteBuffer
import
java.util.concurrent.Executor
...
...
@@ -158,7 +162,9 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
))
)
{
mQrText
=
result
.
text
DialogUtils
.
showDialog
(
this
,
mQrText
)
autoConnectWifi
(
mQrText
)
// DialogUtils.showDialog(this, mQrText)
// TODO 只扫描一张
// mIsNextAnalysis = false;
}
...
...
@@ -173,6 +179,48 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
}
/**
* SAMPLE -> WIFI:T:WPA;S:mints_wifi;P:mints@190419;;
*
*/
private
fun
autoConnectWifi
(
wifiStr
:
String
?)
{
if
(
TextUtils
.
isEmpty
(
wifiStr
))
{
ToastUtils
.
show
(
"无效的WIFI二维码!"
)
return
}
var
ssid
=
""
var
psw
=
""
wifiStr
?.
let
{
if
(!
it
.
contains
(
"WIFI"
)
or
!
it
.
contains
(
"wifi"
))
{
ToastUtils
.
show
(
"无效的WIFI二维码!"
)
return
}
ssid
=
it
.
substring
(
it
.
indexOf
(
"S:"
)
+
2
,
it
.
indexOf
(
";"
,
it
.
indexOf
(
"S:"
)))
psw
=
it
.
substring
(
it
.
indexOf
(
"P:"
)
+
2
,
it
.
indexOf
(
";"
,
it
.
indexOf
(
"P:"
)))
}
if
(
TextUtils
.
isEmpty
(
ssid
)
or
TextUtils
.
isEmpty
(
ssid
))
{
ToastUtils
.
show
(
"无效的WIFI二维码!"
)
return
}
DialogUtils
.
showDialog
(
this
,
"WIFI名称: $ssid\nWIFI密码: $psw"
,
"提示"
,
"连接"
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
ToastUtils
.
show
(
"正在连接中..."
)
WifiUtils
.
getInstance
(
this
@ScanActivity
).
connectWifiPws
(
ssid
,
psw
)
dialog
?.
dismiss
()
}
})
}
override
fun
onClick
(
v
:
View
?)
{
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/SpeedTestActivity.kt
View file @
0b3c1526
...
...
@@ -134,10 +134,16 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
DownloadApkManager
.
instance
.
destroy
()
mTimer
?.
cancel
()
mTimer
=
null
finish
()
}
})
}
else
{
DownloadApkManager
.
instance
.
destroy
()
mTimer
?.
cancel
()
mTimer
=
null
finish
()
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/base/OutAppActivity.kt
0 → 100644
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys.base
import
android.app.KeyguardManager
import
android.content.Context
import
android.graphics.Color
import
android.os.Build
import
android.os.Bundle
import
android.util.AttributeSet
import
android.view.View
import
android.view.WindowManager
import
com.mints.flowbox.R
import
com.mints.flowbox.utils.keepalive.ScreenLockerUtils
import
com.mints.library.base.BaseSwipeBackCompatActivity
import
com.mints.library.net.netstatus.NetUtils
/**
* 应用外Activity
*/
abstract
class
OutAppActivity
:
BaseSwipeBackCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
// 设置可以显示在锁屏页面之上
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O_MR1
)
{
setShowWhenLocked
(
true
)
// 强制亮屏
// setTurnScreenOn(true)
val
keyguardManager
=
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
keyguardManager
.
requestDismissKeyguard
(
this
,
null
)
}
ScreenLockerUtils
.
updateWindowFlags
(
this
.
window
.
decorView
)
this
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DISMISS_KEYGUARD
or
WindowManager
.
LayoutParams
.
FLAG_SHOW_WHEN_LOCKED
or
WindowManager
.
LayoutParams
.
FLAG_TURN_SCREEN_ON
)
// 设置锁屏页全屏
ScreenLockerUtils
.
makeLockWindowFullScreen
(
this
,
this
.
window
.
attributes
,
true
)
super
.
onCreate
(
savedInstanceState
)
}
override
fun
onNetworkConnected
(
type
:
NetUtils
.
NetType
?)
{}
override
fun
onNetworkDisConnected
()
{}
override
fun
isApplyStatusBarTranslucency
()
=
false
override
fun
toggleOverridePendingTransition
()
=
false
override
fun
getOverridePendingTransitionMode
()
=
TransitionMode
.
FADE
override
fun
toggleIsBack2Left
()
=
false
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{}
override
fun
getLoadingTargetView
()
=
null
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/activitys/ApkActivity.kt
→
app/src/main/java/com/mints/flowbox/ui/activitys/
keepalive/
ApkActivity.kt
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys
package
com.mints.flowbox.ui.activitys
.keepalive
import
android.os.Bundle
import
android.text.TextUtils
...
...
@@ -7,14 +7,20 @@ import androidx.core.content.ContextCompat
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.keepalive.AlarmManager
import
com.mints.flowbox.ui.activitys.CleanActivity
import
com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.utils.AppUtil
import
com.mints.flowbox.utils.SpanUtils
import
com.mints.library.utils.GlideUtils
import
kotlinx.android.synthetic.main.activity_apk.*
import
kotlinx.android.synthetic.main.activity_apk.btnClean
import
kotlinx.android.synthetic.main.activity_apk.fl_ad
import
kotlinx.android.synthetic.main.activity_apk.tvInfo
import
kotlinx.android.synthetic.main.activity_boost.iv_close
import
kotlinx.android.synthetic.main.activity_timing.*
import
kotlin.random.Random
/**
...
...
@@ -62,7 +68,6 @@ class ApkActivity : BaseActivity() {
GlideUtils
.
loadImageView
(
this
,
apkInfo2
.
applicationIcon
,
ivIcon
)
tvInfo2
.
visibility
=
View
.
VISIBLE
ivIcon
.
visibility
=
View
.
VISIBLE
}
else
if
(
mApkState
==
2
)
{
// 应用卸载
tvTitle
.
text
=
"卸载残留提示"
...
...
@@ -105,11 +110,26 @@ class ApkActivity : BaseActivity() {
override
fun
onResume
()
{
super
.
onResume
()
initExpress
()
btnClean
.
postDelayed
({
rope
=
YoYo
.
with
(
Techniques
.
Tada
).
duration
(
1000
).
repeat
(
2
).
playOn
(
btnClean
)
rope
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
1000
).
repeat
(
6
).
playOn
(
btnClean
)
},
200
)
}
/**
* 初始化信息iyc
*/
private
fun
initExpress
()
{
try
{
if
(
fl_ad
!=
null
)
{
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
ExpressManager
.
getAppOutExpressFrameLayout
())
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
override
fun
onDestroy
()
{
rope
?.
stop
()
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/BoostActivity.kt
→
app/src/main/java/com/mints/flowbox/ui/activitys/
keepalive/
BoostActivity.kt
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys
package
com.mints.flowbox.ui.activitys
.keepalive
import
android.app.ActivityManager
import
android.content.Context
...
...
@@ -71,7 +71,7 @@ class BoostActivity : BaseActivity() {
try
{
if
(
fl_ad
!=
null
)
{
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
ExpressManager
.
getExpressFrameLayout
())
fl_ad
.
addView
(
ExpressManager
.
get
AppOut
ExpressFrameLayout
())
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
@@ -79,8 +79,6 @@ class BoostActivity : BaseActivity() {
}
private
fun
cleanMemory
()
{
ExpressManager
.
loadAppOutExpress
()
ccav_speed
.
startAnimation
()
Handler
(
Looper
.
getMainLooper
()).
postDelayed
(
{
...
...
app/src/main/java/com/mints/flowbox/ui/activitys/ScreenActivity.kt
→
app/src/main/java/com/mints/flowbox/ui/activitys/
keepalive/
ScreenActivity.kt
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys
package
com.mints.flowbox.ui.activitys
.keepalive
import
android.app.KeyguardManager
import
android.content.Context
import
android.app.WallpaperManager
import
android.graphics.Color
import
android.graphics.drawable.Drawable
import
android.os.*
import
android.view.View
import
android.view.WindowManager
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.ui.activitys.CleanActivity
import
com.mints.flowbox.ui.activitys.IncreasespeedActivity
import
com.mints.flowbox.ui.activitys.base.OutAppActivity
import
com.mints.flowbox.utils.TimeThread
import
com.mints.flowbox.utils.ToolUtil
import
com.mints.library.base.BaseSwipeBackCompatActivity
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_screen.*
class
ScreenActivity
:
BaseSwipeBackCompatActivity
(),
View
.
OnClickListener
{
var
mKeyguard
:
KeyguardManager
?
=
null
var
mKeylock
:
KeyguardManager
.
KeyguardLock
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
// 设置可以显示在锁屏页面之上
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O_MR1
)
{
setShowWhenLocked
(
true
)
// 强制亮屏
// setTurnScreenOn(true)
val
keyguardManager
=
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
keyguardManager
.
requestDismissKeyguard
(
this
,
null
)
}
this
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DISMISS_KEYGUARD
or
WindowManager
.
LayoutParams
.
FLAG_SHOW_WHEN_LOCKED
or
WindowManager
.
LayoutParams
.
FLAG_TURN_SCREEN_ON
)
super
.
onCreate
(
savedInstanceState
)
}
class
ScreenActivity
:
OutAppActivity
(),
View
.
OnClickListener
{
override
fun
initViewsAndEvents
()
{
ExpressManager
.
loadAppOutExpress
()
try
{
val
wallpaperManager
=
WallpaperManager
.
getInstance
(
this
)
val
wallpaperDrawable
:
Drawable
=
wallpaperManager
.
drawable
container
.
background
=
wallpaperDrawable
}
catch
(
e
:
java
.
lang
.
Exception
)
{
e
.
printStackTrace
()
container
.
setBackgroundColor
(
Color
.
BLACK
)
}
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
mHelper
.
swipeBackLayout
.
setEdgeSize
(
ToolUtil
.
getScreenWidth
(
this
))
...
...
@@ -68,9 +54,6 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
when
(
v
?.
id
)
{
R
.
id
.
tvBoost
->
{
val
bundle
=
Bundle
()
...
...
@@ -106,28 +89,13 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
try
{
if
(
fl_ad
!=
null
)
{
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
ExpressManager
.
getExpressFrameLayout
())
fl_ad
.
addView
(
ExpressManager
.
get
AppOut
ExpressFrameLayout
())
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
override
fun
onNetworkConnected
(
type
:
NetUtils
.
NetType
?)
{}
override
fun
onNetworkDisConnected
()
{}
override
fun
isApplyStatusBarTranslucency
()
=
false
override
fun
toggleOverridePendingTransition
()
=
false
override
fun
getOverridePendingTransitionMode
()
=
TransitionMode
.
FADE
override
fun
toggleIsBack2Left
()
=
false
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_screen
override
fun
getLoadingTargetView
()
=
null
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/activitys/keepalive/TimingActivity.kt
0 → 100644
View file @
0b3c1526
package
com.mints.flowbox.ui.activitys.keepalive
import
android.os.Bundle
import
androidx.core.content.ContextCompat
import
com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.keepalive.AlarmManager
import
com.mints.flowbox.ui.activitys.IncreasespeedActivity
import
com.mints.flowbox.ui.activitys.SpeedFastActivity
import
com.mints.flowbox.ui.activitys.SpeedTestActivity
import
com.mints.flowbox.ui.activitys.base.BaseActivity
import
com.mints.flowbox.utils.SpanUtils
import
com.mints.flowbox.utils.SystemUtils
import
kotlinx.android.synthetic.main.activity_timing.*
import
kotlinx.android.synthetic.main.activity_timing.fl_ad
import
kotlinx.android.synthetic.main.activity_timing.iv_close
import
kotlin.random.Random
/**
*
* 描述:定时或具体操作弹出的activity
*/
class
TimingActivity
:
BaseActivity
()
{
companion
object
{
const
val
TIMING_TYPE
=
"TIMING_TYPE"
const
val
TIMING_TYPE_BOOST
=
0
// 加速
const
val
TIMING_TYPE_CLEAN
=
1
// 清理
const
val
TIMING_TYPE_SAVE_ELE
=
2
// 省电
const
val
TIMING_TYPE_WIFI_BOOST
=
3
// 信号增强
const
val
TIMING_TYPE_SPEED_TEST
=
4
// 网络测速
}
/**
* 0-加速 1-清理 2-省电
* 3-wifi加速 4-网络测速
*
*/
private
var
mType
=
0
private
var
rope
:
YoYo
.
YoYoString
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_timing
override
fun
initViewsAndEvents
()
{
iv_close
.
setOnClickListener
{
finish
()
overridePendingTransition
(
0
,
0
)
}
initView
()
}
private
fun
initView
()
{
when
(
mType
)
{
TIMING_TYPE_BOOST
->
{
// 加速
val
usedPercentValue
=
SystemUtils
.
getUsedPercentValue
(
mContext
)
tvInfo
.
text
=
SpanUtils
()
.
append
(
"内存占用"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
gray
))
.
append
(
"${usedPercentValue}%"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
red
))
.
create
()
btnClean
.
text
=
"立即加速"
}
TIMING_TYPE_CLEAN
->
{
// 清理
tvInfo
.
text
=
SpanUtils
()
.
append
(
"大量文件"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
red
))
.
append
(
"待清理"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
gray
))
.
create
()
btnClean
.
text
=
"立即清理"
}
TIMING_TYPE_SAVE_ELE
->
{
// 省电
if
(
AppConfig
.
fakeSaveBatteryCount
==
0
)
{
AppConfig
.
fakeSaveBatteryCount
=
1
+
Random
.
nextInt
(
8
)
}
tvInfo
.
text
=
SpanUtils
()
.
append
(
"检测到"
)
.
append
(
"${AppConfig.fakeSaveBatteryCount}个"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
red
))
.
append
(
"应用耗电"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
gray
))
.
create
()
btnClean
.
text
=
"立即省电"
}
TIMING_TYPE_WIFI_BOOST
->
{
// 信号增强
tvInfo
.
text
=
SpanUtils
()
.
append
(
"信号增强"
)
.
create
()
btnClean
.
text
=
"信号增强"
}
TIMING_TYPE_SPEED_TEST
->
{
// 网络测速
tvInfo
.
text
=
SpanUtils
()
.
append
(
"网络测速"
)
.
create
()
btnClean
.
text
=
"网络测速"
}
}
btnClean
.
setOnClickListener
{
val
bundle
=
Bundle
()
when
(
mType
)
{
TIMING_TYPE_BOOST
->
{
// 加速
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_BOOST
)
}
TIMING_TYPE_CLEAN
->
{
// 清理
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_CLEAN
)
}
TIMING_TYPE_SAVE_ELE
->
{
// 省电
bundle
.
putString
(
IncreasespeedActivity
.
INCREASE_TYPE
,
IncreasespeedActivity
.
INCREASE_SAVE_ELECTRICITY
)
}
TIMING_TYPE_WIFI_BOOST
->
{
// 信号增强
readyGo
(
SpeedFastActivity
::
class
.
java
)
return
@setOnClickListener
}
TIMING_TYPE_SPEED_TEST
->
{
// 省电
readyGo
(
SpeedTestActivity
::
class
.
java
)
return
@setOnClickListener
}
}
readyGoThenKill
(
IncreasespeedActivity
::
class
.
java
,
bundle
)
}
}
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
mType
=
it
.
getInt
(
TIMING_TYPE
,
0
)
}
}
/**
* 初始化信息iyc
*/
private
fun
initExpress
()
{
try
{
if
(
fl_ad
!=
null
)
{
fl_ad
.
removeAllViews
()
fl_ad
.
addView
(
ExpressManager
.
getAppOutExpressFrameLayout
())
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
override
fun
isApplyKitKatTranslucency
()
=
true
override
fun
finish
()
{
super
.
finish
()
AlarmManager
.
getInstance
().
resetUserActionTime
()
}
override
fun
onResume
()
{
super
.
onResume
()
initExpress
()
btnClean
.
postDelayed
({
rope
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
1000
).
repeat
(
6
).
playOn
(
btnClean
)
},
200
)
}
override
fun
onDestroy
()
{
rope
?.
stop
()
rope
=
null
super
.
onDestroy
()
}
override
fun
onBackPressed
()
{
// 屏蔽返回键
// super.onBackPressed()
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/adapter/BonusTaskAdapter.kt
View file @
0b3c1526
...
...
@@ -58,7 +58,7 @@ class BonusTaskAdapter(
holder
.
itemTaskPb
.
progress
=
taskBean
.
complete
holder
.
itemTaskPb
.
max
=
taskBean
.
need
if
(
taskBean
.
otherConfig
!=
null
){
if
(
taskBean
.
otherConfig
!=
null
)
{
}
...
...
app/src/main/java/com/mints/flowbox/ui/adapter/GvSignAdapter.java
View file @
0b3c1526
...
...
@@ -74,6 +74,9 @@ public class GvSignAdapter extends BaseAdapter {
if
(
TextUtils
.
equals
(
itemData
.
getStatus
(),
"lock"
))
{
viewHolder
.
ic_my_icon
.
setImageResource
(
R
.
mipmap
.
ic_bouns_redbox_lock
);
viewHolder
.
tv_day
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_FF2326
));
}
else
if
(
TextUtils
.
equals
(
itemData
.
getStatus
(),
"open"
))
{
viewHolder
.
ic_my_icon
.
setImageResource
(
R
.
mipmap
.
ic_bouns_redbox
);
viewHolder
.
tv_day
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
color_FF2326
));
}
else
{
viewHolder
.
ic_my_icon
.
setImageResource
(
R
.
mipmap
.
ic_bouns_redbox_normal
);
viewHolder
.
tv_day
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
gray
));
...
...
app/src/main/java/com/mints/flowbox/ui/adapter/MainWifiAdapter.kt
View file @
0b3c1526
...
...
@@ -29,6 +29,8 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
mOnItemClickListener
=
onItemClickListener
}
// fun set
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
if
(
viewType
==
FriendsInvitedAdapter
.
HOLDER_TYPE_EMPTY
)
{
val
emptyView
=
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/BonusFragment.kt
View file @
0b3c1526
...
...
@@ -127,10 +127,14 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
return
}
if
(
dataList
[
position
].
complete
>=
dataList
[
position
].
need
)
return
when
(
view
?.
id
)
{
R
.
id
.
item_task_click
->
{
when
(
dataList
[
position
].
carrierType
)
{
BonusTaskAdapter
.
CHALLENGE_VEDIO
->
{
// 看视频
if
(
dataList
[
position
].
otherConfig
!=
null
)
{
awardVedio
(
...
...
@@ -150,7 +154,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
BonusTaskAdapter
.
CHALLENGE_SHAREFRIEND
->
{
// 邀请好友
if
(
dataList
[
position
].
otherConfig
!=
null
)
{
when
(
dataList
[
position
].
otherConfig
.
status
)
{
0
,
2
->
{
...
...
@@ -162,20 +166,6 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
shareImgDialog
()
}
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
dataList
[
position
].
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CHALLENGE_SHAREFRIEND
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
dataList
[
position
].
otherConfig
.
doubleCoin
.
toString
()
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/GetPacketFragment.kt
View file @
0b3c1526
...
...
@@ -78,7 +78,8 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
// 看视频
(
requireActivity
()
as
MainActivity
).
clickTab2Layout
()
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
(
requireActivity
()
as
MainActivity
).
selectVideo
()
// (requireActivity() as MainActivity).selectVideo()
(
requireActivity
()
as
MainActivity
).
clickTab2Layout
()
},
200
)
}
R
.
id
.
btn_invite
->
{
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/HomeFragment.kt
View file @
0b3c1526
package
com.mints.flowbox.ui.fragment
import
android.Manifest
import
android.app.Dialog
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.LayoutInflater
...
...
@@ -10,7 +9,6 @@ import android.widget.AdapterView
import
android.widget.GridView
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.ad.express.PreLoadExpressManager
import
com.mints.flowbox.ad.video.VideoAdingManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
...
...
@@ -24,9 +22,8 @@ import com.mints.flowbox.ui.adapter.GvMyAdapter
import
com.mints.flowbox.ui.adapter.ViewPagerAdapter
import
com.mints.flowbox.ui.fragment.base.BaseFragment
import
com.mints.flowbox.ui.widgets.WifiView
import
com.mints.flowbox.ui.widgets.dialog.DialogListener
import
com.mints.flowbox.ui.widgets.dialog.DialogUtils
import
com.mints.flowbox.utils.WifiUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
com.rd.animation.type.AnimationType
import
com.tbruyelle.rxpermissions.RxPermissions
...
...
@@ -71,9 +68,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
/** 初始化 */
private
fun
init
()
{
// 奖励页预加载 信息流广告
PreLoadExpressManager
.
loadADFrameLayout
()
// 打开激活
uploadDeviceInfo
()
}
...
...
@@ -118,23 +112,15 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_ONE
)
{
refreshData
()
if
(
bubbleCount
==
0
)
{
wifi_view
.
wifiOnAndNoBonus
()
}
else
{
wifi_view
.
wifiOn
()
}
tvContent
.
text
=
"每天签到最高可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
tvContent
.
text
=
"连续签到可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
}
}
override
fun
onPause
()
{
super
.
onPause
()
if
(
bubbleCount
==
0
)
{
wifi_view
.
wifiOnAndNoBonus
()
}
else
{
wifi_view
.
wifiOff
()
}
}
/** 刷新数据 **/
fun
refreshData
()
{
...
...
@@ -159,20 +145,12 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_home
override
fun
onWifiOpen
()
{
if
(
bubbleCount
==
0
)
{
wifi_view
.
wifiOnAndNoBonus
()
}
else
{
wifi_view
.
wifiOn
()
}
bg_view
.
setBackgroundResource
(
R
.
mipmap
.
bg_home_enable
)
}
override
fun
onWifiClose
()
{
if
(
bubbleCount
==
0
)
{
wifi_view
.
wifiOnAndNoBonus
()
}
else
{
wifi_view
.
wifiOff
()
}
bg_view
.
setBackgroundResource
(
R
.
mipmap
.
bg_home_unenable
)
}
...
...
@@ -182,21 +160,11 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
when
(
v
?.
id
)
{
// 网络测速
R
.
id
.
btn_speed_test
->
{
if
(
wifiManager
.
isWifiEnable
)
{
readyGo
(
SpeedTestActivity
::
class
.
java
)
}
else
{
DialogUtils
.
showDialog
(
requireActivity
(),
"当前不是Wifi网络,是否还需要进行网络测速?"
,
"提示"
,
"确定"
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
}
})
if
(!
NetUtils
.
isNetworkConnected
(
context
))
{
showToast
(
"网络异常,请检测网络"
)
return
}
readyGo
(
SpeedTestActivity
::
class
.
java
)
}
// 内存清理
R
.
id
.
btn_clean
->
{
...
...
@@ -206,12 +174,17 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
if
(
granted
)
{
readyGo
(
CleanActivity
::
class
.
java
)
}
else
{
showMissingPermissionDialog
(
"
定位
"
)
showMissingPermissionDialog
(
"
存储
"
)
}
}
}
// 扫一扫
R
.
id
.
btn_scan
->
{
if
(!
NetUtils
.
isNetworkConnected
(
context
))
{
showToast
(
"网络异常,请检测网络"
)
return
}
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
CAMERA
)
.
subscribe
{
granted
:
Boolean
->
...
...
@@ -224,9 +197,13 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
}
// wifi提速
R
.
id
.
btn_speed_fast
->
{
if
(!
NetUtils
.
isNetworkConnected
(
context
))
{
showToast
(
"网络异常,请检测网络"
)
return
}
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
readyGo
(
SpeedFastActivity
::
class
.
java
)
}
// 跳转福利页面
...
...
@@ -261,7 +238,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override
fun
getBubbleSuc
(
count
:
Int
,
coin
:
Int
)
{
bubbleCount
=
count
bubbleCoin
=
coin
wifi_view
.
setCount
(
c
ount
)
wifi_view
.
setCount
(
bubbleC
ount
)
if
(
wifiManager
.
isWifiEnable
)
{
bg_view
.
setBackgroundResource
(
R
.
mipmap
.
bg_home_enable
)
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/MyFragment.kt
View file @
0b3c1526
...
...
@@ -377,7 +377,6 @@ class MyFragment : BaseFragment(),
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
activity
?.
let
{
it
.
clickTab2Layout
()
it
.
selectVideo
()
}
}
1
->
{
...
...
@@ -459,29 +458,29 @@ class MyFragment : BaseFragment(),
awardVedio
(
taskBean
.
otherConfig
.
coin
,
Constant
.
CARRIER_VERSUS_VIDEO
)
}
}
MainMyAdapter
.
TO_XMLY
->
{
if
(
taskBean
.
otherConfig
!=
null
)
{
when
(
taskBean
.
otherConfig
.
status
)
{
0
,
2
->
{
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
activity
?.
let
{
it
.
clickTab1Layout
()
it
.
selectXmly
()
}
}
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_XMLY_CHALLENGE
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
}
}
//
MainMyAdapter.TO_XMLY -> {
//
if (taskBean.otherConfig != null) {
//
when (taskBean.otherConfig.status) {
//
0, 2 -> {
//
val activity: MainActivity? = activity as MainActivity?
//
activity?.let {
//
it.clickTab1Layout()
//
it.selectXmly()
//
}
//
}
//
1 -> {
//
val bundle = Bundle()
//
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
//
bundle.putString(
//
Constant.MAIN_CARRIER_TYPE,
//
Constant.CARRIER_XMLY_CHALLENGE
//
)
//
readyGo(AwardActivity::class.java, bundle)
//
}
//
}
//
}
//
//
}
MainMyAdapter
.
TO_DOWNLOADS
->
{
if
(
taskBean
.
otherConfig
!=
null
)
{
when
(
taskBean
.
otherConfig
.
status
)
{
...
...
@@ -698,6 +697,7 @@ class MyFragment : BaseFragment(),
}
private
fun
initManager
()
{
BannerManager
.
instance
.
init
()
videoAdingManager
=
VideoAdingManager
.
getInstance
(
activity
)
}
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/VideoFragment.kt
View file @
0b3c1526
...
...
@@ -33,7 +33,6 @@ import com.yilan.sdk.ui.little.YLLittleVideoFragment
import
com.yilan.sdk.ylad.YLAdListener
import
kotlinx.android.synthetic.main.layout_red_bag.*
import
kotlinx.android.synthetic.main.layout_red_box.*
import
net.grandcentrix.tray.AppPreferences
private
val
TAG
=
VideoFragment
::
class
.
java
.
simpleName
...
...
@@ -301,14 +300,14 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
,
LinearLayout
.
LayoutParams
.
WRAP_CONTENT
)
params
.
setMargins
(
0
,
0
,
0
,
BubbleUtils
.
dp2px
(
41
0
))
params
.
setMargins
(
0
,
0
,
0
,
BubbleUtils
.
dp2px
(
28
0
))
cdvvYilanTime
.
layoutParams
=
params
val
paramsRedBox
=
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
4
0
),
BubbleUtils
.
dp2px
(
10
),
0
)
paramsRedBox
.
setMargins
(
0
,
BubbleUtils
.
dp2px
(
12
0
),
BubbleUtils
.
dp2px
(
10
),
0
)
paramsRedBox
.
gravity
=
Gravity
.
END
rl_fragment_main_redbox
.
layoutParams
=
paramsRedBox
cdvvYilanTime
.
setOnClickListener
(
this
)
...
...
app/src/main/java/com/mints/flowbox/ui/fragment/WifiFragment.kt
View file @
0b3c1526
...
...
@@ -20,11 +20,9 @@ import com.daimajia.androidanimations.library.Techniques
import
com.daimajia.androidanimations.library.YoYo
import
com.hjq.toast.ToastUtils
import
com.mints.flowbox.R
import
com.mints.flowbox.ad.banner.BannerManager
import
com.mints.flowbox.ad.express.ExpressManager
import
com.mints.flowbox.common.AppConfig
import
com.mints.flowbox.common.Constant
import
com.mints.flowbox.manager.TtCsjAdManager
import
com.mints.flowbox.manager.UserManager
import
com.mints.flowbox.manager.wifi.WifiStateManager
import
com.mints.flowbox.mvp.model.WifiListBean
...
...
@@ -37,6 +35,7 @@ import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import
com.mints.flowbox.ui.widgets.dialog.WifiConnectDialog
import
com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import
com.mints.flowbox.utils.*
import
com.mints.flowbox.utils.keepalive.IntentUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
com.tbruyelle.rxpermissions.RxPermissions
...
...
@@ -79,6 +78,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_THREE
)
{
// 校验是否开启定位信息开关
if
(
PermissionUtils
.
isOpenGps
(
requireContext
()))
{
loadWifiData
()
}
else
{
...
...
@@ -86,8 +87,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
// 防止banner刷新太快
if
(
AntiShake
.
check
(
fl_wifi_banner
?.
id
))
return
BannerManager
.
instance
.
getTtBanner
(
TtCsjAdManager
.
TT_AD_BANNER_MY
,
fl_wifi_banner
)
//
if (AntiShake.check(fl_wifi_banner?.id)) return
//
BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_wifi_banner)
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
))
{
(
requireActivity
()
as
MainActivity
).
refreshHall
()
...
...
@@ -98,7 +99,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
override
fun
initViewsAndEvents
()
{
BannerManager
.
instance
.
init
()
// Banner信息流初始化
// BannerManager.instance.init()
initRecy
()
initView
()
...
...
@@ -109,7 +111,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
@SuppressLint
(
"SetTextI18n"
)
private
fun
loadWifiData
()
{
btn_signal
.
postDelayed
({
rope
=
YoYo
.
with
(
Techniques
.
Tada
).
duration
(
1000
).
repeat
(-
1
).
playOn
(
btn_signal
)
rope
=
YoYo
.
with
(
Techniques
.
Pulse
).
duration
(
1000
).
repeat
(-
1
).
playOn
(
btn_signal
)
},
200
)
if
(
wifiUtils
.
isWifiEnable
)
{
...
...
@@ -240,7 +242,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
if
(
AppConfig
.
isCanSaveBattery
)
{
if
(
AppConfig
.
fakeSaveBatteryCount
==
0
)
{
AppConfig
.
fakeSaveBatteryCount
=
1
+
Random
.
nextInt
(
8
)
}
tv_save_battery
.
text
=
SpanUtils
()
.
append
(
"超强省电\n"
)
.
append
(
"${AppConfig.fakeSaveBatteryCount}个"
)
...
...
@@ -253,7 +257,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
else
{
tv_save_battery
.
text
=
SpanUtils
()
.
append
(
"超强省电\n"
)
.
append
(
"延长
时间
"
)
.
append
(
"延长
待机
"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
gray
))
.
setFontSize
(
BubbleUtils
.
sp2px
(
10
))
.
append
(
"${AppConfig.fakeSaveBatteryCount}分钟"
)
...
...
@@ -375,6 +379,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
readyGo
(
IncreasespeedActivity
::
class
.
java
)
}
R
.
id
.
tv_clean
->
{
// 一键清理
RxPermissions
(
requireActivity
())
.
request
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// 预加载信息流
ExpressManager
.
loadExpress
(
false
)
...
...
@@ -384,6 +392,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
IncreasespeedActivity
.
INCREASE_CLEAN
)
readyGo
(
IncreasespeedActivity
::
class
.
java
,
bundle
)
}
else
{
showMissingPermissionDialog
(
"存储"
)
}
}
}
R
.
id
.
tv_save_battery
->
{
// 超强省电
// 预加载信息流
...
...
@@ -397,10 +409,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
readyGo
(
IncreasespeedActivity
::
class
.
java
,
bundle
)
}
R
.
id
.
btn_signal
->
{
// 信号增强
if
(
PermissionUtils
.
check
Permission
(
mContext
,
Manifest
.
permission
.
ACCESS_
COARS
E_LOCATION
)
if
(
ActivityCompat
.
checkSelf
Permission
(
requireActivity
()
,
Manifest
.
permission
.
ACCESS_
FIN
E_LOCATION
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
checkPermission
()
return
...
...
@@ -444,11 +456,15 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
RxPermissions
(
activity
!!
)
.
request
(
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
Manifest
.
permission
.
ACCESS_BACKGROUND_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
}
else
{
RxPermissions
(
activity
!!
)
.
request
(
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
.
request
(
Manifest
.
permission
.
ACCESS_FINE_LOCATION
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
}
request
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
...
...
@@ -467,7 +483,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
},
1000
)
}
else
{
showMissingPermissionDialog
(
"位置"
)
showMissingPermissionDialog
(
"位置
,存储
"
)
}
}
}
...
...
@@ -532,12 +548,13 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
loadWifiData
()
}
/** wifi关闭 */
override
fun
onWifiClose
()
{
loadWifiData
()
}
override
fun
onDestroy
()
{
fl_wifi_banner
?.
removeAllViews
()
//
fl_wifi_banner?.removeAllViews()
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/com/mints/flowbox/ui/widgets/WifiView.java
View file @
0b3c1526
...
...
@@ -129,6 +129,11 @@ public class WifiView extends FrameLayout implements View.OnClickListener {
}
public
void
wifiOn
()
{
if
(
mCount
==
0
)
{
wifiOnAndNoBonus
();
return
;
}
progressBar
.
resumeAnim
();
setTitle
(
"WIFI已连接"
);
...
...
@@ -153,7 +158,7 @@ public class WifiView extends FrameLayout implements View.OnClickListener {
setTitle
(
"WIFI已连接"
);
tvInfo
.
setText
(
"今日流量补贴金额已达到上限"
);
progressBar
.
setComplete
(
);
progressBar
.
post
(()
->
progressBar
.
setComplete
()
);
}
public
void
wifiOff
()
{
...
...
app/src/main/java/com/mints/flowbox/utils/ForegroundOrBackground.java
View file @
0b3c1526
...
...
@@ -100,6 +100,9 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
if
(
activity
==
null
)
return
;
app_activity
=
new
WeakReference
<>(
activity
);
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
main_activity
=
new
WeakReference
<>(
activity
);
}
...
...
app/src/main/java/com/mints/flowbox/utils/TimeThread.java
View file @
0b3c1526
package
com
.
mints
.
flowbox
.
utils
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Message
;
import
android.widget.TextView
;
...
...
@@ -30,7 +31,7 @@ public class TimeThread extends Thread {
}
}
private
Handler
mHandler
=
new
Handler
()
{
private
Handler
mHandler
=
new
Handler
(
Looper
.
getMainLooper
()
)
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
...
...
app/src/main/java/com/mints/flowbox/utils/WifiUtils.java
View file @
0b3c1526
...
...
@@ -2,7 +2,6 @@ package com.mints.flowbox.utils;
import
android.app.Activity
;
import
android.content.Context
;
import
android.location.LocationManager
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.net.wifi.ScanResult
;
...
...
app/src/main/java/com/mints/flowbox/utils/IntentNotificationUtils.kt
→
app/src/main/java/com/mints/flowbox/utils/
keepalive/
IntentNotificationUtils.kt
View file @
0b3c1526
File moved
app/src/main/java/com/mints/flowbox/utils/keepalive/IntentUtils.java
0 → 100644
View file @
0b3c1526
package
com
.
mints
.
flowbox
.
utils
.
keepalive
;
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.mints.flowbox.MintsApplication
;
import
com.mints.flowbox.utils.NotificationUtils
;
import
net.phone.PhoneBrandUtils
;
import
java.util.List
;
/**
* @author jyx
* @date 2021/7/10
* @des
*/
public
class
IntentUtils
{
public
static
final
String
TAG
=
"IntentUtils"
;
public
static
void
startActivity
(
Activity
activity
,
Intent
intent
)
{
if
(
PhoneBrandUtils
.
isXiaomi
()
|
PhoneBrandUtils
.
isVivo
()
|
PhoneBrandUtils
.
isOppo
())
{
if
(!
isRunningForeground
(
activity
))
{
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
moveToFront
(
activity
);
MintsApplication
.
getContext
().
startActivity
(
intent
);
activity
.
moveTaskToBack
(
true
);
// } else {
// NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent);
// }
}
else
{
MintsApplication
.
getContext
().
startActivity
(
intent
);
}
}
else
{
MintsApplication
.
getContext
().
startActivity
(
intent
);
}
}
public
static
Boolean
isRunningForeground
(
Activity
activity
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
activity
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
1
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
activity
.
getPackageName
()))
{
return
true
;
}
}
return
false
;
}
public
static
void
moveToFront
(
Context
context
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
1
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
//遍历找到本应用的 task,并将它切换到前台
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
0
);
return
;
}
}
}
/**
* 跳转GPS设置
*/
public
static
void
openGPSSettings
(
Context
context
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_LOCATION_SOURCE_SETTINGS
);
context
.
startActivity
(
intent
);
}
}
app/src/main/java/com/mints/flowbox/utils/
Intent
Utils.java
→
app/src/main/java/com/mints/flowbox/utils/
keepalive/LockPermission
Utils.java
View file @
0b3c1526
package
com
.
mints
.
flowbox
.
utils
;
package
com
.
mints
.
flowbox
.
utils
.
keepalive
;
import
android.app.Activity
;
import
android.app.ActivityManager
;
import
android.app.AppOpsManager
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.util.Log
;
import
com.mints.flowbox.MintsApplication
;
import
java.lang.reflect.Method
;
import
java.util.List
;
/**
* @author jyx
* @date 2021/7/1
0
* @date 2021/7/1
3
* @des
*/
public
class
Intent
Utils
{
public
class
LockPermission
Utils
{
public
static
final
String
TAG
=
"
Intent
Utils"
;
public
static
final
String
TAG
=
"
LockPermission
Utils"
;
/**
* 小米后台弹出界面权限检测
...
...
@@ -35,7 +29,7 @@ public class IntentUtils {
AppOpsManager
ops
=
(
AppOpsManager
)
context
.
getSystemService
(
Context
.
APP_OPS_SERVICE
);
try
{
int
op
=
10021
;
Method
method
=
ops
.
getClass
().
getMethod
(
"checkOpNoThrow"
,
new
Class
[]{
int
.
class
,
int
.
class
,
String
.
class
}
);
Method
method
=
ops
.
getClass
().
getMethod
(
"checkOpNoThrow"
,
int
.
class
,
int
.
class
,
String
.
class
);
Integer
result
=
(
Integer
)
method
.
invoke
(
ops
,
op
,
android
.
os
.
Process
.
myUid
(),
context
.
getPackageName
());
return
result
==
AppOpsManager
.
MODE_ALLOWED
;
...
...
@@ -53,13 +47,14 @@ public class IntentUtils {
*/
public
static
boolean
canShowLockView
(
Context
context
)
{
AppOpsManager
ops
=
null
;
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
KITKAT
)
{
ops
=
(
AppOpsManager
)
context
.
getSystemService
(
Context
.
APP_OPS_SERVICE
);
}
try
{
int
op
=
10020
;
// >= 23
// ops.checkOpNoThrow(op, uid, packageName)
Method
method
=
ops
.
getClass
().
getMethod
(
"checkOpNoThrow"
,
new
Class
[]
{
int
.
class
,
int
.
class
,
String
.
class
}
);
Method
method
=
ops
.
getClass
().
getMethod
(
"checkOpNoThrow"
,
int
.
class
,
int
.
class
,
String
.
class
);
Integer
result
=
(
Integer
)
method
.
invoke
(
ops
,
op
,
android
.
os
.
Process
.
myUid
(),
context
.
getPackageName
());
return
result
==
AppOpsManager
.
MODE_ALLOWED
;
...
...
@@ -71,7 +66,7 @@ public class IntentUtils {
}
/**
* 判断vivo后台弹出界面
false未开启 true
开启
* 判断vivo后台弹出界面
1未开启 0
开启
*
* @param context
* @return
...
...
@@ -102,12 +97,12 @@ public class IntentUtils {
}
/**
* 判断vivo锁屏显示
1未开启 0开启
* 判断vivo锁屏显示
*
* @param context
* @return
*/
public
static
int
getVivoLockStatus
(
Context
context
)
{
public
static
boolean
getVivoLockStatus
(
Context
context
)
{
String
packageName
=
context
.
getPackageName
();
Uri
uri2
=
Uri
.
parse
(
"content://com.vivo.permissionmanager.provider.permission/control_locked_screen_action"
);
String
selection
=
"pkgname = ?"
;
...
...
@@ -120,67 +115,23 @@ public class IntentUtils {
if
(
cursor
.
moveToFirst
())
{
int
currentmode
=
cursor
.
getInt
(
cursor
.
getColumnIndex
(
"currentstate"
));
cursor
.
close
();
return
currentmode
;
return
currentmode
==
0
;
}
else
{
cursor
.
close
();
return
1
;
return
false
;
}
}
}
catch
(
Throwable
throwable
)
{
throwable
.
printStackTrace
();
}
return
1
;
}
public
static
void
startActivity
(
Activity
activity
,
Intent
intent
)
{
if
(
isAllowedBackPopPermission
(
activity
)
|
getvivoBgStartActivityPermissionStatus
(
activity
))
{
if
(!
isRunningForeground
(
activity
))
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
moveToFront
(
activity
);
MintsApplication
.
getContext
().
startActivity
(
intent
);
activity
.
moveTaskToBack
(
true
);
}
else
{
NotificationUtils
.
INSTANCE
.
sendNotificationFullScreen
(
activity
,
""
,
""
,
intent
);
}
}
else
{
MintsApplication
.
getContext
().
startActivity
(
intent
);
}
}
else
{
MintsApplication
.
getContext
().
startActivity
(
intent
);
}
}
public
static
Boolean
isRunningForeground
(
Activity
activity
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
activity
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
1
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
activity
.
getPackageName
()))
{
return
true
;
}
}
return
false
;
}
public
static
void
moveToFront
(
Context
context
)
{
ActivityManager
activityManager
=
(
ActivityManager
)
context
.
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
List
<
ActivityManager
.
RunningTaskInfo
>
taskInfoList
=
activityManager
.
getRunningTasks
(
20
);
for
(
ActivityManager
.
RunningTaskInfo
taskInfo
:
taskInfoList
)
{
//遍历找到本应用的 task,并将它切换到前台
if
(
taskInfo
.
baseActivity
.
getPackageName
().
equals
(
context
.
getPackageName
()))
{
activityManager
.
moveTaskToFront
(
taskInfo
.
id
,
0
);
return
;
}
}
public
static
boolean
getOppoLockStatus
(
Context
context
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
return
Settings
.
canDrawOverlays
(
context
);
}
/**
* 跳转GPS设置
*/
public
static
void
openGPSSettings
(
Context
context
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_LOCATION_SOURCE_SETTINGS
);
context
.
startActivity
(
intent
);
return
true
;
}
}
app/src/main/java/com/mints/flowbox/utils/keepalive/ScreenLockerUtils.kt
0 → 100644
View file @
0b3c1526
package
com.mints.flowbox.utils.keepalive
import
android.annotation.SuppressLint
import
android.app.KeyguardManager
import
android.content.Context
import
android.os.Build
import
android.os.PowerManager
import
android.provider.Settings
import
android.view.Gravity
import
android.view.View
import
android.view.WindowManager
import
net.DebugConfig
import
net.common.utils.CommonUtils
import
net.phone.PhoneBrandUtils
import
net.utils.Log
import
java.text.SimpleDateFormat
import
java.util.*
private
const
val
TAG
=
"screenlocker.utils"
@Suppress
(
"DEPRECATION"
)
object
ScreenLockerUtils
{
fun
canShowScreenLocker
(
context
:
Context
):
Boolean
{
try
{
val
pm
=
context
.
getSystemService
(
Context
.
POWER_SERVICE
)
as
PowerManager
val
km
=
context
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
return
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP_MR1
)
{
if
(
DebugConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"canShowScreenLocker() called with: "
+
"pm.isScreenOn = [${pm.isScreenOn}], km.isKeyguardLocked = ${km.isKeyguardLocked}"
)
!
pm
.
isScreenOn
||
km
.
isKeyguardLocked
}
else
{
if
(
DebugConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"canShowScreenLocker() called with: "
+
"pm.isScreenOn = [${pm.isScreenOn}]"
)
!
pm
.
isScreenOn
}
}
catch
(
e
:
java
.
lang
.
Exception
)
{
if
(
DebugConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"isScreenOff: ERROR"
,
e
)
}
return
false
}
fun
hasSystemLockScreen
(
context
:
Context
):
Boolean
{
return
CommonUtils
.
hasSystemLockScreen
(
context
)
}
fun
updateWindowFlags
(
decorView
:
View
)
{
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
or
View
.
SYSTEM_UI_FLAG_IMMERSIVE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
or
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_HIDE_NAVIGATION
or
View
.
SYSTEM_UI_FLAG_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LOW_PROFILE
}
fun
makeLockWindowFullScreen
(
context
:
Context
,
layoutParams
:
WindowManager
.
LayoutParams
,
addShowWhenLocked
:
Boolean
=
true
)
{
// make window full screen
layoutParams
.
flags
=
layoutParams
.
flags
or
WindowManager
.
LayoutParams
.
FLAG_FULLSCREEN
or
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_NO_LIMITS
or
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_INSET_DECOR
or
WindowManager
.
LayoutParams
.
FLAG_LAYOUT_IN_SCREEN
val
outMetrics
=
CommonUtils
.
getRealDisplayMetrics
(
context
)
layoutParams
.
width
=
outMetrics
.
widthPixels
layoutParams
.
height
=
outMetrics
.
heightPixels
layoutParams
.
x
=
0
layoutParams
.
y
=
0
layoutParams
.
gravity
=
Gravity
.
TOP
if
(
addShowWhenLocked
)
{
layoutParams
.
flags
=
layoutParams
.
flags
or
WindowManager
.
LayoutParams
.
FLAG_SHOW_WHEN_LOCKED
layoutParams
.
flags
=
layoutParams
.
flags
or
WindowManager
.
LayoutParams
.
FLAG_DISMISS_KEYGUARD
}
layoutParams
.
flags
=
layoutParams
.
flags
or
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
layoutParams
.
flags
=
layoutParams
.
flags
or
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
or
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
}
@SuppressLint
(
"ConstantLocale"
)
private
val
sHourFormat24
=
SimpleDateFormat
(
"HH:mm"
,
Locale
.
getDefault
())
@SuppressLint
(
"ConstantLocale"
)
private
val
sHourFormat12
=
SimpleDateFormat
(
"hh:mm"
,
Locale
.
getDefault
())
fun
getHourString
(
context
:
Context
,
time
:
Long
):
String
?
{
val
strTimeFormat
=
Settings
.
System
.
getString
(
context
.
contentResolver
,
Settings
.
System
.
TIME_12_24
)
if
(
"12"
==
strTimeFormat
)
{
try
{
return
sHourFormat12
.
format
(
time
)
}
catch
(
e
:
Exception
)
{
}
}
return
sHourFormat24
.
format
(
time
)
}
/**
* 如果是禁用锁屏的系统,则使用非锁屏版本
*/
fun
isLockScreenProtected
(
@Suppress
(
"UNUSED_PARAMETER"
)
context
:
Context
):
Boolean
{
return
PhoneBrandUtils
.
isLockScreenProtected
()
}
//
// fun tryStartMoveTaskToFront(context: Context, reason: Int): Boolean {
// if (DebugConfig.DEBUG) Log.d(TAG, "moveTaskToFront() called with: context = [$context]", RuntimeException())
//
// doConfuse()
//
// val lastInstance = ScreenLockerContext.lastInstance()
// if (lastInstance?.isResumed == true) {
// if (DebugConfig.DEBUG) Log.w(TAG, "moveTaskToFront: already in front. ignored")
// return true
// }
//
// if (lastInstance?.taskId == null) {
// if (DebugConfig.DEBUG) Log.w(TAG, "moveTaskToFront: no instance found. ignored!")
// return false
// }
//
// val taskId = lastInstance.taskId!!
//
//
// Observable.intervalRange(1, 3, 3, 3, TimeUnit.SECONDS)
// .subscribe(object : Observer<Long> {
// lateinit var disposable: Disposable
//
// private fun shouldMoveTask(): Boolean {
// val activityObserver = ScreenLockerContext.lastInstance()
// return when (reason) {
// ScreenLockerConstants.SHOW_REASON_SCREEN_OFF,
// ScreenLockerConstants.SHOW_REASON_RESTART_SELF,
// ScreenLockerConstants.SHOW_REASON_CALL_IDLE -> {
// activityObserver?.isResumed != true
// }
// else -> {
// activityObserver?.isResumed != true && activityObserver?.isResumedSinceLastScreenOff != true
// }
// }
// }
//
// override fun onSubscribe(d: Disposable) {
// if (DebugConfig.DEBUG) Log.d(TAG, "onSubscribe() called with: d = [$d]")
//
// disposable = d
// if (shouldMoveTask()) {
// OONotify.performMoveTaskToFront(context, taskId)
// } else {
// disposable.dispose()
// }
// }
//
// override fun onNext(t: Long) {
// if (DebugConfig.DEBUG) Log.d(TAG, "onNext() called with: t = [$t]")
//
// if (shouldMoveTask()) {
// OONotify.performMoveTaskToFront(context, taskId)
// } else {
// if (DebugConfig.DEBUG) Log.w(TAG, "onNext: further call cancelled!")
// disposable.dispose()
// }
// }
//
// override fun onComplete() {
// if (DebugConfig.DEBUG) Log.d(TAG, "onComplete() called ")
// }
//
// override fun onError(e: Throwable) {
// if (DebugConfig.DEBUG) Log.e(TAG, "onError: ERROR", e)
//
// }
//
// })
//
// return true
// }
//
// @Suppress("SimplifyBooleanWithConstants", "JoinDeclarationAndAssignment", "UNUSED_VARIABLE", "NOTHING_TO_INLINE")
// private inline fun doConfuse() {
// do {
// var o: Any? = null
//
// try {
// o = System.out
// if (o != null) {
// break
// }
// } catch (ignored: Exception) {
// } finally {
// // ignore
// }
// //noinspection LoopStatementThatDoesntLoop,PointlessBooleanExpression,ConstantConditions
// while (false && o != null) {
// break
// }
//
// var fis: FileInputStream? = null
// try {
//
// fis = FileInputStream("/proc/self/cmdline")
//
// val buffer = ByteArray(256)
//
// var len = 0
// var b: Int
// b = fis.read()
// while (b > 0 && len < buffer.size) {
// buffer[len++] = b.toByte()
// }
// if (len > 0) {
// val s = String(buffer, 0, len)
// }
// } catch (ignored: Exception) {
// } finally {
// if (fis != null) {
// try {
// fis.close()
// } catch (ignored: Exception) {
// }
//
// }
// }
// try {
// throw NoSuchFieldException()
// } catch (e: NoSuchFieldException) {
// if (DebugConfig.DEBUG) Log.e("OOService", "ERROR", e)
// }
// } while (false)
// }
fun
isOV
():
Boolean
{
return
PhoneBrandUtils
.
isOppo
()
or
PhoneBrandUtils
.
isVivo
()
}
fun
closeSystemLockView
(
context
:
Context
)
{
if
(
DebugConfig
.
DEBUG
)
Log
.
d
(
TAG
,
"closeSystemLockView() called with: context = [$context]"
,
RuntimeException
()
)
try
{
(
context
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
).
newKeyguardLock
(
"IN"
)
}
catch
(
e
:
Exception
)
{
if
(
DebugConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"closeSystemLockView: ERROR"
,
e
)
}
try
{
// 这个permission 太敏感了,拿掉了
(
context
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
).
newKeyguardLock
(
"unLock"
).
disableKeyguard
()
}
catch
(
e
:
Exception
)
{
if
(
DebugConfig
.
DEBUG
)
Log
.
e
(
TAG
,
"closeSystemLockView: ERROR"
,
e
)
}
}
fun
isOppoScreenLockOpen
(
context
:
Context
):
Boolean
{
return
LockPermissionUtils
.
getOppoLockStatus
(
context
)
}
fun
isVivoScreenLockOpen
(
context
:
Context
):
Boolean
{
return
LockPermissionUtils
.
getVivoLockStatus
(
context
)
}
}
\ No newline at end of file
app/src/main/res/drawable-xhdpi/loading.gif
0 → 100644
View file @
0b3c1526
209 KB
app/src/main/res/drawable/bg_gray_circle.xml
View file @
0b3c1526
...
...
@@ -2,7 +2,7 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:angle=
"
27
0"
android:angle=
"
9
0"
android:endColor=
"#C9C3FF"
android:startColor=
"#AFA6FF"
/>
...
...
app/src/main/res/layout/activity_aboutus.xml
View file @
0b3c1526
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
...
...
@@ -68,7 +67,7 @@
android:layout_marginRight=
"2dp"
android:padding=
"5dp"
android:text=
"@string/register_name"
android:textColor=
"@color/color_
FF9837
"
android:textColor=
"@color/color_
main
"
android:textSize=
"14sp"
/>
<View
...
...
@@ -76,7 +75,7 @@
android:layout_height=
"match_parent"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"5dp"
android:background=
"@color/color_
FF9837
"
/>
android:background=
"@color/color_
main
"
/>
<TextView
android:id=
"@+id/tvAboutasPolicy"
...
...
@@ -85,7 +84,7 @@
android:layout_marginLeft=
"2dp"
android:padding=
"5dp"
android:text=
"隐私政策"
android:textColor=
"@color/color_
FF9837
"
android:textColor=
"@color/color_
main
"
android:textSize=
"14sp"
/>
</LinearLayout>
...
...
app/src/main/res/layout/activity_apk.xml
View file @
0b3c1526
<?xml version="1.0" encoding="utf-8"?>
<
Frame
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_20000000"
>
android:background=
"@color/color_10000000"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"
300dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"120dp"
android:layout_marginEnd=
"15dp"
android:background=
"@drawable/shape_bg_write"
android:orientation=
"vertical"
android:visibility=
"visible"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:drawableStart=
"@drawable/ic_launcher_main_mini"
android:drawablePadding=
"5dp"
android:gravity=
"center_vertical"
android:padding=
"5dp"
android:text=
"@string/appName"
android:textColor=
"@color/black"
/>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"20
dp"
android:layout_height=
"20
dp"
android:layout_width=
"22
dp"
android:layout_height=
"22
dp"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end
"
android:layout_margin
=
"10dp"
android:layout_gravity=
"end|center_vertical
"
android:layout_marginEnd
=
"10dp"
android:src=
"@mipmap/ic_close"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id=
"@+id/tvTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"-20dp"
android:text=
"安装包卸载"
android:textColor=
"@color/black"
android:textSize=
"18sp"
...
...
@@ -89,7 +113,10 @@
android:id=
"@+id/btnClean"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_margin=
"15dp"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_green_light"
android:text=
"立即清理"
android:textColor=
"@color/white"
...
...
@@ -101,4 +128,14 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
\ No newline at end of file
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"360dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"15dp"
android:background=
"@drawable/shape_gold_card"
android:elevation=
"2dip"
android:gravity=
"center"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_award.xml
View file @
0b3c1526
...
...
@@ -64,6 +64,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"4dp"
android:background=
"@drawable/shape_btn_gold_left"
android:drawablePadding=
"4dp"
android:gravity=
"center"
...
...
app/src/main/res/layout/activity_boost.xml
View file @
0b3c1526
...
...
@@ -2,7 +2,7 @@
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/
transparent
"
>
android:background=
"@color/
color_10000000
"
>
<com.mints.flowbox.ui.widgets.CircleCleanAnimationView
android:id=
"@+id/ccav_speed"
...
...
@@ -15,18 +15,18 @@
android:layout_width=
"360dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/color
PrimaryDark
"
android:background=
"@color/color
_main
"
android:orientation=
"vertical"
android:visibility=
"gone"
>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"
3
0dp"
android:layout_height=
"
3
0dp"
android:layout_width=
"
2
0dp"
android:layout_height=
"
2
0dp"
android:layout_gravity=
"right"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_
activity_quit
"
/>
android:src=
"@mipmap/ic_
close
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -55,6 +55,19 @@
android:elevation=
"2dip"
android:gravity=
"center"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:layout_marginTop=
"10dp"
android:background=
"@color/color_20000000"
android:drawableStart=
"@drawable/ic_launcher_main_mini"
android:drawablePadding=
"5dp"
android:padding=
"5dp"
android:text=
"@string/appName"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
</LinearLayout>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/activity_screen.xml
View file @
0b3c1526
<?xml version="1.0" encoding="utf-8"?>
<
Relativ
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Fram
eLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/transparent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/tvTime"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"3
0dp"
android:layout_marginTop=
"5
0dp"
android:text=
"-"
android:textColor=
"@color/white"
android:textSize=
"60sp"
/>
...
...
@@ -75,20 +80,37 @@
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tvBoost"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@drawable/shape_gold_card"
android:elevation=
"2dip"
android:gravity=
"center"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
android:layout_
alignParentBottom=
"true
"
android:layout_
gravity=
"bottom
"
android:background=
"@color/color_20000000"
android:gravity=
"center"
android:text=
"
》
右滑关闭"
android:text=
"
> >
右滑关闭"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
</RelativeLayout>
\ No newline at end of file
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right|bottom"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"80dp"
android:background=
"@color/color_20000000"
android:drawableStart=
"@drawable/ic_launcher_main_mini"
android:drawablePadding=
"5dp"
android:padding=
"5dp"
android:text=
"@string/appName"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
</FrameLayout>
app/src/main/res/layout/activity_timing.xml
0 → 100644
View file @
0b3c1526
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_10000000"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"120dp"
android:layout_marginEnd=
"15dp"
android:background=
"@drawable/shape_bg_write"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:layout_marginStart=
"10dp"
android:layout_weight=
"1"
android:drawableStart=
"@drawable/ic_launcher_main_mini"
android:drawablePadding=
"6dp"
android:gravity=
"center_vertical"
android:padding=
"5dp"
android:text=
"@string/appName"
android:textColor=
"@color/black"
/>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"22dp"
android:layout_height=
"22dp"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"end|center_vertical"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_close"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_margin=
"10dp"
android:src=
"@mipmap/ic_launcher"
/>
<TextView
android:id=
"@+id/tvInfo"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
android:gravity=
"center"
android:text=
"-"
android:textColor=
"@color/black"
android:textSize=
"16sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/ivIcon"
app:layout_constraintTop_toBottomOf=
"@+id/tvTitle"
/>
<Button
android:id=
"@+id/btnClean"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/shape_green_light"
android:text=
"立即清理"
android:textColor=
"@color/white"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tvInfo2"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_margin=
"15dp"
android:background=
"@drawable/shape_gold_card"
android:elevation=
"2dip"
android:gravity=
"center"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/dialog_power.xml
View file @
0b3c1526
...
...
@@ -136,7 +136,7 @@
android:paddingRight=
"2dp"
android:paddingBottom=
"6dp"
android:text=
"@string/register_name"
android:textColor=
"@color/color_
FF9837
"
android:textColor=
"@color/color_
main
"
android:textSize=
"12sp"
/>
<TextView
...
...
@@ -157,7 +157,7 @@
android:paddingRight=
"2dp"
android:paddingBottom=
"6dp"
android:text=
"隐私政策"
android:textColor=
"@color/color_
FF9837
"
android:textColor=
"@color/color_
main
"
android:textSize=
"12sp"
/>
</LinearLayout>
...
...
@@ -175,37 +175,34 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"
horizont
al"
>
android:orientation=
"
vertic
al"
>
<TextView
android:id=
"@+id/btn_dialogper_
back
"
android:layout_width=
"
0dp
"
android:id=
"@+id/btn_dialogper_
next
"
android:layout_width=
"
match_parent
"
android:layout_height=
"36dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:background=
"@color/color_ccc"
android:background=
"@color/color_main"
android:gravity=
"center"
android:text=
"
不
同意"
android:text=
"同意"
android:textColor=
"@color/white"
/>
<TextView
android:id=
"@+id/btn_dialogper_
next
"
android:layout_width=
"
0dp
"
android:id=
"@+id/btn_dialogper_
back
"
android:layout_width=
"
match_parent
"
android:layout_height=
"36dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:background=
"@color/color_FF9837"
android:background=
"@color/color_ccc"
android:gravity=
"center"
android:text=
"同意"
android:text=
"
不
同意"
android:textColor=
"@color/white"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
app/src/main/res/layout/fragment_wifi.xml
View file @
0b3c1526
...
...
@@ -86,7 +86,7 @@
android:layout_marginTop=
"10dp"
android:text=
"WIFI未开启"
android:textColor=
"@color/black"
android:textSize=
"2
2
sp"
android:textSize=
"2
0
sp"
android:textStyle=
"bold"
app:layout_constraintStart_toEndOf=
"@+id/imageView2"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/mipmap-xhdpi/bg_right.png
View replaced file @
030e7d21
View file @
0b3c1526
2.33 KB
|
W:
|
H:
2.17 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/mipmap-xhdpi/ic_bouns_redbox.png
0 → 100644
View file @
0b3c1526
7.06 KB
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