Commit 8941544a authored by mengcuiguang2's avatar mengcuiguang2
parents 3a2eb31e 97978a6e
......@@ -8,6 +8,7 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.KeyEvent
import android.view.View
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
......@@ -35,7 +36,6 @@ import com.mints.flowbox.ui.widgets.dialog.PowerDialog
import com.mints.flowbox.utils.WifiUtils
import com.mints.library.utils.GlideUtils
import com.tbruyelle.rxpermissions.RxPermissions
import com.yilan.sdk.common.util.PhoneUtil
import kotlinx.android.synthetic.main.activity_main.*
import net.phone.PhoneBrandUtils
import rx.Observable
......@@ -537,6 +537,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
AppConfig.HOME_BANNER_SIGN_GIVECASH = data.signGiveCash
AppConfig.FRAGMENT_THREE_SHOW_TYPE = data.signPageStatus
if (data.signPageStatus == 3) {
tab_iv_four.background = ContextCompat.getDrawable(this, R.drawable.tab_friends_btn)
tab_tv_four.text = "平台分红"
}
TrackManager.getInstance().updataCodeIdForPkgChannel()
if (data.shareNews != null) {
......
......@@ -6,8 +6,6 @@ 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
......@@ -112,7 +110,7 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override fun onDestroy() {
super.onDestroy()
WifiAdManager.instance.onDestroy()
DownloadApkManager.instance.destroy()
}
......
......@@ -46,8 +46,8 @@ private val TAG = HomeFragment::class.java.simpleName
/** 首页Fragment */
class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
View.OnClickListener, HomeView, AdapterView.OnItemClickListener, WifiView.BubbleViewListener,
OnItemChildClickListener {
View.OnClickListener, HomeView, AdapterView.OnItemClickListener, WifiView.BubbleViewListener,
OnItemChildClickListener {
private val userManager by lazy { UserManager.getInstance() }
......@@ -84,10 +84,10 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
private fun initRecy() {
recy_task.addItemDecoration(
DividerItemDecoration(
requireContext(),
DividerItemDecoration.VERTICAL
)
DividerItemDecoration(
requireContext(),
DividerItemDecoration.VERTICAL
)
)
mainTurnAdapter = MainTurnAdapter(requireContext(), dataList)
recy_task.adapter = mainTurnAdapter
......@@ -192,21 +192,19 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
showToast("网络异常,请检测网络")
return
}
WifiAdManager.instance.loadWifiAd(requireActivity())
readyGo(SpeedTestActivity::class.java)
}
// 内存清理
R.id.btn_clean -> {
RxPermissions(requireActivity())
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
WifiAdManager.instance.loadWifiAd(requireActivity())
readyGo(CleanActivity::class.java)
} else {
showMissingPermissionDialog("存储")
}
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
readyGo(CleanActivity::class.java)
} else {
showMissingPermissionDialog("存储")
}
}
}
// 扫一扫
R.id.btn_scan -> {
......@@ -216,14 +214,14 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
}
RxPermissions(requireActivity())
.request(Manifest.permission.CAMERA)
.subscribe { granted: Boolean ->
if (granted) {
readyGo(ScanActivity::class.java)
} else {
showMissingPermissionDialog("拍照")
}
.request(Manifest.permission.CAMERA)
.subscribe { granted: Boolean ->
if (granted) {
readyGo(ScanActivity::class.java)
} else {
showMissingPermissionDialog("拍照")
}
}
}
// wifi提速
R.id.btn_speed_fast -> {
......@@ -264,7 +262,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun getBubbleSuc(count: Int, coin: Int, allIsComplete: Boolean) {
bubbleCoin = coin
wifi_view.setCount(count,allIsComplete)
wifi_view.setCount(count, allIsComplete)
if (wifiManager.isWifiEnable) {
bg_view.setBackgroundResource(R.mipmap.bg_home_enable)
......@@ -298,8 +296,8 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
for (i in 0 until pageCount) {
val gridView = inflater.inflate(
R.layout.item_fragment_main_my_promotions_gv,
vp_grid, false
R.layout.item_fragment_main_my_promotions_gv,
vp_grid, false
) as GridView
gridView.adapter = GvMyAdapter(requireActivity(), data, i, 8)
pagerList.add(gridView)
......@@ -337,7 +335,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
if (hotList.isNotEmpty()) {
val hotBean: BannerBean.ListBean =
hotList[position + (mCurrentIndex * 8)]
hotList[position + (mCurrentIndex * 8)]
if (!TextUtils.isEmpty(hotBean.toUrl)) {
// 自有界面
......@@ -415,9 +413,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
pkgKey = taskBean.key
pkgName = taskBean.pkg
DownloadApkManager.instance.downloadApk(
requireActivity(),
taskBean.downloadUrl,
pkgName
requireActivity(),
taskBean.downloadUrl,
pkgName
)
// 开启广播监听安装事件
registerBroad()
......@@ -426,12 +424,12 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.coin)
bundle.putString(
Constant.MAIN_CARRIER_TYPE,
Constant.CARRIER_FIRSTDOWNLOADS
Constant.MAIN_CARRIER_TYPE,
Constant.CARRIER_FIRSTDOWNLOADS
)
bundle.putString(
Constant.MAIN_EXTRA_ID,
taskBean.key
Constant.MAIN_EXTRA_ID,
taskBean.key
)
readyGo(AwardActivity::class.java, bundle)
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_bonus_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_bonus_none" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/ic_bonus_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_bonus_none" />
<item android:drawable="@mipmap/ic_friend_enable" android:state_selected="true" />
<item android:drawable="@mipmap/ic_friend_none" />
</selector>
\ No newline at end of file
......@@ -99,7 +99,7 @@
android:id="@+id/tab_iv_four"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/tab_friends_btn" />
android:src="@drawable/tab_bonus_btn" />
<TextView
android:id="@+id/tab_tv_four"
......
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