Commit 92581452 authored by jyx's avatar jyx

更新动画效果

parent d5213374
...@@ -143,11 +143,11 @@ android { ...@@ -143,11 +143,11 @@ android {
doNotStrip "*/*/libt2.so" doNotStrip "*/*/libt2.so"
} }
// sourceSets { sourceSets {
// main { main {
// jniLibs.srcDir 'libs' jniLibs.srcDir 'libs'
// } }
// } }
// TODO 这句需要把相关函数也挪过去 // TODO 这句需要把相关函数也挪过去
project.initApplicationScript(defaultConfig, sourceSets) project.initApplicationScript(defaultConfig, sourceSets)
...@@ -268,7 +268,6 @@ dependencies { ...@@ -268,7 +268,6 @@ dependencies {
implementation(name: 'mh-adsdk', ext: 'aar') implementation(name: 'mh-adsdk', ext: 'aar')
implementation(name: 'mh-adsdk-ext', ext: 'aar') implementation(name: 'mh-adsdk-ext', ext: 'aar')
// 喜马拉雅 jar自动引入 // 喜马拉雅 jar自动引入
implementation 'com.squareup.okio:okio:1.15.0'
// 微转阅读(接入h5方式) // 微转阅读(接入h5方式)
//天卓SDK的珊瑚2.0组件 //天卓SDK的珊瑚2.0组件
implementation(name: 'adapt-1.3.3', ext: 'aar') implementation(name: 'adapt-1.3.3', ext: 'aar')
......
...@@ -304,7 +304,9 @@ ...@@ -304,7 +304,9 @@
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/ow_file_paths" /> android:resource="@xml/ow_file_paths" />
</provider> <!-- 常驻通知栏service --> </provider>
<!-- 常驻通知栏service -->
<service android:name=".keepalive.NotificationService" /> <service android:name=".keepalive.NotificationService" />
<!-- 喜马拉雅播放器 --> <!-- 喜马拉雅播放器 -->
......
...@@ -33,6 +33,7 @@ import com.mints.flowbox.manager.MiitHelper; ...@@ -33,6 +33,7 @@ import com.mints.flowbox.manager.MiitHelper;
import com.mints.flowbox.manager.ad.OwManager; import com.mints.flowbox.manager.ad.OwManager;
import com.mints.flowbox.manager.ad.TzManager; import com.mints.flowbox.manager.ad.TzManager;
import com.mints.flowbox.manager.ad.WnManager; import com.mints.flowbox.manager.ad.WnManager;
import com.mints.flowbox.manager.wifi.WifiDataManager;
import com.mints.flowbox.net.LoanService; import com.mints.flowbox.net.LoanService;
import com.mints.flowbox.ui.activitys.ApkActivity; import com.mints.flowbox.ui.activitys.ApkActivity;
import com.mints.flowbox.ui.activitys.BoostActivity; import com.mints.flowbox.ui.activitys.BoostActivity;
...@@ -198,14 +199,25 @@ public class MintsApplication extends BaseApp { ...@@ -198,14 +199,25 @@ public class MintsApplication extends BaseApp {
public void onWifiOpen() { public void onWifiOpen() {
ToastUtils.show("--> 开启wifi <--"); ToastUtils.show("--> 开启wifi <--");
showBoost(); // 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getWifiOn()) {
showBoost();
}
} }
@Override @Override
public void onWifiClose() { public void onWifiClose() {
ToastUtils.show("--> 关闭wifi <--"); ToastUtils.show("--> 关闭wifi <--");
// 应用在前台,则不展示
showBoost(); if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getWifiOff()) {
showBoost();
}
} }
}); });
...@@ -220,7 +232,12 @@ public class MintsApplication extends BaseApp { ...@@ -220,7 +232,12 @@ public class MintsApplication extends BaseApp {
public void onScreenOff() { public void onScreenOff() {
ToastUtils.show("--> 息屏 <--"); ToastUtils.show("--> 息屏 <--");
showScreen(); if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getLockOn()) {
showScreen();
}
} }
}); });
...@@ -228,16 +245,28 @@ public class MintsApplication extends BaseApp { ...@@ -228,16 +245,28 @@ public class MintsApplication extends BaseApp {
HomeKeyWatch.getInstance(this).begin(new HomeKeyWatch.HomeKeyStateListener() { HomeKeyWatch.getInstance(this).begin(new HomeKeyWatch.HomeKeyStateListener() {
@Override @Override
public void onHOME_KEY() { public void onHOME_KEY() {
showBoost();
ToastUtils.show("--> 点击HOME键 <--"); ToastUtils.show("--> 点击HOME键 <--");
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getHomeKey()) {
showBoost();
}
} }
@Override @Override
public void onRECENT_APPS() { public void onRECENT_APPS() {
showBoost();
ToastUtils.show("--> 最近任务列表 <--"); ToastUtils.show("--> 最近任务列表 <--");
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getApplistKey()) {
showBoost();
}
} }
}); });
...@@ -245,8 +274,6 @@ public class MintsApplication extends BaseApp { ...@@ -245,8 +274,6 @@ public class MintsApplication extends BaseApp {
PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() { PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() {
@Override @Override
public void onIdle() { public void onIdle() {
showBoost();
ToastUtils.show("--> 电话挂断 <--"); ToastUtils.show("--> 电话挂断 <--");
} }
}); });
...@@ -255,16 +282,27 @@ public class MintsApplication extends BaseApp { ...@@ -255,16 +282,27 @@ public class MintsApplication extends BaseApp {
BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() { BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() {
@Override @Override
public void onCharging() { public void onCharging() {
showBoost();
ToastUtils.show("--> 正在充电 <--"); ToastUtils.show("--> 正在充电 <--");
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getBatteryOn()) {
showBoost();
}
} }
@Override @Override
public void onUnCharging() { public void onUnCharging() {
showBoost();
ToastUtils.show("--> 停止充电 <--"); ToastUtils.show("--> 停止充电 <--");
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getBatteryOff()) {
showBoost();
}
} }
}); });
...@@ -320,11 +358,6 @@ public class MintsApplication extends BaseApp { ...@@ -320,11 +358,6 @@ public class MintsApplication extends BaseApp {
* 展示加速页面 * 展示加速页面
*/ */
private void showBoost() { private void showBoost() {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2()) {
return;
}
// 预加载信息流 // 预加载信息流
ExpressManager.INSTANCE.loadExpress(); ExpressManager.INSTANCE.loadExpress();
...@@ -337,11 +370,6 @@ public class MintsApplication extends BaseApp { ...@@ -337,11 +370,6 @@ public class MintsApplication extends BaseApp {
* 展示锁屏页面 * 展示锁屏页面
*/ */
private void showScreen() { private void showScreen() {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2()) {
return;
}
// 预加载信息流 // 预加载信息流
ExpressManager.INSTANCE.loadExpress(); ExpressManager.INSTANCE.loadExpress();
......
...@@ -8,6 +8,7 @@ import com.mints.flowbox.utils.MD5 ...@@ -8,6 +8,7 @@ import com.mints.flowbox.utils.MD5
import com.mints.library.net.netstatus.NetUtils import com.mints.library.net.netstatus.NetUtils
import okhttp3.MediaType import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MediaType.Companion.toMediaTypeOrNull
//import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody import okhttp3.RequestBody
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
...@@ -119,6 +120,7 @@ object CpdManager { ...@@ -119,6 +120,7 @@ object CpdManager {
} }
return RequestBody.create("application/json".toMediaTypeOrNull(), param.toString()) return RequestBody.create("application/json".toMediaTypeOrNull(), param.toString())
// return RequestBody.create(MediaType.parse("application/json"), param.toString())
} }
} }
\ No newline at end of file
...@@ -6,7 +6,6 @@ import com.mints.flowbox.common.Constant ...@@ -6,7 +6,6 @@ import com.mints.flowbox.common.Constant
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.tz.sdk.core.engine.ADEngine import com.tz.sdk.core.engine.ADEngine
import com.tz.sdk.core.engine.ADEngineConfig import com.tz.sdk.core.engine.ADEngineConfig
import com.ximalaya.ting.android.opensdk.player.service.XmPlayerConfig
/** /**
* 描述:天卓珊瑚激励视频 * 描述:天卓珊瑚激励视频
...@@ -20,9 +19,6 @@ object TzManager { ...@@ -20,9 +19,6 @@ object TzManager {
* 初始化 * 初始化
*/ */
fun initTz(application: Application) { fun initTz(application: Application) {
XmPlayerConfig.getInstance(application)
.setDefualtNotificationNickNameAndInfo(Constant.MINTS_APP_NAME, Constant.MINTS_APP_NAME)
ADEngine.getInstance(application) ADEngine.getInstance(application)
.start( .start(
ADEngineConfig.Builder(application) ADEngineConfig.Builder(application)
...@@ -34,7 +30,7 @@ object TzManager { ...@@ -34,7 +30,7 @@ object TzManager {
"CHANNEL_NAME" "CHANNEL_NAME"
) )
) )
.forTest(false) .forTest(true)
.log(true) .log(true)
.verbose(true) .verbose(true)
.build() .build()
......
...@@ -32,8 +32,8 @@ object WifiDataManager { ...@@ -32,8 +32,8 @@ object WifiDataManager {
// 卸载 引导 // 卸载 引导
private val UNINSTALL_OFF = "UNINSTALL_OFF" private val UNINSTALL_OFF = "UNINSTALL_OFF"
// 定时 15分钟 在定时器触发 // // 定时 15分钟 在定时器触发
private val TIMER_15MIN = "TIMER_15MIN" // private val TIMER_15MIN = "TIMER_15MIN"
// 点击home键 30分钟 // 点击home键 30分钟
private val HOME_30MIN = "HOME_30MIN" private val HOME_30MIN = "HOME_30MIN"
...@@ -42,7 +42,7 @@ object WifiDataManager { ...@@ -42,7 +42,7 @@ object WifiDataManager {
private val APPLIST_30MIN = "APPLIST_30MIN" private val APPLIST_30MIN = "APPLIST_30MIN"
// 挂断电话 无广告 // 挂断电话 无广告
private val TELEPHONE_OFF = "TELEPHONE_OFF" // private val TELEPHONE_OFF = "TELEPHONE_OFF"
// 锁屏 100次 // 锁屏 100次
private val LOCK_ON = "LOCK_ON" private val LOCK_ON = "LOCK_ON"
......
...@@ -2,23 +2,17 @@ package com.mints.flowbox.ui.activitys ...@@ -2,23 +2,17 @@ package com.mints.flowbox.ui.activitys
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View import android.view.View
import com.bytedance.hume.readapk.HumeSDK import com.bytedance.hume.readapk.HumeSDK
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.NumAnimUtil
import com.mints.flowbox.utils.ToastUtil import com.mints.flowbox.utils.ToastUtil
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil import com.mints.library.utils.ConstantUtil
import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_aboutus.* import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import java.util.*
/** /**
* 描述:关于我们 * 描述:关于我们
...@@ -39,20 +33,12 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -39,20 +33,12 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
// GlideUtils.loadOneTimeGif(this,R.drawable.wifi_speed,iv_left_icon,object:GlideUtils.GifListener{
// override fun gifPlayComplete() {
// showToast("123")
// }
// })
ivAboutasIcon.setOnLongClickListener { ivAboutasIcon.setOnLongClickListener {
ToastUtil.showLong( ToastUtil.showLong(
MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData( MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(
MintsApplication.getContext(), "CHANNEL_NAME" MintsApplication.getContext(), "CHANNEL_NAME"
) + "\n 头条渠道:" + HumeSDK.getChannel(context) ) + "\n 头条渠道:" + HumeSDK.getChannel(context)
) )
// NumAnimUtil.startAnim(tvAboutasVersion,100f)
true true
} }
......
package com.mints.flowbox.ui.activitys package com.mints.flowbox.ui.activitys
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.ActivityManager
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import android.view.animation.Animation import android.view.animation.Animation
...@@ -251,7 +249,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -251,7 +249,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
if (taskType == 0) { if (taskType == 0) {
cleaningOperation(mContext) AppConfig.isCanClean = false
// cleaningOperation(mContext)
} }
if (taskType == 4) { if (taskType == 4) {
...@@ -470,38 +469,40 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -470,38 +469,40 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
/** 清理内存 */ /** 清理内存 */
private fun cleaningOperation(ctx: Context) { private fun cleaningOperation(ctx: Context) {
val am = ctx.getSystemService(ACTIVITY_SERVICE) as ActivityManager // val infoList = am.runningAppProcesses
val infoList = am.runningAppProcesses // val serviceInfos = am.getRunningServices(100)
val serviceInfos = am.getRunningServices(100) // var count = 0
var count = 0 // if (infoList != null) {
if (infoList != null) { // for (i in infoList.indices) {
for (i in infoList.indices) { // val appProcessInfo = infoList[i]
val appProcessInfo = infoList[i] // Log.e("TAGDD1", "process name : ----------" + appProcessInfo.processName)
Log.e("TAGDD1", "process name : ----------" + appProcessInfo.processName) // //importance 该进程的重要程度 分为几个级别,数值越低就越重要。
//importance 该进程的重要程度 分为几个级别,数值越低就越重要。 // Log.e("TAGDD2", "importance : -----------" + appProcessInfo.importance)
Log.e("TAGDD2", "importance : -----------" + appProcessInfo.importance) // // 一般数值大于RunningAppProcessInfo.IMPORTANCE_SERVICE的进程都长时间没用或者空进程了
// 一般数值大于RunningAppProcessInfo.IMPORTANCE_SERVICE的进程都长时间没用或者空进程了 // // 一般数值大于RunningAppProcessInfo.IMPORTANCE_VISIBLE的进程都是非可见进程,也就是在后台运行着
// 一般数值大于RunningAppProcessInfo.IMPORTANCE_VISIBLE的进程都是非可见进程,也就是在后台运行着 // if (appProcessInfo.importance > ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE) {
// if (appProcessInfo.importance > 100) { // val pkgList = appProcessInfo.pkgList
// String[] pkgList = appProcessInfo.pkgList; // for (j in pkgList.indices) {//pkgList 得到该进程下运行的包名
// for (int j = 0; j < pkgList.length; ++j) {//pkgList 得到该进程下运行的包名 // Log.e("TAGDD4", "It will be killed, package name : " + pkgList[j])
// Log.e("TAGDD4", "It will be killed, package name : " + pkgList[j]); // if (pkgList[j] != Constant.MINTS_PKG_NAME) {
// am.killBackgroundProcesses(pkgList[j]); // am.killBackgroundProcesses(pkgList[j])
// count++; // count++
// } // Log.e("TAGDD4", "count : ----------$count")
// } // }
//只要不是com.example.hasee.a1011ceshi这个包名的进程,其余进程全部禁止 // }
if (appProcessInfo.processName != Constant.MINTS_PKG_NAME) { // }
val pkgList = appProcessInfo.pkgList // //只要不是com.example.hasee.a1011ceshi这个包名的进程,其余进程全部禁止
for (j in pkgList.indices) { //pkgList 得到该进程下运行的包名 //// if (appProcessInfo.processName != Constant.MINTS_PKG_NAME) {
Log.e("TAGDD3", "It will be killed, package name : ----------" + pkgList[j]) //// val pkgList = appProcessInfo.pkgList
am.killBackgroundProcesses(pkgList[j]) //// for (j in pkgList.indices) { //pkgList 得到该进程下运行的包名
count++ //// Log.e("TAGDD3", "It will be killed, package name : ----------" + pkgList[j])
Log.e("TAGDD4", "count : ----------$count") //// am.killBackgroundProcesses(pkgList[j])
} //// count++
} //// Log.e("TAGDD4", "count : ----------$count")
} //// }
} //// }
// }
// }
} }
} }
...@@ -18,11 +18,15 @@ import com.mints.flowbox.ad.wifi.WifiAdManager ...@@ -18,11 +18,15 @@ import com.mints.flowbox.ad.wifi.WifiAdManager
import com.mints.flowbox.ad.wifi.WifiAdStatusListener import com.mints.flowbox.ad.wifi.WifiAdStatusListener
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.adapter.IncreaseAdapter import com.mints.flowbox.ui.adapter.IncreaseAdapter
import com.mints.flowbox.ui.widgets.NumAnimUtil
import com.mints.flowbox.utils.SpanUtils import com.mints.flowbox.utils.SpanUtils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_increasespeed2.* import kotlinx.android.synthetic.main.activity_increasespeed2.*
import kotlinx.android.synthetic.main.activity_increasespeed2.container import kotlinx.android.synthetic.main.activity_increasespeed2.container
import kotlinx.android.synthetic.main.activity_increasespeed2.containerAnim
import kotlinx.android.synthetic.main.activity_increasespeed2.fl_ad import kotlinx.android.synthetic.main.activity_increasespeed2.fl_ad
import kotlinx.android.synthetic.main.activity_increasespeed2.iv_gif
import kotlinx.android.synthetic.main.activity_increasespeed2.tv_progress
import kotlinx.android.synthetic.main.activity_increasespeed2.tv_title_1 import kotlinx.android.synthetic.main.activity_increasespeed2.tv_title_1
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import java.util.* import java.util.*
...@@ -65,6 +69,8 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -65,6 +69,8 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
private var mTimer: Timer? = null private var mTimer: Timer? = null
private var mTimerMax = 12
override fun getContentViewLayoutID() = R.layout.activity_increasespeed2 override fun getContentViewLayoutID() = R.layout.activity_increasespeed2
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
...@@ -94,8 +100,10 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -94,8 +100,10 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main)) containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main))
GlideUtils.loadImageViewGif(this, R.drawable.wifi_speed, iv_gif) GlideUtils.loadImageViewGif(this, R.drawable.wifi_speed, iv_gif)
} else { } else {
NumAnimUtil.startAnim(tv_progress, 100f)
containerAnim.setBackgroundColor(Color.parseColor("#8278DC")) containerAnim.setBackgroundColor(Color.parseColor("#8278DC"))
GlideUtils.loadImageViewGif(this, R.drawable.safe_check, iv_gif) GlideUtils.loadImageViewGif(this, R.drawable.safe_check, iv_gif)
mTimerMax = 10
} }
mTimer = Timer() mTimer = Timer()
...@@ -104,15 +112,24 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -104,15 +112,24 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
runOnUiThread { runOnUiThread {
step++ step++
if (step == 10) { if (step == mTimerMax - 2) {
YoYo.with(Techniques.FadeOut).duration(600).playOn(containerAnim) YoYo.with(Techniques.FadeOut).duration(600).playOn(containerAnim)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告 // 动画结束后 展示插屏广告
mWifiAdManager?.showInterstitial() mWifiAdManager?.showInterstitial()
}, 3000) }, 3000)
container.visibility = View.VISIBLE container.visibility = View.VISIBLE
} else if (step == 12) { if (mIncreaseType == INCREASE2_SAFE_CHECK) {
ivGif2.visibility = View.VISIBLE
GlideUtils.loadImageViewGif(
mContext,
R.drawable.safe_check_result,
ivGif2
)
}
} else if (step == mTimerMax) {
containerAnim.visibility = View.GONE containerAnim.visibility = View.GONE
GlideUtils.loadImageViewGif(mContext, R.drawable.firework, ivGif)
mTimer?.cancel() mTimer?.cancel()
} }
} }
......
...@@ -15,7 +15,9 @@ import com.mints.flowbox.ad.express.ExpressManager ...@@ -15,7 +15,9 @@ import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.wifi.WifiAdManager import com.mints.flowbox.ad.wifi.WifiAdManager
import com.mints.flowbox.ad.wifi.WifiAdStatusListener import com.mints.flowbox.ad.wifi.WifiAdStatusListener
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import com.mints.flowbox.utils.SpanUtils import com.mints.flowbox.utils.SpanUtils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_increasespeed.* import kotlinx.android.synthetic.main.activity_increasespeed.*
...@@ -49,6 +51,8 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -49,6 +51,8 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
private var mTimer: Timer? = null private var mTimer: Timer? = null
private var mTimerMax = 12
override fun getBundleExtras(extras: Bundle?) { override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras) super.getBundleExtras(extras)
extras?.let { extras?.let {
...@@ -88,6 +92,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -88,6 +92,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
startTimer() startTimer()
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) { } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) {
startTimer() startTimer()
} else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) {
startTimer()
mTimerMax = 14
} else { } else {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告 // 动画结束后 展示插屏广告
...@@ -106,10 +113,15 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -106,10 +113,15 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) { if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) {
containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main)) containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main))
iv_gif.layoutParams.width = BubbleUtils.dp2px(200)
GlideUtils.loadImageViewGif(this, R.drawable.battery, iv_gif) GlideUtils.loadImageViewGif(this, R.drawable.battery, iv_gif)
} else if (mIncreaseType == INCREASE_CLEAN) {
containerAnim.setBackgroundColor(Color.parseColor("#906cf4"))
GlideUtils.loadImageViewGif(this, R.drawable.rubbish, iv_gif)
} else { } else {
containerAnim.setBackgroundColor(Color.parseColor("#906cf4")) containerAnim.setBackgroundColor(Color.parseColor("#906cf4"))
GlideUtils.loadImageViewGif(this, R.drawable.rocket_anim, iv_gif) GlideUtils.loadImageViewGif(this, R.drawable.rocket_anim, iv_gif)
tv_progress.text = "正在检测后台常驻软件..."
} }
mTimer = Timer() mTimer = Timer()
...@@ -118,14 +130,22 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -118,14 +130,22 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
runOnUiThread { runOnUiThread {
step++ step++
if (step == 10) { if (step == mTimerMax - 2) {
YoYo.with(Techniques.FadeOut).duration(600).playOn(containerAnim) YoYo.with(Techniques.FadeOut).duration(600).playOn(containerAnim)
if (mIncreaseType == INCREASE_CLEAN) {
// 一键清理
val bundle = Bundle()
bundle.putInt(Constant.SCAN_TYPE, 1)
readyGoThenKill(CleanActivity::class.java, bundle)
mTimer?.cancel()
return@runOnUiThread
}
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告 // 动画结束后 展示插屏广告
mWifiAdManager?.showInterstitial() mWifiAdManager?.showInterstitial()
}, 3000) }, 3000)
container.visibility = View.VISIBLE container.visibility = View.VISIBLE
} else if (step == 12) { } else if (step == mTimerMax) {
containerAnim.visibility = View.GONE containerAnim.visibility = View.GONE
mTimer?.cancel() mTimer?.cancel()
} }
...@@ -162,7 +182,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -162,7 +182,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
infoStr = "成功清理完成" infoStr = "成功清理完成"
} }
INCREASE_CLEAN -> { INCREASE_CLEAN -> {
AppConfig.isCanClean = false
headTitleStr = "一键清理" headTitleStr = "一键清理"
titleStr = SpanUtils() titleStr = SpanUtils()
.append("已经清理后台软件") .append("已经清理后台软件")
......
...@@ -77,11 +77,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener { ...@@ -77,11 +77,6 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
val drawable = iv_gif.drawable as GifDrawable val drawable = iv_gif.drawable as GifDrawable
if (drawable.isRunning) { if (drawable.isRunning) {
drawable.stop() drawable.stop()
GlideUtils.loadImageView(
this@SpeedFastActivity,
R.mipmap.bg_speed_end,
iv_gif
)
} }
} }
......
...@@ -31,10 +31,6 @@ private val TAG = SpeedTestActivity::class.java.simpleName ...@@ -31,10 +31,6 @@ private val TAG = SpeedTestActivity::class.java.simpleName
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
class SpeedTestActivity : BaseActivity(), View.OnClickListener { class SpeedTestActivity : BaseActivity(), View.OnClickListener {
// private val wifiManager by lazy {
// WifiUtils.getInstance(this)
// }
private var isAnimFinished = true //播放动画控制 private var isAnimFinished = true //播放动画控制
private var isSpeedTestOver = true //是否测速完成 private var isSpeedTestOver = true //是否测速完成
......
...@@ -269,6 +269,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -269,6 +269,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
tv_clean.setOnClickListener(this) tv_clean.setOnClickListener(this)
tv_save_battery.setOnClickListener(this) tv_save_battery.setOnClickListener(this)
btn_signal.setOnClickListener(this) btn_signal.setOnClickListener(this)
ivImg.setOnClickListener(this)
} }
private fun initView() { private fun initView() {
...@@ -336,13 +337,13 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -336,13 +337,13 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
) )
readyGo(IncreasespeedActivity::class.java) readyGo(IncreasespeedActivity::class.java)
} }
R.id.tv_clean -> { R.id.tv_clean -> { // 一键清理
if (AppConfig.isCanClean) { // if (AppConfig.isCanClean) {
// 一键清理 // // 一键清理
val bundle = Bundle() // val bundle = Bundle()
bundle.putInt(Constant.SCAN_TYPE, 1) // bundle.putInt(Constant.SCAN_TYPE, 1)
readyGo(CleanActivity::class.java, bundle) // readyGo(CleanActivity::class.java, bundle)
} else { // } else {
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress()
...@@ -352,7 +353,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -352,7 +353,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
IncreasespeedActivity.INCREASE_CLEAN IncreasespeedActivity.INCREASE_CLEAN
) )
readyGo(IncreasespeedActivity::class.java, bundle) readyGo(IncreasespeedActivity::class.java, bundle)
} // }
} }
R.id.tv_save_battery -> { // 超强省电 R.id.tv_save_battery -> { // 超强省电
// 预加载信息流 // 预加载信息流
...@@ -375,12 +376,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -375,12 +376,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress()
val bundle = Bundle() readyGo(SpeedFastActivity::class.java)
bundle.putString( }
Increasespeed2Activity.INCREASE2_TYPE, R.id.ivImg -> { // 点我赚钱
Increasespeed2Activity.INCREASE2_WIFI_BOOST (requireActivity() as MainActivity).clickTab4Layout()
)
readyGo(Increasespeed2Activity::class.java, bundle)
} }
else -> { else -> {
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="280dp" android:layout_height="320dp"
android:background="@drawable/shape_bg_speed" /> android:background="@drawable/shape_bg_speed" />
<LinearLayout <LinearLayout
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" /> android:layout_centerInParent="true" />
<TextView
android:id="@+id/tv_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="80dp"
android:textColor="@color/white" />
</RelativeLayout> </RelativeLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
......
...@@ -25,6 +25,15 @@ ...@@ -25,6 +25,15 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" /> android:layout_centerInParent="true" />
<TextView
android:id="@+id/tv_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="80dp"
android:textColor="@color/white" />
</RelativeLayout> </RelativeLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
...@@ -45,26 +54,35 @@ ...@@ -45,26 +54,35 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:visibility="gone"> android:visibility="gone">
<com.mints.flowbox.ui.widgets.DrawHookView <!-- <com.mints.flowbox.ui.widgets.DrawHookView-->
android:id="@+id/dhv" <!-- android:id="@+id/dhv"-->
android:layout_width="50dp" <!-- android:layout_width="50dp"-->
android:layout_height="50dp" /> <!-- android:layout_height="50dp" />-->
<ImageView
android:id="@+id/ivGif"
android:layout_width="200dp"
android:layout_height="wrap_content" />
<TextView <TextView
android:id="@+id/tv_title_1" android:id="@+id/tv_title_1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_below="@id/ivGif"
android:layout_marginStart="20dp" android:layout_centerHorizontal="true"
android:layout_toEndOf="@id/dhv"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="20sp" /> android:textSize="20sp" />
</RelativeLayout> </RelativeLayout>
<ImageView
android:id="@+id/ivGif2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycleView" android:id="@+id/recycleView"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/bg_wifi_speed" android:background="#8E85DD"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/bg_wifi_speed"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
...@@ -25,7 +24,7 @@ ...@@ -25,7 +24,7 @@
android:id="@+id/tv_tab" android:id="@+id/tv_tab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginTop="20dp"
android:background="@drawable/shape_write" android:background="@drawable/shape_write"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="20dp" android:paddingEnd="20dp"
...@@ -34,15 +33,16 @@ ...@@ -34,15 +33,16 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="wrap_content"
android:layout_marginTop="30dp"> android:layout_marginTop="15dp"
android:layout_marginBottom="15dp">
<ImageView <ImageView
android:id="@+id/iv_gif" android:id="@+id/iv_gif"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="200dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@mipmap/bg_speed_start" android:src="@drawable/wifi_speed"
android:visibility="visible" /> android:visibility="visible" />
</FrameLayout> </FrameLayout>
...@@ -78,13 +78,12 @@ ...@@ -78,13 +78,12 @@
</FrameLayout> </FrameLayout>
<com.mints.flowbox.ui.widgets.RoundRectLayout <com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad" android:id="@+id/fl_ad"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="15dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:background="@drawable/shape_gold_card" android:background="@drawable/shape_gold_card"
android:elevation="2dip" /> android:elevation="2dip" />
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
android:id="@+id/tv_1" android:id="@+id/tv_1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="40dp" android:layout_above="@id/tv_2"
android:layout_marginStart="30dp"
android:text="@string/appName" android:text="@string/appName"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="26sp" /> android:textSize="26sp" />
...@@ -39,12 +40,21 @@ ...@@ -39,12 +40,21 @@
android:id="@+id/tv_2" android:id="@+id/tv_2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tv_1"
android:layout_alignStart="@id/tv_1" android:layout_alignStart="@id/tv_1"
android:layout_alignBottom="@id/ivImg"
android:layout_marginBottom="10dp"
android:text="您身边的网络专家" android:text="您身边的网络专家"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp" />
<ImageView
android:id="@+id/ivImg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:src="@mipmap/ic_make_money" />
</RelativeLayout> </RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
...@@ -60,28 +70,29 @@ ...@@ -60,28 +70,29 @@
android:id="@+id/imageView2" android:id="@+id/imageView2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:src="@mipmap/ic_main_wifi" android:src="@mipmap/ic_main_wifi"
app:layout_constraintBottom_toBottomOf="@id/tv_wifi_info"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="@id/tv_wifi_ssid" />
<TextView <TextView
android:id="@+id/tv_wifi_ssid" android:id="@+id/tv_wifi_ssid"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:text="WIFI未开启" android:text="WIFI未开启"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="22sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/imageView2" app:layout_constraintStart_toEndOf="@+id/imageView2"
app:layout_constraintTop_toTopOf="@+id/imageView2" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tv_wifi_info" android:id="@+id/tv_wifi_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="15dp"
android:text="连接成功,安全保护中" android:text="连接成功,安全保护中"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintStart_toEndOf="@id/imageView2" app:layout_constraintStart_toEndOf="@id/imageView2"
......
...@@ -37,7 +37,7 @@ RELEASE_JPUSH_KEY=d9e939e7ec22a9e11dcfc345 ...@@ -37,7 +37,7 @@ RELEASE_JPUSH_KEY=d9e939e7ec22a9e11dcfc345
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
android.useNewApkCreator=false android.useNewApkCreator=true
####### 保活相关 ####### ####### 保活相关 #######
# vvvvvv 下面不要动!!!! # vvvvvv 下面不要动!!!!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment