Commit 27195c36 authored by jyx's avatar jyx

修复福利页视频次数问题,锁屏跳转错误

parent 88531a62
......@@ -193,12 +193,6 @@
android:launchMode="singleTask"
android:theme="@style/CustomerTransparentTheme" />
<!-- <activity-->
<!-- android:name=".ui.activitys.keepalive.TransPlaceActivity"-->
<!-- android:excludeFromRecents="true"-->
<!-- android:launchMode="singleTask"-->
<!-- android:theme="@style/CustomerTransparentTheme" />-->
<activity
android:name=".ui.activitys.keepalive.BoostFastActivity"
android:excludeFromRecents="true"
......@@ -211,7 +205,7 @@
<service
android:name=".InitAppService"
android:enabled="true"
android:exported="false" /> <!-- 喜马拉雅播放器 -->
android:exported="false" />
<!-- 监听apk安装 -->
<service
android:name=".service.AppInstallService"
......
......@@ -29,7 +29,6 @@ import com.mints.flowbox.keepalive.ServiceUtil;
import com.mints.flowbox.keepalive.WifiStateWatch;
import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.MiitHelper;
import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.ad.OwManager;
import com.mints.flowbox.manager.ad.TzManager;
import com.mints.flowbox.manager.ad.WnManager;
......
......@@ -64,7 +64,7 @@ public class VideoAdingManager {
public static com.mints.flowbox.ad.video.VideoAdingManager getInstance(Activity activity) {
if (_inst == null) {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
_inst = new com.mints.flowbox.ad.video.VideoAdingManager(activityWeakReference.get());
_inst = new VideoAdingManager(activityWeakReference.get());
}
return _inst;
}
......@@ -85,7 +85,7 @@ public class VideoAdingManager {
// APP下载回调广播
private BroadcastReceiver mReceiverBroadcastReceiver = null;
private boolean receiverFlag=false;// 广播是否注册
private boolean receiverFlag = false;// 广播是否注册
private void registerBroad() {
// 是否是超级翻倍标识 false-返回
......@@ -123,7 +123,7 @@ public class VideoAdingManager {
intentFilter.addAction(AppInstallService.APP_INSTALL_ACTION);
activity.registerReceiver(this.mReceiverBroadcastReceiver, intentFilter);
receiverFlag=true;
receiverFlag = true;
}
/**
......@@ -432,7 +432,7 @@ public class VideoAdingManager {
csjGroMoreVideoAdManager = null;
}
if (mReceiverBroadcastReceiver != null&&receiverFlag) {
if (mReceiverBroadcastReceiver != null && receiverFlag) {
activity.stopService(new Intent(activity, AppInstallService.class));
activity.unregisterReceiver(mReceiverBroadcastReceiver);
mReceiverBroadcastReceiver = null;
......
......@@ -418,7 +418,7 @@ object WifiDataManager {
// 拔电
if (data.modules.charge_stop.isOpen) {
BATTERY_OFF_OPEN = true
BATTERY_OFF_TIMES = data.modules.charge.maxCount
BATTERY_OFF_TIMES = data.modules.charge_stop.maxCount
} else {
BATTERY_OFF_OPEN = false
}
......@@ -442,7 +442,7 @@ object WifiDataManager {
// 挂断电话
if (data.modules.telephone.isOpen) {
PHONE_OFF_OPEN = true
PHONE_OFF_TIMES = data.modules.wifi_disconnect.maxCount
PHONE_OFF_TIMES = data.modules.telephone.maxCount
} else {
PHONE_OFF_OPEN = false
}
......@@ -450,7 +450,7 @@ object WifiDataManager {
// 锁屏
if (data.modules.screen_lock.isOpen) {
LOCK_OPEN = true
LOCK_TIMES = data.modules.telephone.maxCount
LOCK_TIMES = data.modules.screen_lock.maxCount
} else {
LOCK_OPEN = false
}
......
......@@ -187,15 +187,6 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardContent.text = "大量金币已到账"
tvAwardNext.visibility = View.GONE
}
Constant.CARRIER_CHALLENGE_VEDIO_RANKING -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
vo["coin"] = curCoin
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.text = "${curCoin}金币已到账"
tvAwardNext.visibility = View.GONE
}
Constant.CARRIER_TURN_VEDIOCHALLENGE -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
......@@ -233,7 +224,6 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
), null, null, null
)
curCoin = extraId.toInt()
carrierType = Constant.CARRIER_BLESSINGBAG_DOUBLE
}
......
package com.mints.flowbox.ui.activitys
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
......@@ -68,6 +69,11 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
super.onCreate(savedInstanceState)
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
getBundleExtras(intent?.extras)
}
override fun getContentViewLayoutID() = R.layout.activity_increasespeed
override fun initViewsAndEvents() {
......
......@@ -513,8 +513,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
*/
fun userLogin(refreshType: Int) {
// if (!AppPreferencesManager.get().getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
mRefreshType = refreshType
mainPresenter.userLogin()
mRefreshType = refreshType
mainPresenter.userLogin()
// }
}
......@@ -566,6 +566,14 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
)
)
tab_tv_four.text = "平台分红"
} else {
tab_iv_four.setImageDrawable(
ContextCompat.getDrawable(
this,
R.drawable.tab_bonus_btn
)
)
tab_tv_four.text = "福利"
}
TrackManager.getInstance().updataCodeIdForPkgChannel()
......
......@@ -104,7 +104,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity(), ScreenMonitor.Lis
override fun toggleOverridePendingTransition() = false
override fun getOverridePendingTransitionMode() = TransitionMode.FADE
override fun getOverridePendingTransitionMode() = null
override fun toggleIsBack2Left() = false
......
package com.mints.flowbox.ui.activitys.keepalive
import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.keepalive.AlarmManager
import com.mints.flowbox.ui.activitys.base.BaseActivity
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() {
mActivityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
iv_close.setOnClickListener {
finish()
overridePendingTransition(0, 0)
}
Handler(Looper.getMainLooper()).postDelayed({
finish()
overridePendingTransition(0, 0)
}, 5000)
}
override fun isApplyKitKatTranslucency() = true
override fun finish() {
super.finish()
if (mIsFromAlarm) {
AlarmManager.getInstance().resetUserActionTime()
}
}
override fun onResume() {
super.onResume()
cleanMemory()
initExpress()
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun cleanMemory() {
ccav_speed.startAnimation()
Handler(Looper.getMainLooper()).postDelayed(
{
ccav_speed.stopAnimation()
ccav_speed.visibility = View.GONE
ll_ad.visibility = View.VISIBLE
},
2000
)
}
override fun onBackPressed() {
// 屏蔽返回键
// super.onBackPressed()
}
}
\ No newline at end of file
......@@ -6,16 +6,16 @@ import android.os.Looper
import android.view.View
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.CleanActivity
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
import com.mints.flowbox.utils.ForegroundOrBackground
import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.TimeRender
import com.mints.flowbox.utils.ToolUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_screen.*
import kotlinx.android.synthetic.main.activity_screen.fl_ad
import net.phone.PhoneBrandUtils
import java.util.*
class ScreenActivity : OutAppActivity(), View.OnClickListener {
......@@ -40,6 +40,8 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
initExpress()
ForegroundOrBackground.getMain_activity().moveTaskToBack(true)
tvBoost.setOnClickListener(this)
tvClean.setOnClickListener(this)
tvSaveBattery.setOnClickListener(this)
......@@ -48,9 +50,15 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
override fun onResume() {
super.onResume()
resetTime()
LogUtil.d(TAG_LOG, "ScreenActivity -> onResume ")
}
override fun onStop() {
super.onStop()
LogUtil.d(TAG_LOG, "ScreenActivity -> onStop ")
}
private fun resetTime() {
val date = Date()
val monthDay = TimeRender.formatDate(date, TimeRender.DEFAULT_FORMAT_MONTH_DAY)
......@@ -75,8 +83,11 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
R.id.tvClean -> {
// 一键清理
val bundle = Bundle()
bundle.putInt(Constant.SCAN_TYPE, 1)
readyGo(CleanActivity::class.java, bundle)
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_CLEAN
)
readyGo(IncreasespeedActivity::class.java)
}
R.id.tvSaveBattery -> {
val bundle = Bundle()
......@@ -93,6 +104,7 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
}
}
/**初始化信息iyc*/
private fun initExpress() {
try {
......
......@@ -75,7 +75,7 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
} else {
holder.itemView.findViewById<Button>(R.id.btn)
.setOnClickListener {
context.startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
mOnItemClickListener?.onItemClick(it, position)
}
}
return
......
......@@ -131,8 +131,10 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
}
override fun setSignCompleteSuc() {
hideLoading()
(requireActivity() as MainActivity).clickTab4Layout()
(requireActivity() as MainActivity).refreshHall()
Handler(Looper.getMainLooper()).postDelayed({
hideLoading()
}, 1000)
}
override fun onClick(v: View?) {
......@@ -214,10 +216,11 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
}
override fun adSuccess() {
videoAdingSuccess(coin)
videoAdingSuccess(coin, carrierType)
}
override fun adDownload() {
}
})
PreCsjGroMoreVideoAdManager.getInstance()
......@@ -232,15 +235,14 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
bean.carrierType = carrierType
bean.curCoin = coin
loadVideo(videoAdingManager, bean, true, coin)
loadVideo(videoAdingManager, bean, true)
}
/** 加载激励视频 */
private fun loadVideo(
videoAdingManager: VideoAdingManager,
bean: VideoAdingBean,
isFirstLoad: Boolean,
coin: Int
isFirstLoad: Boolean
) {
videoAdingManager.setVideoAdingListener(object : VideoAdingManager.VideoAdingListener {
override fun videoAdingListenerError(adType: String) {
......@@ -254,13 +256,13 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
hideLoading()
showToast("加载失败,请稍后重试!")
} else {
loadVideo(videoAdingManager, bean, false, coin)
loadVideo(videoAdingManager, bean, false)
}
}
override fun videoAdingListenerSuccess(adType: String) {
hideLoading()
videoAdingSuccess(coin)
videoAdingSuccess(bean.curCoin, bean.carrierType)
}
})
if (isFirstLoad) {
......@@ -273,16 +275,15 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener,
}
/** 激励视频播放成功回调 */
private fun videoAdingSuccess(coin: Int) {
private fun videoAdingSuccess(coin: Int, carrierType: String) {
mGetPacketBean?.let {
if (it.rankingBottoms.challenge_vedio_ranking.coin == 0) {
val vo = HashMap<String, Any>()
vo["carrierType"] = it.rankingBottoms.challenge_vedio_ranking.carrierType
TrackManager.getInstance().reportAddCoinMsg(
activity,
vo
if (!TextUtils.equals(
carrierType,
it.rankingBottoms.challenge_vedio_ranking.carrierType
)
) return
if (it.rankingBottoms.challenge_vedio_ranking.coin == 0) {
Handler(Looper.getMainLooper()).postDelayed({
refreshData()
}, 1000)
......
......@@ -95,12 +95,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
private fun initView() {
if (AppConfig.FRAGMENT_THREE_SHOW_TYPE == 3) {
ivBanner.setImageResource(R.mipmap.bg_banner2)
tvTitle.visibility = View.GONE
tvContent.visibility = View.GONE
}
wifi_view.setCount(0)
if (wifiManager.isWifiEnable) {
......@@ -144,6 +138,12 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
DownloadApkManager.instance.tryOnceInstallApk()
if (AppConfig.FRAGMENT_THREE_SHOW_TYPE == 3 && tvTitle.visibility != View.GONE) {
ivBanner.setImageResource(R.mipmap.bg_banner2)
tvTitle.visibility = View.GONE
tvContent.visibility = View.GONE
}
// gromore激励视频预加载
PreCsjGroMoreVideoAdManager.getInstance().preLoadAd(requireActivity())
}
......
......@@ -396,7 +396,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
/** 初始化 */
public fun initData() {
fun initData() {
// 打开激活
uploadDeviceInfo()
}
......@@ -608,7 +608,14 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
override fun onItemClick(view: View?, position: Int) {
if (!wifiUtils.isWifiConnected(mContext)) return
if (mWifiList[position].isConnected) return
view?.let {
if (it.id == R.id.btn) {
checkPermission()
return
}
}
if (mWifiList.isNotEmpty() && mWifiList[position].isConnected) return
val wifiListBean = mWifiList[position]
if (wifiDialog == null) wifiDialog =
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_bonus_sign_unenable" android:state_enabled="false" />
<item android:drawable="@mipmap/ic_bouns_sign" android:state_enabled="true" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/color_10000000">
<com.mints.flowbox.ui.widgets.CircleCleanAnimationView
android:id="@+id/ccav_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<LinearLayout
android:id="@+id/ll_ad"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/color_main"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/iv_close"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_close" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:text="已优化"
android:textColor="@color/white"
android:textSize="32sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:text="欢迎使用更多清理功能"
android:textColor="@color/white"
android:textSize="20sp" />
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:gravity="center" />
<TextView
app:drawableStartCompat="@drawable/ic_launcher_app_out"
android:layout_width="0dp"
android:layout_height="22dp"
android:layout_gravity="end"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/appName"
android:textColor="@color/color_40000000"
android:textSize="12sp" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
......@@ -58,7 +58,7 @@
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:text="@string/appName"
android:textColor="@color/color_40000000"
android:textColor="@color/color_50FFFFFF"
android:textSize="12sp"
app:drawableStartCompat="@drawable/ic_launcher_app_out" />
......
......@@ -112,7 +112,7 @@
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:text="@string/appName"
android:textColor="@color/color_40000000"
android:textColor="@color/color_50FFFFFF"
android:textSize="12sp"
app:drawableStartCompat="@drawable/ic_launcher_app_out" />
</FrameLayout>
......@@ -21,6 +21,7 @@
<color name="color_30000000">#30000000</color>
<color name="color_40000000">#40000000</color>
<color name="color_60000000">#60000000</color>
<color name="color_50FFFFFF">#50FFFFFF</color>
<color name="transparent">#00000000</color>
<color name="color_2B3238">#2B3238</color>
<color name="color_002444">#002444</color>
......
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