Commit 030e7d21 authored by jyx's avatar jyx

问题修复,更新信息流

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