Commit 030e7d21 authored by jyx's avatar jyx

问题修复,更新信息流

parent 5436b3b8
...@@ -362,15 +362,11 @@ public class MintsApplication extends BaseApp { ...@@ -362,15 +362,11 @@ public class MintsApplication extends BaseApp {
*/ */
private void showBoost() { private void showBoost() {
// 预加载信息流 // 预加载信息流
ExpressManager.INSTANCE.loadExpress(); ExpressManager.INSTANCE.loadAppOutExpress();
Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class); Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent); IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
// Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// MintsApplication.this.startActivity(intent);
} }
/** /**
...@@ -378,15 +374,11 @@ public class MintsApplication extends BaseApp { ...@@ -378,15 +374,11 @@ public class MintsApplication extends BaseApp {
*/ */
private void showScreen() { private void showScreen() {
// 预加载信息流 // 预加载信息流
ExpressManager.INSTANCE.loadExpress(); ExpressManager.INSTANCE.loadAppOutExpress();
Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class); Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent); IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
// Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// MintsApplication.this.startActivity(intent);
} }
private void androidPWebView() { private void androidPWebView() {
......
...@@ -2,27 +2,48 @@ package com.mints.flowbox.ad.express ...@@ -2,27 +2,48 @@ package com.mints.flowbox.ad.express
import android.widget.FrameLayout import android.widget.FrameLayout
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.manager.TtCsjAdManager
/** /**
* 能用信息流加载 * 能用信息流加载
*/ */
object ExpressManager { object ExpressManager {
fun loadExpress() { fun loadExpress(isMain: Boolean) {
if (AppConfig.groMoreVideoAdCount > 0) { if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout() GroMoreCarrierExpressManager.instance.loadADFrameLayout(isMain)
} else { } else {
TTPreLoadCarrierExpressManager.getInstance() PreLoadExpressManager.loadADFrameLayout()
.loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER) // TTPreLoadCarrierExpressManager.getInstance()
// .loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
} }
} }
fun loadAppOutExpress() {
if (AppConfig.groMoreVideoAdCount > 0) {
AppOutGroMoreCarrierExpressManager.instance.loadADFrameLayout()
}
// else {
// TTPreLoadCarrierExpressManager.getInstance()
// .loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
// }
}
fun getExpressFrameLayout(): FrameLayout? { fun getExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) { if (AppConfig.groMoreVideoAdCount > 0) {
return GroMoreCarrierExpressManager.instance.getADFrameLayout() return GroMoreCarrierExpressManager.instance.getADFrameLayout()
} else { } else {
return TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout return PreLoadExpressManager.getADFrameLayout()
// return TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout
}
}
fun getAppOutExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) {
return AppOutGroMoreCarrierExpressManager.instance.getADFrameLayout()
} }
// else {
// return TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout
// }
return null
} }
} }
\ No newline at end of file
...@@ -15,7 +15,9 @@ import java.util.* ...@@ -15,7 +15,9 @@ import java.util.*
/** /**
* 预加载信息流管理类 * 预加载信息流管理类
*/ */
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener, KSADLoadSuccessListener, GMADLoadSuccessListener { @SuppressLint("StaticFieldLeak")
object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener,
KSADLoadSuccessListener, GMADLoadSuccessListener {
private val TAG = PreLoadExpressManager::class.java.simpleName private val TAG = PreLoadExpressManager::class.java.simpleName
...@@ -62,7 +64,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -62,7 +64,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// } // }
when (getRandomWeight()) { when (getRandomWeight()) {
Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance().loadTtFrameLayout(mAdFrameLayout) Constant.CSJ_EXPRESS_AD -> TTPreLoadExpressManager.getInstance()
.loadTtFrameLayout(mAdFrameLayout)
Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout() Constant.YLH_EXPRESS_AD -> YlhPreLoadExpressManager.loadYlhFrameLayout()
Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup) Constant.KS_EXPRESS_AD -> KsPreLoadExpressManager.loadKsFrameLayout(mAdFrameLayout as ViewGroup)
Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout() Constant.GM_EXPRESS_AD -> GroMoreExpressManager.instance.loadADFrameLayout()
...@@ -135,8 +138,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -135,8 +138,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 1) { // if (currentIndex == 1) {
// mAdFrameLayout = adFrameLayout // mAdFrameLayout = adFrameLayout
// } // }
if(view!=null){ if (view != null) {
AppConfig.isPreExpressAwardActivity=true AppConfig.isPreExpressAwardActivity = true
} }
mAdFrameLayout = view mAdFrameLayout = view
} }
...@@ -145,8 +148,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -145,8 +148,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 2) { // if (currentIndex == 2) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){ if (view != null) {
AppConfig.isPreExpressAwardActivity=true AppConfig.isPreExpressAwardActivity = true
} }
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
...@@ -155,8 +158,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -155,8 +158,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 3) { // if (currentIndex == 3) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){ if (view != null) {
AppConfig.isPreExpressAwardActivity=true AppConfig.isPreExpressAwardActivity = true
} }
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
...@@ -165,8 +168,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -165,8 +168,8 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
// if (currentIndex == 3) { // if (currentIndex == 3) {
// mAdFrameLayout?.addView(view) // mAdFrameLayout?.addView(view)
// } // }
if(view!=null){ if (view != null) {
AppConfig.isPreExpressAwardActivity=true AppConfig.isPreExpressAwardActivity = true
} }
mAdFrameLayout?.addView(view) mAdFrameLayout?.addView(view)
} }
......
...@@ -9,6 +9,7 @@ import android.widget.FrameLayout; ...@@ -9,6 +9,7 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.mints.flowbox.MintsApplication; import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.common.AppConfig;
import com.mints.flowbox.manager.TTNativeExpressManager; import com.mints.flowbox.manager.TTNativeExpressManager;
public class TTPreLoadCarrierExpressManager { public class TTPreLoadCarrierExpressManager {
...@@ -86,6 +87,8 @@ public class TTPreLoadCarrierExpressManager { ...@@ -86,6 +87,8 @@ public class TTPreLoadCarrierExpressManager {
ttFrameLayout = null; ttFrameLayout = null;
} else { } else {
AppConfig.isPreExpressAwardActivity = true;
try { try {
ttFrameLayout = view; ttFrameLayout = view;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -81,7 +81,7 @@ public class FullGroManager { ...@@ -81,7 +81,7 @@ public class FullGroManager {
* 注:每次加载全屏视频广告的时候需要新建一个TTFullVideoAd,否则可能会出现广告填充问题 * 注:每次加载全屏视频广告的时候需要新建一个TTFullVideoAd,否则可能会出现广告填充问题
* ( 例如:mTTFullVideoAd = new TTFullVideoAd(this, adUnitId);) * ( 例如:mTTFullVideoAd = new TTFullVideoAd(this, adUnitId);)
*/ */
mTTFullVideoAd = new TTFullVideoAd(activity, CsjGroMoreManager.INSTANCE.getAD_UNIT_FULL_ID()); mTTFullVideoAd = new TTFullVideoAd(activity, CsjGroMoreManager.INSTANCE.getAPP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID());
//声音控制 模板 2.0 //声音控制 模板 2.0
TTVideoOption videoOption = VideoOptionUtil.getTTVideoOption2(); TTVideoOption videoOption = VideoOptionUtil.getTTVideoOption2();
...@@ -120,14 +120,14 @@ public class FullGroManager { ...@@ -120,14 +120,14 @@ public class FullGroManager {
} }
if (isLoadSuccess && mTTFullVideoAd != null && mTTFullVideoAd.isReady() && activity != null) { if (isLoadSuccess && mTTFullVideoAd != null && mTTFullVideoAd.isReady() && activity != null) {
//设置监听器 //设置监听器
mTTFullVideoAd.showFullAd(activity,mTTFullVideoAdListener); mTTFullVideoAd.showFullAd(activity, mTTFullVideoAdListener);
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mTTFullVideoAd.getAdNetworkRitId()); vo.put("adcode", mTTFullVideoAd.getAdNetworkRitId());
vo.put("ecpm", mTTFullVideoAd.getPreEcpm()); vo.put("ecpm", mTTFullVideoAd.getPreEcpm());
vo.put("adSource", mTTFullVideoAd.getAdNetworkPlatformId()); vo.put("adSource", mTTFullVideoAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE4); vo.put("adType", Constant.GRO_MORE_ADTYPE4);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_FULL_ID()); vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo); TrackManager.getInstance().cmtGroMoreInfo(vo);
} else { } else {
// 当加载到广告后 ,长时间未展示失效时 改变状态 // 当加载到广告后 ,长时间未展示失效时 改变状态
...@@ -152,7 +152,7 @@ public class FullGroManager { ...@@ -152,7 +152,7 @@ public class FullGroManager {
@Override @Override
public void onFullVideoAdClosed() { public void onFullVideoAdClosed() {
if(wifiAdStatusListener!=null){ if (wifiAdStatusListener != null) {
wifiAdStatusListener.adClose(); wifiAdStatusListener.adClose();
} }
Log.d(TAG, "onFullVideoAdClosed"); Log.d(TAG, "onFullVideoAdClosed");
......
...@@ -24,24 +24,24 @@ class InsertScreenAdManager { ...@@ -24,24 +24,24 @@ class InsertScreenAdManager {
/** /**
* 预加载广告,必须传入activity * 预加载广告,必须传入activity
*/ */
fun loadInterstitial(activity: Activity) { fun loadInterstitial(activity: Activity, isMain: Boolean) {
if (AppConfig.groMoreVideoAdCount > 0) { if (AppConfig.groMoreVideoAdCount > 0) {
preLoadGroMore(activity) preLoadGroMore(activity, isMain)
} else { } else {
preLoadYlh(activity) preLoadYlh(activity)
} }
} }
private fun preLoadGroMore(activity: Activity) { private fun preLoadGroMore(activity: Activity, isMain: Boolean) {
currentInterstitialType = Constant.GROMORE_INSERTSCREEN_AD currentInterstitialType = Constant.GROMORE_INSERTSCREEN_AD
if (interstitialGroManager != null) { if (interstitialGroManager != null) {
interstitialGroManager?.onDestroy() interstitialGroManager?.onDestroy()
} }
interstitialGroManager = InterstitialGroManager() interstitialGroManager = InterstitialGroManager()
interstitialGroManager?.loadInsertScreenAd(activity) interstitialGroManager?.loadInsertScreenAd(activity, isMain)
interstitialGroManager?.setWifiAdStatusListener(object : interstitialGroManager?.setWifiAdStatusListener(object :
WifiAdStatusListener { WifiAdStatusListener {
override fun adSuccess() { override fun adSuccess() {
wifiAdStatusListener?.adSuccess() wifiAdStatusListener?.adSuccess()
} }
...@@ -52,7 +52,7 @@ class InsertScreenAdManager { ...@@ -52,7 +52,7 @@ class InsertScreenAdManager {
} }
override fun adClose() { override fun adClose() {
} }
}) })
} }
...@@ -66,7 +66,7 @@ class InsertScreenAdManager { ...@@ -66,7 +66,7 @@ class InsertScreenAdManager {
interstitialYlhManager = InterstitialYlhManager() interstitialYlhManager = InterstitialYlhManager()
interstitialYlhManager?.loadYlhInteractionAd(activity) interstitialYlhManager?.loadYlhInteractionAd(activity)
interstitialYlhManager?.setWifiAdStatusListener(object : interstitialYlhManager?.setWifiAdStatusListener(object :
WifiAdStatusListener { WifiAdStatusListener {
override fun adSuccess() { override fun adSuccess() {
wifiAdStatusListener?.adSuccess() wifiAdStatusListener?.adSuccess()
} }
...@@ -76,7 +76,7 @@ class InsertScreenAdManager { ...@@ -76,7 +76,7 @@ class InsertScreenAdManager {
} }
override fun adClose() { override fun adClose() {
} }
}) })
} }
......
...@@ -34,10 +34,13 @@ public class InterstitialGroManager { ...@@ -34,10 +34,13 @@ public class InterstitialGroManager {
private Activity activity; private Activity activity;
private boolean isLoadSuccess = false; private boolean isLoadSuccess = false;
public void loadInsertScreenAd(Activity activity) { private boolean isMain = false;
public void loadInsertScreenAd(Activity activity, boolean isMain) {
// 加载到广告且未展示 则返回 // 加载到广告且未展示 则返回
if (isLoadSuccess) return; if (isLoadSuccess) return;
this.isMain = isMain;
this.activity = activity; this.activity = activity;
if (TTMediationAdSdk.configLoadSuccess()) { if (TTMediationAdSdk.configLoadSuccess()) {
...@@ -73,7 +76,11 @@ public class InterstitialGroManager { ...@@ -73,7 +76,11 @@ public class InterstitialGroManager {
* 注:每次加载插屏广告的时候需要新建一个TTInterstitialAd,否则可能会出现广告填充问题 * 注:每次加载插屏广告的时候需要新建一个TTInterstitialAd,否则可能会出现广告填充问题
* ( 例如:mInterstitialAd = new TTInterstitialAd(this, adUnitId);) * ( 例如:mInterstitialAd = new TTInterstitialAd(this, adUnitId);)
*/ */
mInterstitialAd = new TTInterstitialAd(activity, CsjGroMoreManager.INSTANCE.getAD_UNIT_INTERSTITIAL_ID()); if (isMain) {
mInterstitialAd = new TTInterstitialAd(activity, CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID());
} else {
mInterstitialAd = new TTInterstitialAd(activity, CsjGroMoreManager.INSTANCE.getAPP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID());
}
//模板1.0 //模板1.0
TTVideoOption videoOption = VideoOptionUtil.getTTVideoOption(); TTVideoOption videoOption = VideoOptionUtil.getTTVideoOption();
...@@ -118,7 +125,11 @@ public class InterstitialGroManager { ...@@ -118,7 +125,11 @@ public class InterstitialGroManager {
vo.put("ecpm", mInterstitialAd.getPreEcpm()); vo.put("ecpm", mInterstitialAd.getPreEcpm());
vo.put("adSource", mInterstitialAd.getAdNetworkPlatformId()); vo.put("adSource", mInterstitialAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE3); vo.put("adType", Constant.GRO_MORE_ADTYPE3);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_INTERSTITIAL_ID()); if (isMain) {
vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID());
} else {
vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID());
}
TrackManager.getInstance().cmtGroMoreInfo(vo); TrackManager.getInstance().cmtGroMoreInfo(vo);
} else { } else {
// 当加载到广告后 ,长时间未展示失效时 改变状态 // 当加载到广告后 ,长时间未展示失效时 改变状态
......
...@@ -68,7 +68,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -68,7 +68,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
* 判断当前是否存在config 配置 ,如果存在直接加载广告 ,如果不存在则注册config加载回调 * 判断当前是否存在config 配置 ,如果存在直接加载广告 ,如果不存在则注册config加载回调
*/ */
if (TTMediationAdSdk.configLoadSuccess()) { if (TTMediationAdSdk.configLoadSuccess()) {
loadAd(CsjGroMoreManager.INSTANCE.getAD_UNIT_VIDEO_ID(), TTAdConstant.VERTICAL); loadAd(CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_VIDEO_ID(), TTAdConstant.VERTICAL);
} else { } else {
TTMediationAdSdk.registerConfigCallback(mSettingConfigCallback); //不用使用内部类,否则在ondestory中无法移除该回调 TTMediationAdSdk.registerConfigCallback(mSettingConfigCallback); //不用使用内部类,否则在ondestory中无法移除该回调
} }
...@@ -80,7 +80,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -80,7 +80,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
private TTSettingConfigCallback mSettingConfigCallback = new TTSettingConfigCallback() { private TTSettingConfigCallback mSettingConfigCallback = new TTSettingConfigCallback() {
@Override @Override
public void configLoad() { public void configLoad() {
loadAd(CsjGroMoreManager.INSTANCE.getAD_UNIT_VIDEO_ID(), TTAdConstant.VERTICAL); loadAd(CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_VIDEO_ID(), TTAdConstant.VERTICAL);
} }
}; };
...@@ -245,7 +245,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd { ...@@ -245,7 +245,7 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
vo.put("adSource", mttRewardAd.getAdNetworkPlatformId()); vo.put("adSource", mttRewardAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE2); vo.put("adType", Constant.GRO_MORE_ADTYPE2);
vo.put("ecpmId", AppConfig.gromoreId); vo.put("ecpmId", AppConfig.gromoreId);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_VIDEO_ID()); vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_VIDEO_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo); TrackManager.getInstance().cmtGroMoreInfo(vo);
} }
......
...@@ -65,7 +65,7 @@ class WifiAdManager { ...@@ -65,7 +65,7 @@ class WifiAdManager {
interstitialGroManager?.onDestroy() interstitialGroManager?.onDestroy()
} }
interstitialGroManager = InterstitialGroManager() interstitialGroManager = InterstitialGroManager()
interstitialGroManager?.loadInsertScreenAd(activity) interstitialGroManager?.loadInsertScreenAd(activity, false)
} }
/** /**
...@@ -85,7 +85,7 @@ class WifiAdManager { ...@@ -85,7 +85,7 @@ class WifiAdManager {
fun showInterstitial() { fun showInterstitial() {
when (currentAdType) { when (currentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> { Constant.GROMORE_INSERTSCREEN_AD -> {
interstitialGroManager?.setWifiAdStatusListener(object :WifiAdStatusListener{ interstitialGroManager?.setWifiAdStatusListener(object : WifiAdStatusListener {
override fun adSuccess() { override fun adSuccess() {
} }
......
...@@ -203,4 +203,9 @@ public class AppConfig { ...@@ -203,4 +203,9 @@ public class AppConfig {
public static boolean isCanClean = true; public static boolean isCanClean = true;
/*是否可以 超强省电 */ /*是否可以 超强省电 */
public static boolean isCanSaveBattery = true; public static boolean isCanSaveBattery = true;
// 是否展示第一次新人红包
public static boolean isShowFirstGive = false;
public static int firstGiveCoin = 1500;
} }
package com.mints.flowbox.keepalive; package com.mints.flowbox.keepalive;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle;
import android.os.Message; import android.os.Message;
import com.bytedance.msdk.adapter.util.WeakHandler; import com.bytedance.msdk.adapter.util.WeakHandler;
...@@ -10,6 +11,7 @@ import com.mints.flowbox.common.AppConfig; ...@@ -10,6 +11,7 @@ import com.mints.flowbox.common.AppConfig;
import com.mints.flowbox.manager.TrackManager; import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.ui.activitys.BoostActivity; import com.mints.flowbox.ui.activitys.BoostActivity;
import com.mints.flowbox.utils.ForegroundOrBackground; import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.IntentUtils;
/** /**
* 描述:应用外广告定时器 * 描述:应用外广告定时器
...@@ -93,11 +95,14 @@ public class AlarmManager implements WeakHandler.IHandler { ...@@ -93,11 +95,14 @@ public class AlarmManager implements WeakHandler.IHandler {
} }
// 预加载信息流 // 预加载信息流
ExpressManager.INSTANCE.loadExpress(); ExpressManager.INSTANCE.loadAppOutExpress();
//用户关闭界面后10分钟调用 //用户关闭界面后10分钟调用
Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class); Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MintsApplication.getContext().startActivity(intent); Bundle bundle = new Bundle();
bundle.putBoolean(BoostActivity.IS_FROM_ALARM, true);
intent.putExtras(bundle);
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
} }
} }
......
...@@ -11,11 +11,35 @@ import com.mints.flowbox.mvp.model.GroAdcodeBean ...@@ -11,11 +11,35 @@ import com.mints.flowbox.mvp.model.GroAdcodeBean
*/ */
object CsjGroMoreManager { object CsjGroMoreManager {
var AD_UNIT_EXPRESS_ID = "946265897" // 信息流 /**
var AD_UNIT_SPLASH_ID = "887497104" // 开屏 * 老用户代码位-- ↓
var AD_UNIT_VIDEO_ID = "946265896" // 激励视频 * 应用内:
var AD_UNIT_INTERSTITIAL_ID = "946265898" // 插屏 * 普通:
var AD_UNIT_FULL_ID = "946333578" // 全屏 * 新插屏 -> 946333680
* 信息流 -> 946265897
* 网赚:
* 激励视频 -> 946265896
* 信息流 -> 946334121
* 插屏 -> 946334151
* 开屏 -> 887506685
* 应用外:
* 普通:
* 新插屏 -> 946333773
* 信息流 -> 94633992
* 锁屏:
* 信息流 -> 946334023
*/
var APP_OUT_AD_UNIT_EXPRESS_ID = "94633992" // 应用外普通信息流
var APP_OUT_AD_UNIT_LOCK_EXPRESS_ID = "946334023" // 应用外锁屏信息流
var APP_OUT_AD_UNIT_INTERSTITIAL_ID = "946333773" // 应用外插屏
var APP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID = "946333578" // 应用内 普通 插屏
var APP_IN_COMMON_AD_UNIT_EXPRESS_ID = "946265897" // 应用内 普通 信息流
var APP_IN_MAIN_AD_UNIT_VIDEO_ID = "946265896" // 应用内 网赚 激励视频
var APP_IN_MAIN_AD_UNIT_EXPRESS_ID = "946334121" // 应用内 网赚 信息流
var APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = "946334151" // 应用内 网赚 插屏
var APP_IN_MAIN_AD_UNIT_SPLASH_ID = "887506685" // 应用内 网赚 开屏
fun init(application: MintsApplication) { fun init(application: MintsApplication) {
TTGroMoreAdManagerHolder.init(application) TTGroMoreAdManagerHolder.init(application)
...@@ -27,17 +51,27 @@ object CsjGroMoreManager { ...@@ -27,17 +51,27 @@ object CsjGroMoreManager {
fun updataIdByChannel(idBean: GroAdcodeBean?) { fun updataIdByChannel(idBean: GroAdcodeBean?) {
// 渠道对象不为空 // 渠道对象不为空
if (idBean != null) { if (idBean != null) {
if (!TextUtils.isEmpty(idBean.groExpress)) { if (idBean.gromoreAdcodes_main != null) { // 应用内网赚
AD_UNIT_EXPRESS_ID = idBean.groExpress APP_IN_MAIN_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_main.groExpress
APP_IN_MAIN_AD_UNIT_VIDEO_ID = idBean.gromoreAdcodes_main.groVideo
APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = idBean.gromoreAdcodes_main.groInterstitial
APP_IN_MAIN_AD_UNIT_SPLASH_ID = idBean.gromoreAdcodes_main.groSplash
} }
if (!TextUtils.isEmpty(idBean.groSplash)) {
AD_UNIT_SPLASH_ID = idBean.groSplash if (idBean.gromoreAdcodes_ordinary != null) { // 应用内普通
APP_IN_COMMON_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_ordinary.groExpress
APP_IN_COMMON_AD_UNIT_INTERSTITIAL_ID =
idBean.gromoreAdcodes_ordinary.groNewInterstitial
} }
if (!TextUtils.isEmpty(idBean.groVideo)) {
AD_UNIT_VIDEO_ID = idBean.groVideo if (idBean.gromoreAdcodes_outer_lock != null) { // 应用外锁屏
APP_OUT_AD_UNIT_LOCK_EXPRESS_ID = idBean.gromoreAdcodes_outer_lock.groExpress
} }
if (!TextUtils.isEmpty(idBean.groInterstitial)) {
AD_UNIT_INTERSTITIAL_ID = idBean.groInterstitial if (idBean.gromoreAdcodes_outer_ordinary != null) { // 应用外普通
APP_OUT_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_main.groExpress
APP_OUT_AD_UNIT_INTERSTITIAL_ID =
idBean.gromoreAdcodes_outer_ordinary.groNewInterstitial
} }
} }
} }
......
...@@ -7,25 +7,155 @@ import java.io.Serializable; ...@@ -7,25 +7,155 @@ import java.io.Serializable;
*/ */
public class GroAdcodeBean implements Serializable { public class GroAdcodeBean implements Serializable {
private String groExpress;
private String groSplash;
private String groVideo;
private String groInterstitial;
public String getGroExpress() { /**
return groExpress; * groExpress : 946265897
* groNewInterstitial : 946333578
*/
private GromoreAdcodesOrdinaryDTO gromoreAdcodes_ordinary;
/**
* groVideo : 946265896
* groInterstitial : 946334151
* groExpress : 946334121
* groSplash : 887506685
*/
private GromoreAdcodesMainDTO gromoreAdcodes_main;
/**
* groExpress : 946334023
*/
private GromoreAdcodesOuterLockDTO gromoreAdcodes_outer_lock;
/**
* groExpress : 946333992
* groNewInterstitial : 946333773
*/
private GromoreAdcodesOuterOrdinaryDTO gromoreAdcodes_outer_ordinary;
public GromoreAdcodesOrdinaryDTO getGromoreAdcodes_ordinary() {
return gromoreAdcodes_ordinary;
}
public void setGromoreAdcodes_ordinary(GromoreAdcodesOrdinaryDTO gromoreAdcodes_ordinary) {
this.gromoreAdcodes_ordinary = gromoreAdcodes_ordinary;
}
public GromoreAdcodesMainDTO getGromoreAdcodes_main() {
return gromoreAdcodes_main;
}
public void setGromoreAdcodes_main(GromoreAdcodesMainDTO gromoreAdcodes_main) {
this.gromoreAdcodes_main = gromoreAdcodes_main;
}
public GromoreAdcodesOuterLockDTO getGromoreAdcodes_outer_lock() {
return gromoreAdcodes_outer_lock;
}
public void setGromoreAdcodes_outer_lock(GromoreAdcodesOuterLockDTO gromoreAdcodes_outer_lock) {
this.gromoreAdcodes_outer_lock = gromoreAdcodes_outer_lock;
}
public GromoreAdcodesOuterOrdinaryDTO getGromoreAdcodes_outer_ordinary() {
return gromoreAdcodes_outer_ordinary;
}
public void setGromoreAdcodes_outer_ordinary(GromoreAdcodesOuterOrdinaryDTO gromoreAdcodes_outer_ordinary) {
this.gromoreAdcodes_outer_ordinary = gromoreAdcodes_outer_ordinary;
} }
public String getGroSplash() { public static class GromoreAdcodesOrdinaryDTO {
return groSplash; private String groExpress;
private String groNewInterstitial;
public String getGroExpress() {
return groExpress;
}
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
public String getGroNewInterstitial() {
return groNewInterstitial;
}
public void setGroNewInterstitial(String groNewInterstitial) {
this.groNewInterstitial = groNewInterstitial;
}
} }
public String getGroVideo() { public static class GromoreAdcodesMainDTO {
return groVideo; private String groVideo;
private String groInterstitial;
private String groExpress;
private String groSplash;
public String getGroVideo() {
return groVideo;
}
public void setGroVideo(String groVideo) {
this.groVideo = groVideo;
}
public String getGroInterstitial() {
return groInterstitial;
}
public void setGroInterstitial(String groInterstitial) {
this.groInterstitial = groInterstitial;
}
public String getGroExpress() {
return groExpress;
}
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
public String getGroSplash() {
return groSplash;
}
public void setGroSplash(String groSplash) {
this.groSplash = groSplash;
}
} }
public String getGroInterstitial() { public static class GromoreAdcodesOuterLockDTO {
return groInterstitial; private String groExpress;
public String getGroExpress() {
return groExpress;
}
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
} }
public static class GromoreAdcodesOuterOrdinaryDTO {
private String groExpress;
private String groNewInterstitial;
public String getGroExpress() {
return groExpress;
}
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
public String getGroNewInterstitial() {
return groNewInterstitial;
}
public void setGroNewInterstitial(String groNewInterstitial) {
this.groNewInterstitial = groNewInterstitial;
}
}
} }
...@@ -83,7 +83,7 @@ class ApkActivity : BaseActivity() { ...@@ -83,7 +83,7 @@ class ApkActivity : BaseActivity() {
// 一键清理 // 一键清理
val bundle = Bundle() val bundle = Bundle()
bundle.putInt(Constant.SCAN_TYPE, 5) bundle.putInt(Constant.SCAN_TYPE, 5)
readyGo(CleanActivity::class.java, bundle) readyGoThenKill(CleanActivity::class.java, bundle)
} }
} }
......
...@@ -12,7 +12,7 @@ import android.view.View ...@@ -12,7 +12,7 @@ import android.view.View
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.PreLoadExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.video.VideoAdingManager import com.mints.flowbox.ad.video.VideoAdingManager
import com.mints.flowbox.common.AppConfig import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
...@@ -465,15 +465,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -465,15 +465,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
AppConfig.gromoreId = "" AppConfig.gromoreId = ""
try { ExpressManager.loadExpress(true)
PreLoadExpressManager.loadADFrameLayout()
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
SoundPoolUtil.getInstance().onDestory() SoundPoolUtil.getInstance().onDestory()
PreLoadExpressManager.onDestroy()
flAwardAd?.removeAllViews() flAwardAd?.removeAllViews()
videoAdingManager.setVideoAdingListener(null) videoAdingManager.setVideoAdingListener(null)
videoAdingManager.onDestroy() videoAdingManager.onDestroy()
...@@ -748,7 +742,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -748,7 +742,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
try { try {
if (flAwardAd != null) { if (flAwardAd != null) {
flAwardAd.removeAllViews() flAwardAd.removeAllViews()
flAwardAd.addView(PreLoadExpressManager.getADFrameLayout()) flAwardAd.addView(ExpressManager.getExpressFrameLayout())
if (AppConfig.isPreExpressAwardActivity) { if (AppConfig.isPreExpressAwardActivity) {
flAwardAd.post { flAwardAd.post {
...@@ -768,7 +762,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -768,7 +762,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
if (flAwardAd.height > 0 && flAwardAd.width > 0) { if (flAwardAd.height > 0 && flAwardAd.width > 0) {
ivRootAwardAd.visibility = View.VISIBLE ivRootAwardAd.visibility = View.VISIBLE
if (!AwardActivity@ this.isFinishing) { if (!this.isFinishing) {
Glide.with(applicationContext).asGif() Glide.with(applicationContext).asGif()
.load(R.drawable.bg_award_effect).into(ivRootAwardAd) .load(R.drawable.bg_award_effect).into(ivRootAwardAd)
} }
......
package com.mints.flowbox.ui.activitys package com.mints.flowbox.ui.activitys
import android.app.ActivityManager import android.app.ActivityManager
import android.app.KeyguardManager
import android.content.Context import android.content.Context
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.View import android.view.View
import android.view.WindowManager
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.keepalive.AlarmManager import com.mints.flowbox.keepalive.AlarmManager
...@@ -21,8 +18,22 @@ import kotlinx.android.synthetic.main.activity_boost.* ...@@ -21,8 +18,22 @@ import kotlinx.android.synthetic.main.activity_boost.*
*/ */
class BoostActivity : BaseActivity() { class BoostActivity : BaseActivity() {
companion object {
// 是否是定时器逻辑
const val IS_FROM_ALARM = "IS_FROM_ALARM"
}
private var mActivityManager: ActivityManager? = null private var mActivityManager: ActivityManager? = null
private var mIsFromAlarm = false
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
mIsFromAlarm = it.getBoolean(IS_FROM_ALARM, false)
}
}
override fun getContentViewLayoutID() = R.layout.activity_boost override fun getContentViewLayoutID() = R.layout.activity_boost
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
...@@ -31,23 +42,20 @@ class BoostActivity : BaseActivity() { ...@@ -31,23 +42,20 @@ class BoostActivity : BaseActivity() {
finish() finish()
overridePendingTransition(0, 0) overridePendingTransition(0, 0)
} }
}
override fun onCreate(savedInstanceState: Bundle?) { Handler(Looper.getMainLooper()).postDelayed({
window.addFlags( finish()
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED overridePendingTransition(0, 0)
or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD }, 5000)
or WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
or WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
)
super.onCreate(savedInstanceState)
} }
override fun isApplyKitKatTranslucency() = true override fun isApplyKitKatTranslucency() = true
override fun finish() { override fun finish() {
super.finish() super.finish()
AlarmManager.getInstance().resetUserActionTime() if (mIsFromAlarm) {
AlarmManager.getInstance().resetUserActionTime()
}
} }
override fun onResume() { override fun onResume() {
...@@ -70,14 +78,9 @@ class BoostActivity : BaseActivity() { ...@@ -70,14 +78,9 @@ class BoostActivity : BaseActivity() {
} }
} }
override fun onDestroy() {
// 预加载信息流
ExpressManager.loadExpress()
super.onDestroy()
}
private fun cleanMemory() { private fun cleanMemory() {
ExpressManager.loadAppOutExpress()
ccav_speed.startAnimation() ccav_speed.startAnimation()
Handler(Looper.getMainLooper()).postDelayed( Handler(Looper.getMainLooper()).postDelayed(
{ {
......
...@@ -43,6 +43,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -43,6 +43,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
* Step5: 扫描安装包 * Step5: 扫描安装包
*/ */
companion object {
// 定时器间隔时间
const val STEP_Interval = 2000L
}
private val typeArr = arrayOf("运行程序", "系统缓存", "临时文件", "广告垃圾", "安装包") private val typeArr = arrayOf("运行程序", "系统缓存", "临时文件", "广告垃圾", "安装包")
// 扫描类型 // 扫描类型
...@@ -163,7 +168,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -163,7 +168,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
tvClean.text = tvClean.text =
SpanUtils() SpanUtils()
.append("检测到您的后台软件共运行\n\n") .append("检测到您的后台软件共运行\n")
.append("" + mCleanList[0].childList.size) .append("" + mCleanList[0].childList.size)
.setForegroundColor( .setForegroundColor(
ContextCompat.getColor( ContextCompat.getColor(
...@@ -187,7 +192,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -187,7 +192,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}).execute() }).execute()
} }
} }
}, 1000, (1000 * 2).toLong()) }, 200, STEP_Interval)
} }
/** 开始清理 */ /** 开始清理 */
...@@ -270,14 +275,14 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -270,14 +275,14 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
// } // }
} }
} }
}, 1000, 1000.toLong()) }, 200, STEP_Interval)
} }
private fun toResult() { private fun toResult() {
AppConfig.isCanClean = false AppConfig.isCanClean = false
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(false)
val bundle = Bundle() val bundle = Bundle()
bundle.putString( bundle.putString(
...@@ -380,13 +385,13 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -380,13 +385,13 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setOnClickListener(this) iv_left_icon.setOnClickListener(this)
btnClean.setOnClickListener(this) btnClean.setOnClickListener(this)
if (scanMax == 1) { // if (scanMax == 1) {
ivClean.visibility = View.GONE // ivClean.visibility = View.GONE
tvClean.visibility = View.VISIBLE // tvClean.visibility = View.VISIBLE
} else { // } else {
ivClean.visibility = View.VISIBLE // ivClean.visibility = View.VISIBLE
tvClean.visibility = View.GONE // tvClean.visibility = View.GONE
} // }
} }
private fun remove(groupPosition: Int, removeIndex: Int, removeChildInfo: ChildInfo?) { private fun remove(groupPosition: Int, removeIndex: Int, removeChildInfo: ChildInfo?) {
......
...@@ -89,7 +89,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -89,7 +89,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
} }
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
} }
......
...@@ -41,12 +41,15 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -41,12 +41,15 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
const val INCREASE2_TYPE = "INCREASE_TYPE" // TYPE const val INCREASE2_TYPE = "INCREASE_TYPE" // TYPE
const val INCREASE2_WIFI_BOOST = "WIFI_BOOST" // wifi加速 const val INCREASE2_WIFI_BOOST = "WIFI_BOOST" // wifi加速
const val INCREASE2_SAFE_CHECK = "SAFE_CHECK" // 安全检测 const val INCREASE2_SAFE_CHECK = "SAFE_CHECK" // 安全检测
// 定时器间隔时间
const val STEP_Interval = 300L
} }
private val mStringArr1 = mutableListOf( private val mStringArr1 = mutableListOf(
"检测结果WiFi加密安全性", "检测结果WiFi加密安全性",
"检查ARP网络攻击异常", "检查ARP网络攻击异常",
"提升DNS劫持安全性", "提升DNS劫持安STEP_Interval全性",
"部署网页防篡改", "部署网页防篡改",
"加固链路,避免SSL中间人攻击", "加固链路,避免SSL中间人攻击",
"检测是否钓鱼WiFi" "检测是否钓鱼WiFi"
...@@ -100,10 +103,10 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -100,10 +103,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 mTimerMax = 10
NumAnimUtil.startAnim(tv_progress, 100f, ((mTimerMax - 4) * STEP_Interval))
} }
mTimer = Timer() mTimer = Timer()
...@@ -134,7 +137,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -134,7 +137,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
} }
} }
} }
}, 100, 300) }, 200, STEP_Interval)
} }
private fun initView() { private fun initView() {
...@@ -211,8 +214,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener { ...@@ -211,8 +214,6 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
mWifiAdManager = null mWifiAdManager = null
fl_ad?.removeAllViews() fl_ad?.removeAllViews()
// 预加载信息流
ExpressManager.loadExpress()
super.onDestroy() super.onDestroy()
} }
......
...@@ -5,20 +5,24 @@ import android.os.Bundle ...@@ -5,20 +5,24 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.text.Spannable import android.text.Spannable
import android.text.TextUtils
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.wifi.WifiAdManager import com.mints.flowbox.ad.wifi.WifiAdManager
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.common.Constant
import com.mints.flowbox.manager.AppPreferencesManager
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.ui.widgets.seekbar.BubbleUtils
import com.mints.flowbox.utils.SpanUtils import com.mints.flowbox.utils.SpanUtils
import com.mints.library.utils.CommonUtils
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.*
import kotlinx.android.synthetic.main.activity_increasespeed.container import kotlinx.android.synthetic.main.activity_increasespeed.container
...@@ -42,6 +46,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -42,6 +46,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
const val INCREASE_BOOST = "BOOST" // 一键加速 const val INCREASE_BOOST = "BOOST" // 一键加速
const val INCREASE_CLEAN = "CLEAN" // 一键清理 const val INCREASE_CLEAN = "CLEAN" // 一键清理
const val INCREASE_SAVE_ELECTRICITY = "SAVE_ELECTRICITY" // 超强省电 const val INCREASE_SAVE_ELECTRICITY = "SAVE_ELECTRICITY" // 超强省电
// 定时器间隔时间
const val STEP_Interval = 300L
} }
private var mWifiAdManager: WifiAdManager? = null private var mWifiAdManager: WifiAdManager? = null
...@@ -88,44 +95,80 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -88,44 +95,80 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
} }
}) })
// if (mIncreaseType == INCREASE_BOOST && AppConfig.isCanBoost) { if (mIncreaseType == INCREASE_BOOST && AppConfig.isCanBoost) {
if (mIncreaseType == INCREASE_BOOST) { // if (mIncreaseType == INCREASE_BOOST) {
startTimer() startTimer()
// } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) { } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) {
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) { // } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) {
startTimer() startTimer()
mTimerMax = 11 mTimerMax = 11
// } else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) { } else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) {
} else if (mIncreaseType == INCREASE_CLEAN) { // } else if (mIncreaseType == INCREASE_CLEAN) {
startTimer() startTimer()
mTimerMax = 14 mTimerMax = 14
} else { } else {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告 // 动画结束后 展示插屏广告
mWifiAdManager?.showInterstitial() mWifiAdManager?.showInterstitial()
showFirstGive()
}, 3000) }, 3000)
} }
initView() initView()
} }
private fun showFirstGive() {
// 新人福利
if (AppConfig.isShowFirstGive) {
// 游客首次提示1500新人奖励 且 不是分享包
val channel = CommonUtils.getAppMetaData(
MintsApplication.getContext(),
"CHANNEL_NAME"
)
if (!TextUtils.equals(
channel,
Constant.CHANNEL_SHARE
) && AppPreferencesManager.get().getBoolean(
Constant.FIRST_VISITOR_FLAG,
true
)
) {
AppPreferencesManager.get().put(Constant.FIRST_VISITOR_FLAG, false)
val bundle = Bundle()
bundle.putInt(
Constant.MAIN_CUR_COIN,
AppConfig.firstGiveCoin
)
bundle.putString(
Constant.MAIN_CARRIER_TYPE,
Constant.CARRIER_NEW_VISITOR
)
readyGo(AwardActivity::class.java, bundle)
}
}
}
private fun startTimer() { private fun startTimer() {
container.visibility = View.GONE container.visibility = View.GONE
containerAnim.visibility = View.VISIBLE containerAnim.visibility = View.VISIBLE
var step = 0 var step = 0
if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) { when (mIncreaseType) {
containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main)) INCREASE_SAVE_ELECTRICITY -> {
iv_gif.layoutParams.width = BubbleUtils.dp2px(200) containerAnim.setBackgroundColor(ContextCompat.getColor(this, R.color.color_main))
GlideUtils.loadImageViewGif(this, R.drawable.battery, iv_gif) iv_gif.layoutParams.width = BubbleUtils.dp2px(200)
} else if (mIncreaseType == INCREASE_CLEAN) { GlideUtils.loadImageViewGif(this, R.drawable.battery, iv_gif)
containerAnim.setBackgroundColor(Color.parseColor("#906cf4")) }
GlideUtils.loadImageViewGif(this, R.drawable.rubbish, iv_gif) INCREASE_CLEAN -> {
} else { containerAnim.setBackgroundColor(Color.parseColor("#906cf4"))
containerAnim.setBackgroundColor(Color.parseColor("#906cf4")) GlideUtils.loadImageViewGif(this, R.drawable.rubbish, iv_gif)
GlideUtils.loadImageViewGif(this, R.drawable.rocket_anim, iv_gif) }
tv_progress.text = "正在检测后台常驻软件..." else -> {
containerAnim.setBackgroundColor(Color.parseColor("#906cf4"))
GlideUtils.loadImageViewGif(this, R.drawable.rocket_anim, iv_gif)
tv_progress.text = "正在检测后台常驻软件..."
}
} }
mTimer = Timer() mTimer = Timer()
...@@ -154,6 +197,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -154,6 +197,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告 // 动画结束后 展示插屏广告
mWifiAdManager?.showInterstitial() mWifiAdManager?.showInterstitial()
showFirstGive()
}, 3000) }, 3000)
container.visibility = View.VISIBLE container.visibility = View.VISIBLE
} else if (step == mTimerMax) { } else if (step == mTimerMax) {
...@@ -162,7 +206,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -162,7 +206,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
} }
} }
} }
}, 100, 300) }, 200, STEP_Interval)
} }
private fun initView() { private fun initView() {
...@@ -256,8 +300,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener { ...@@ -256,8 +300,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
mWifiAdManager = null mWifiAdManager = null
fl_ad?.removeAllViews() fl_ad?.removeAllViews()
// 预加载信息流
ExpressManager.loadExpress()
super.onDestroy() super.onDestroy()
} }
......
...@@ -28,6 +28,7 @@ import com.mints.flowbox.ui.fragment.* ...@@ -28,6 +28,7 @@ import com.mints.flowbox.ui.fragment.*
import com.mints.flowbox.ui.widgets.dialog.DialogListener import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.PowerDialog import com.mints.flowbox.ui.widgets.dialog.PowerDialog
import com.mints.flowbox.utils.WifiUtils import com.mints.flowbox.utils.WifiUtils
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
...@@ -365,29 +366,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -365,29 +366,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 数美初始化 // 数美初始化
ShumeiManager.getInstance().initShumei() ShumeiManager.getInstance().initShumei()
// // 游客首次提示1500新人奖励 且 不是分享包
// val channel = CommonUtils.getAppMetaData(
// MintsApplication.getContext(),
// "CHANNEL_NAME"
// )
// if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && AppPreferencesManager.get().getBoolean(
// Constant.FIRST_VISITOR_FLAG,
// true
// )
// ) {
// AppPreferencesManager.get().put(Constant.FIRST_VISITOR_FLAG, false)
// val bundle = Bundle()
// bundle.putInt(
// Constant.MAIN_CUR_COIN,
// if (userMsgBean != null && userMsgBean!!.userMsg.showCoin > 0) userMsgBean?.userMsg?.showCoin!! else 1500
// )
// bundle.putString(
// Constant.MAIN_CARRIER_TYPE,
// Constant.CARRIER_NEW_VISITOR
// )
// readyGo(AwardActivity::class.java, bundle)
// }
} }
} }
} }
...@@ -464,20 +442,17 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -464,20 +442,17 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 是否上报点击广告 // 是否上报点击广告
AppConfig.needReportClickAdEvent = data.isNeedReportClickAdEvent AppConfig.needReportClickAdEvent = data.isNeedReportClickAdEvent
// 新人福利
if (data.userMsg.firstGiveCoin > 0) { if (data.userMsg.firstGiveCoin > 0) {
AppConfig.isShowFirstGive = true
AppConfig.firstGiveCoin = data.userMsg.firstGiveCoin
}
// 离线收益
if (data.offlineBean.offlineIncome > 0) {
val bundle = Bundle() val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, data.userMsg.firstGiveCoin) bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_NEW_USER) bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE)
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
} else {
// 离线收益
if (data.offlineBean.offlineIncome > 0) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE)
readyGo(AwardActivity::class.java, bundle)
}
} }
} }
......
...@@ -40,6 +40,8 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener { ...@@ -40,6 +40,8 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
} }
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
ExpressManager.loadAppOutExpress()
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
mHelper.swipeBackLayout.setEdgeSize(ToolUtil.getScreenWidth(this)) mHelper.swipeBackLayout.setEdgeSize(ToolUtil.getScreenWidth(this))
mHelper.swipeBackLayout.setTopEdgeSize( mHelper.swipeBackLayout.setTopEdgeSize(
...@@ -67,7 +69,7 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener { ...@@ -67,7 +69,7 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(false)
when (v?.id) { when (v?.id) {
R.id.tvBoost -> { R.id.tvBoost -> {
...@@ -111,13 +113,6 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener { ...@@ -111,13 +113,6 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
} }
} }
override fun onDestroy() {
// 预加载信息流
ExpressManager.loadExpress()
super.onDestroy()
}
override fun onNetworkConnected(type: NetUtils.NetType?) {} override fun onNetworkConnected(type: NetUtils.NetType?) {}
override fun onNetworkDisConnected() {} override fun onNetworkDisConnected() {}
......
...@@ -164,7 +164,7 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener { ...@@ -164,7 +164,7 @@ class SpeedFastActivity : BaseActivity(), View.OnClickListener {
fl_ad?.removeAllViews() fl_ad?.removeAllViews()
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(false)
super.onDestroy() super.onDestroy()
} }
} }
...@@ -6,6 +6,8 @@ import android.animation.ObjectAnimator ...@@ -6,6 +6,8 @@ import android.animation.ObjectAnimator
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Dialog import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
...@@ -62,7 +64,9 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener { ...@@ -62,7 +64,9 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
if (step == 5) { if (step == 5) {
DownloadApkManager.instance.destroy() DownloadApkManager.instance.destroy()
endTest() Handler(Looper.getMainLooper()).postDelayed({
endTest()
}, 500)
} }
} }
}, 0, 1000) }, 0, 1000)
......
...@@ -17,7 +17,6 @@ import com.mints.flowbox.MintsApplication; ...@@ -17,7 +17,6 @@ import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.R; import com.mints.flowbox.R;
import com.mints.flowbox.common.Constant; import com.mints.flowbox.common.Constant;
import com.mints.flowbox.common.DeviceInfo; import com.mints.flowbox.common.DeviceInfo;
import com.mints.flowbox.manager.AppPreferencesManager;
import com.mints.flowbox.manager.CsjGroMoreManager; import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.TrackManager; import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.TtCsjAdManager; import com.mints.flowbox.manager.TtCsjAdManager;
...@@ -79,7 +78,7 @@ public class SplashGroMoreActivity extends BaseActivity { ...@@ -79,7 +78,7 @@ public class SplashGroMoreActivity extends BaseActivity {
* 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题 * 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题
* ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);) * ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);)
*/ */
mTTSplashAd = new TTSplashAd(this, CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID()); mTTSplashAd = new TTSplashAd(this, CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_SPLASH_ID());
mTTSplashAd.setTTAdSplashListener(mSplashAdListener); mTTSplashAd.setTTAdSplashListener(mSplashAdListener);
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档 //step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
...@@ -126,7 +125,7 @@ public class SplashGroMoreActivity extends BaseActivity { ...@@ -126,7 +125,7 @@ public class SplashGroMoreActivity extends BaseActivity {
vo.put("ecpm", mTTSplashAd.getPreEcpm()); vo.put("ecpm", mTTSplashAd.getPreEcpm());
vo.put("adSource", mTTSplashAd.getAdNetworkPlatformId()); vo.put("adSource", mTTSplashAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE0); vo.put("adType", Constant.GRO_MORE_ADTYPE0);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID()); vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_SPLASH_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo); TrackManager.getInstance().cmtGroMoreInfo(vo);
} }
LogUtil.d(TAG, "load splash ad success "); LogUtil.d(TAG, "load splash ad success ");
......
...@@ -69,7 +69,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity { ...@@ -69,7 +69,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity {
* 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题 * 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题
* ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);) * ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);)
*/ */
mTTSplashAd = new TTSplashAd(this, CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID()); mTTSplashAd = new TTSplashAd(this, CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_SPLASH_ID());
mTTSplashAd.setTTAdSplashListener(mSplashAdListener); mTTSplashAd.setTTAdSplashListener(mSplashAdListener);
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档 //step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
...@@ -91,7 +91,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity { ...@@ -91,7 +91,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity {
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理 //step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
mTTSplashAd.loadAd(adSlot, ttNetworkRequestInfo, new TTSplashAdLoadCallback() { mTTSplashAd.loadAd(adSlot, ttNetworkRequestInfo, new TTSplashAdLoadCallback() {
// mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() { // mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() {
@Override @Override
public void onSplashAdLoadFail(AdError adError) { public void onSplashAdLoadFail(AdError adError) {
LogUtil.d(TAG, adError.message); LogUtil.d(TAG, adError.message);
...@@ -116,7 +116,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity { ...@@ -116,7 +116,7 @@ public class SplashGroMoreBackgroundActivity extends BaseActivity {
vo.put("ecpm", mTTSplashAd.getPreEcpm()); vo.put("ecpm", mTTSplashAd.getPreEcpm());
vo.put("adSource", mTTSplashAd.getAdNetworkPlatformId()); vo.put("adSource", mTTSplashAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE0); vo.put("adType", Constant.GRO_MORE_ADTYPE0);
vo.put("adid", CsjGroMoreManager.INSTANCE.getAD_UNIT_SPLASH_ID()); vo.put("adid", CsjGroMoreManager.INSTANCE.getAPP_IN_MAIN_AD_UNIT_SPLASH_ID());
TrackManager.getInstance().cmtGroMoreInfo(vo); TrackManager.getInstance().cmtGroMoreInfo(vo);
} }
Log.e(TAG, "load splash ad success "); Log.e(TAG, "load splash ad success ");
......
...@@ -100,7 +100,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -100,7 +100,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
} }
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
} }
/** /**
......
...@@ -71,7 +71,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL ...@@ -71,7 +71,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
} }
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
} }
override fun clickForWaterSuc(waterCoin: Int) { override fun clickForWaterSuc(waterCoin: Int) {
......
...@@ -56,7 +56,6 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View. ...@@ -56,7 +56,6 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
private var signData = mutableListOf<SignRedbagsBean.RedbagsDTO>() private var signData = mutableListOf<SignRedbagsBean.RedbagsDTO>()
private var gvSignAdapter: GvSignAdapter? = null private var gvSignAdapter: GvSignAdapter? = null
private var isButtonCanClick = false
private var todayMoney = 0 private var todayMoney = 0
private var allMoney = 0 private var allMoney = 0
...@@ -202,7 +201,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View. ...@@ -202,7 +201,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
} }
// 当天是否可签到 // 当天是否可签到
isButtonCanClick = data.isButtonCanClick btn_sign.isEnabled = data.isButtonCanClick
btn_sign.text = data.buttonText btn_sign.text = data.buttonText
......
...@@ -118,15 +118,22 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -118,15 +118,22 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
refreshData() refreshData()
if (bubbleCount == 0) {
wifi_view.wifiOn() wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOn()
}
tvContent.text = "每天签到最高可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包" tvContent.text = "每天签到最高可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
} }
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
wifi_view.wifiOff() if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOff()
}
} }
/** 刷新数据 **/ /** 刷新数据 **/
...@@ -152,12 +159,20 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -152,12 +159,20 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun getContentViewLayoutID() = R.layout.fragment_home override fun getContentViewLayoutID() = R.layout.fragment_home
override fun onWifiOpen() { override fun onWifiOpen() {
wifi_view.wifiOn() if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOn()
}
bg_view.setBackgroundResource(R.mipmap.bg_home_enable) bg_view.setBackgroundResource(R.mipmap.bg_home_enable)
} }
override fun onWifiClose() { override fun onWifiClose() {
wifi_view.wifiOff() if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOff()
}
bg_view.setBackgroundResource(R.mipmap.bg_home_unenable) bg_view.setBackgroundResource(R.mipmap.bg_home_unenable)
} }
...@@ -210,7 +225,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -210,7 +225,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
// wifi提速 // wifi提速
R.id.btn_speed_fast -> { R.id.btn_speed_fast -> {
// 预加载信息流 // 预加载信息流
ExpressManager.loadExpress() ExpressManager.loadExpress(false)
readyGo(SpeedFastActivity::class.java) readyGo(SpeedFastActivity::class.java)
} }
...@@ -311,22 +326,22 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback, ...@@ -311,22 +326,22 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
// 自有界面 // 自有界面
when (hotBean.toUrl) { when (hotBean.toUrl) {
Constant.HOT_ACTIVITY_WATER -> { Constant.HOT_ACTIVITY_WATER -> {
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
readyGo(WaterActivity::class.java) readyGo(WaterActivity::class.java)
} }
Constant.HOT_ACTIVITY_WALK -> { Constant.HOT_ACTIVITY_WALK -> {
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
readyGo(WalkActivity::class.java) readyGo(WalkActivity::class.java)
} }
Constant.HOT_ACTIVITY_CARD -> { Constant.HOT_ACTIVITY_CARD -> {
readyGo(EraseActivity::class.java) readyGo(EraseActivity::class.java)
} }
Constant.HOT_ACTIVITY_MORNINGCLOCK -> { Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
readyGo(MorningClockActivity::class.java) readyGo(MorningClockActivity::class.java)
} }
Constant.HOT_ACTIVITY_EAT -> { Constant.HOT_ACTIVITY_EAT -> {
ExpressManager.loadExpress() ExpressManager.loadExpress(true)
readyGo(FoodSubsidyActivity::class.java) readyGo(FoodSubsidyActivity::class.java)
} }
Constant.HOT_ACTIVITY_SHARE_NEWS -> { Constant.HOT_ACTIVITY_SHARE_NEWS -> {
......
...@@ -698,7 +698,6 @@ class MyFragment : BaseFragment(), ...@@ -698,7 +698,6 @@ class MyFragment : BaseFragment(),
} }
private fun initManager() { private fun initManager() {
BannerManager.instance.init()
videoAdingManager = VideoAdingManager.getInstance(activity) videoAdingManager = VideoAdingManager.getInstance(activity)
} }
......
...@@ -119,7 +119,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick ...@@ -119,7 +119,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
insertScreenAdManager = InsertScreenAdManager() insertScreenAdManager = InsertScreenAdManager()
insertScreenAdManager?.setInsertScreenAdStatusListener(object : insertScreenAdManager?.setInsertScreenAdStatusListener(object :
WifiAdStatusListener { WifiAdStatusListener {
override fun adSuccess() { override fun adSuccess() {
try { try {
if (turnTableData?.surplus!! <= 0) { if (turnTableData?.surplus!! <= 0) {
...@@ -349,7 +349,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick ...@@ -349,7 +349,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
MobclickAgent.onEvent(activity!!, Constant.CARRIER_CHALLENGE_TURN, map) MobclickAgent.onEvent(activity!!, Constant.CARRIER_CHALLENGE_TURN, map)
if (insertScreenAdManager == null) insertScreenAdManager = InsertScreenAdManager() if (insertScreenAdManager == null) insertScreenAdManager = InsertScreenAdManager()
insertScreenAdManager?.loadInterstitial(requireActivity()) insertScreenAdManager?.loadInterstitial(requireActivity(), true)
turnTableView.startRotate(1) turnTableView.startRotate(1)
awardVedio() awardVedio()
......
...@@ -33,8 +33,8 @@ class CircleCleanAnimationView @JvmOverloads constructor( ...@@ -33,8 +33,8 @@ class CircleCleanAnimationView @JvmOverloads constructor(
private var im_out: ImageView? = null//中心图片控件 private var im_out: ImageView? = null//中心图片控件
private var rotateAnimation: RotateAnimation? = null //旋转动画 private var rotateAnimation: RotateAnimation? = null //旋转动画
private var scaleAnimation: ScaleAnimation? = null//放大缩小动画 private var scaleAnimation: ScaleAnimation? = null//放大缩小动画
private val imageCenterWidth = 400 //中心图片的宽度 private val imageCenterWidth = 300 //中心图片的宽度
private val imageCenterHeight = 400 //中心图片的高度 private val imageCenterHeight = 300 //中心图片的高度
private val LineStrokeWidth = 8 //线框的宽度 private val LineStrokeWidth = 8 //线框的宽度
private fun init( private fun init(
......
...@@ -112,6 +112,11 @@ public class CycleProgress extends View { ...@@ -112,6 +112,11 @@ public class CycleProgress extends View {
mProgressPaint.setXfermode(null); mProgressPaint.setXfermode(null);
} }
public void setComplete() {
mProgressWidth = mViewWidth;
invalidate();
}
/** /**
* 0--1 * 0--1
*/ */
......
...@@ -144,6 +144,18 @@ public class WifiView extends FrameLayout implements View.OnClickListener { ...@@ -144,6 +144,18 @@ public class WifiView extends FrameLayout implements View.OnClickListener {
tvPlaceholder.setVisibility(View.INVISIBLE); tvPlaceholder.setVisibility(View.INVISIBLE);
} }
public void wifiOnAndNoBonus() {
progressBar.setVisibility(View.VISIBLE);
tvTitle.setVisibility(View.VISIBLE);
tvInfo.setVisibility(View.VISIBLE);
tvPlaceholder.setVisibility(View.INVISIBLE);
setTitle("WIFI已连接");
tvInfo.setText("今日流量补贴金额已达到上限");
progressBar.setComplete();
}
public void wifiOff() { public void wifiOff() {
progressBar.pauseAnim(); progressBar.pauseAnim();
setTitle("WIFI已关闭"); setTitle("WIFI已关闭");
......
...@@ -8,6 +8,7 @@ import android.content.Intent; ...@@ -8,6 +8,7 @@ import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.provider.Settings;
import android.util.Log; import android.util.Log;
import com.mints.flowbox.MintsApplication; import com.mints.flowbox.MintsApplication;
...@@ -70,12 +71,12 @@ public class IntentUtils { ...@@ -70,12 +71,12 @@ public class IntentUtils {
} }
/** /**
* 判断vivo后台弹出界面 1未开启 0开启 * 判断vivo后台弹出界面 false未开启 true开启
* *
* @param context * @param context
* @return * @return
*/ */
public static int getvivoBgStartActivityPermissionStatus(Context context) { public static boolean getvivoBgStartActivityPermissionStatus(Context context) {
String packageName = context.getPackageName(); String packageName = context.getPackageName();
Uri uri2 = Uri.parse("content://com.vivo.permissionmanager.provider.permission/start_bg_activity"); Uri uri2 = Uri.parse("content://com.vivo.permissionmanager.provider.permission/start_bg_activity");
String selection = "pkgname = ?"; String selection = "pkgname = ?";
...@@ -88,16 +89,16 @@ public class IntentUtils { ...@@ -88,16 +89,16 @@ public class IntentUtils {
if (cursor.moveToFirst()) { if (cursor.moveToFirst()) {
int currentmode = cursor.getInt(cursor.getColumnIndex("currentstate")); int currentmode = cursor.getInt(cursor.getColumnIndex("currentstate"));
cursor.close(); cursor.close();
return currentmode; return currentmode == 0;
} else { } else {
cursor.close(); cursor.close();
return 1; return false;
} }
} }
} catch (Throwable throwable) { } catch (Throwable throwable) {
throwable.printStackTrace(); throwable.printStackTrace();
} }
return 1; return false;
} }
/** /**
...@@ -132,13 +133,17 @@ public class IntentUtils { ...@@ -132,13 +133,17 @@ public class IntentUtils {
} }
public static void startActivity(Activity activity, Intent intent) { public static void startActivity(Activity activity, Intent intent) {
if (!isRunningForeground(activity)) { if (isAllowedBackPopPermission(activity) | getvivoBgStartActivityPermissionStatus(activity)) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { if (!isRunningForeground(activity)) {
moveToFront(activity); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
MintsApplication.getContext().startActivity(intent); moveToFront(activity);
activity.moveTaskToBack(true); MintsApplication.getContext().startActivity(intent);
activity.moveTaskToBack(true);
} else {
NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent);
}
} else { } else {
NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent); MintsApplication.getContext().startActivity(intent);
} }
} else { } else {
MintsApplication.getContext().startActivity(intent); MintsApplication.getContext().startActivity(intent);
...@@ -170,4 +175,12 @@ public class IntentUtils { ...@@ -170,4 +175,12 @@ public class IntentUtils {
} }
} }
/**
* 跳转GPS设置
*/
public static void openGPSSettings(Context context) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
context.startActivity(intent);
}
} }
...@@ -5,6 +5,7 @@ import android.content.Context; ...@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
...@@ -165,7 +166,7 @@ public class PermissionUtils { ...@@ -165,7 +166,7 @@ public class PermissionUtils {
try { try {
Class localClass = Class.forName("android.content.Context"); Class localClass = Class.forName("android.content.Context");
Method localMethod = localClass.getMethod("checkSelfPermission", String.class); Method localMethod = localClass.getMethod("checkSelfPermission", String.class);
int i = (Integer)localMethod.invoke(paramContext, paramString); int i = (Integer) localMethod.invoke(paramContext, paramString);
bool = i == 0; bool = i == 0;
} catch (Throwable var6) { } catch (Throwable var6) {
bool = false; bool = false;
...@@ -180,4 +181,22 @@ public class PermissionUtils { ...@@ -180,4 +181,22 @@ public class PermissionUtils {
return bool; return bool;
} }
} }
/**
* 判断是否打开网络定位
*
* @param context 用于获取LocationManager
* @return true/false
*/
public static boolean isOpenGps(Context context) {
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null) {
//这里只判断了是否开启网络定位
//还有GPS定位 LocationManager.GPS_PROVIDER
return locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} else {
return false;
}
}
} }
...@@ -2,6 +2,7 @@ package com.mints.flowbox.utils; ...@@ -2,6 +2,7 @@ package com.mints.flowbox.utils;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.location.LocationManager;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.net.wifi.ScanResult; import android.net.wifi.ScanResult;
...@@ -51,6 +52,10 @@ public class WifiUtils { ...@@ -51,6 +52,10 @@ public class WifiUtils {
private WifiManager wifiManager; private WifiManager wifiManager;
public void startScan() {
wifiManager.startScan();
}
/** /**
* wifi是否打开 * wifi是否打开
* *
...@@ -282,4 +287,20 @@ public class WifiUtils { ...@@ -282,4 +287,20 @@ public class WifiUtils {
} }
return "UNKNOWN"; return "UNKNOWN";
} }
public String getCipherTypeByCapa(String capabilities) {
if (!TextUtils.isEmpty(capabilities)) {
if (capabilities.contains("WPA") || capabilities.contains("wpa")) {
if (capabilities.contains("WPA2") || capabilities.contains("wpa2")) {
return "WPA2 PSK";
}
return "WPA PSK";
} else if (capabilities.contains("WEP") || capabilities.contains("wep")) {
return "WEP";
} else {
return "UNKNOWN";
}
}
return "UNKNOWN";
}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient <gradient
android:angle="270"
android:endColor="#C9C3FF" android:endColor="#C9C3FF"
android:startColor="#AFA6FF" /> android:startColor="#AFA6FF" />
......
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
android:background="@drawable/shape_btn_gold_left" android:background="@drawable/shape_btn_gold_left"
android:drawablePadding="4dp" android:drawablePadding="4dp"
android:gravity="center" android:gravity="center"
android:paddingLeft="10dp" android:paddingLeft="12dp"
android:paddingTop="10dp" android:paddingTop="8dp"
android:paddingRight="10dp" android:paddingRight="12dp"
android:paddingBottom="10dp" android:paddingBottom="8dp"
android:text="领取金币" android:text="领取金币"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" android:textSize="14sp"
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp"
android:textSize="12sp" android:textSize="12sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -115,6 +116,7 @@ ...@@ -115,6 +116,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp"
android:textSize="12sp" android:textSize="12sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -177,8 +179,8 @@ ...@@ -177,8 +179,8 @@
android:id="@+id/flAwardAd" android:id="@+id/flAwardAd"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_bg_award_gray_bottom" android:layout_gravity="center"
android:layout_gravity="center" /> android:background="@drawable/shape_bg_award_gray_bottom" />
<ImageView <ImageView
android:id="@+id/ivRootAwardAd" android:id="@+id/ivRootAwardAd"
...@@ -186,7 +188,7 @@ ...@@ -186,7 +188,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:scaleType="fitXY" android:scaleType="fitXY"
android:visibility="gone"></ImageView> android:visibility="gone" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -15,22 +15,23 @@ ...@@ -15,22 +15,23 @@
<ImageView <ImageView
android:id="@+id/ivClean" android:id="@+id/ivClean"
android:layout_width="wrap_content" android:layout_width="100dp"
android:layout_height="wrap_content" android:layout_height="100dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp" android:layout_marginTop="10dp"
android:src="@mipmap/ic_clean" /> android:src="@mipmap/ic_clean"
android:visibility="visible" />
<TextView <TextView
android:id="@+id/tvClean" android:id="@+id/tvClean"
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="50dp" android:layout_marginTop="120dp"
android:gravity="center" android:gravity="center"
android:text="正在扫描您的手机..." android:text="正在扫描您的手机..."
android:textColor="@color/white" android:textColor="@color/white"
android:visibility="gone" /> android:visibility="visible" />
<ExpandableListView <ExpandableListView
android:id="@+id/elv_clean" android:id="@+id/elv_clean"
......
...@@ -4,50 +4,50 @@ ...@@ -4,50 +4,50 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"> android:background="@color/white">
<View <RelativeLayout
android:layout_width="match_parent" android:id="@+id/containerAnim"
android:layout_height="320dp"
android:background="@drawable/shape_bg_speed" />
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:visibility="gone">
<ImageView
android:id="@+id/iv_gif"
android:layout_width="250dp"
android:layout_height="wrap_content"
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>
<androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout <FrameLayout
android:id="@+id/containerAnim"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ImageView
android:id="@+id/iv_gif"
android:layout_width="250dp"
android:layout_height="wrap_content"
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>
<androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="320dp"
android:background="@drawable/shape_bg_speed" />
<LinearLayout <LinearLayout
android:id="@+id/llMyRoot" android:id="@+id/llMyRoot"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<RelativeLayout <RelativeLayout
...@@ -98,8 +98,8 @@ ...@@ -98,8 +98,8 @@
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </FrameLayout>
</LinearLayout> </androidx.core.widget.NestedScrollView>
</FrameLayout> </FrameLayout>
\ No newline at end of file
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