Commit 8e8ef62c authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 6754791a
...@@ -26,7 +26,7 @@ import kotlinx.android.synthetic.main.fragment_recommend.* ...@@ -26,7 +26,7 @@ import kotlinx.android.synthetic.main.fragment_recommend.*
*/ */
class RecommendFragment : BaseFragment(), View.OnClickListener { class RecommendFragment : BaseFragment(), View.OnClickListener {
private var mCurrentNewFlag = false private var mCurrentNewFlag = true
private var mSelectTabIndex = 0 private var mSelectTabIndex = 0
private val tabsData = mutableListOf<String>() private val tabsData = mutableListOf<String>()
...@@ -43,7 +43,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -43,7 +43,7 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override fun getContentViewLayoutID() = R.layout.fragment_recommend override fun getContentViewLayoutID() = R.layout.fragment_recommend
private fun initVp2() { private fun initVp2() {
mCurrentNewFlag = UserManager.getInstance().newFlag // mCurrentNewFlag = UserManager.getInstance().newFlag
fragments.clear() fragments.clear()
tabsData.add("追剧") tabsData.add("追剧")
tabsData.add("推荐") tabsData.add("推荐")
...@@ -141,13 +141,13 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -141,13 +141,13 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) { // if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
if (mCurrentNewFlag != UserManager.getInstance().newFlag) { // if (mCurrentNewFlag != UserManager.getInstance().newFlag) {
mCurrentNewFlag = UserManager.getInstance().newFlag // mCurrentNewFlag = UserManager.getInstance().newFlag
// 重置状态 // // 重置状态
initVp2() // initVp2()
} // }
} // }
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
......
...@@ -88,7 +88,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -88,7 +88,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
long diff = currentTimeMillis - activityStoppedTime; long diff = currentTimeMillis - activityStoppedTime;
long diffInSeconds = diff / 1000; long diffInSeconds = diff / 1000;
System.out.println("mcg -->>>>>:: diffInSeconds=" + diffInSeconds + " adSuccessStatus=" + SplashManager.INSTANCE.isSuccessStatus()); System.out.println("mcg -->>>>>:: diffInSeconds=" + diffInSeconds + " adSuccessStatus=" + SplashManager.INSTANCE.isSuccessStatus());
if (diffInSeconds >= 10 && SplashManager.INSTANCE.isSuccessStatus()) { if (diffInSeconds >= 60 && SplashManager.INSTANCE.isSuccessStatus()) {
activity.startActivity(new Intent(activity, SplashForeAdActivity.class)); activity.startActivity(new Intent(activity, SplashForeAdActivity.class));
} }
} }
......
...@@ -71,15 +71,19 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH ...@@ -71,15 +71,19 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
Glide.with(context).load(vedioBean?.coverImage) Glide.with(context).load(vedioBean?.coverImage)
.into(holder.getView(R.id.iv_bg)) .into(holder.getView(R.id.iv_bg))
val vipBtn = holder.getView<View>(R.id.vip) val vipBtn = holder.getView<View>(R.id.vip)
if (UserManager.getInstance().newFlag) { // if (UserManager.getInstance().newFlag) {
// 匹配 // // 匹配
vipBtn.visibility = View.VISIBLE // vipBtn.visibility = View.VISIBLE
vipBtn.setOnClickListener { // vipBtn.setOnClickListener {
mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition) // mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition)
} // }
} else { // } else {
// 未匹配 // // 未匹配
vipBtn.visibility = View.GONE // vipBtn.visibility = View.GONE
// }
vipBtn.visibility = View.VISIBLE
vipBtn.setOnClickListener {
mOnCustomChildClickListener?.onCustomChildClick(it, holder.adapterPosition)
} }
val adBtn = holder.getView<View>(R.id.unlock) val adBtn = holder.getView<View>(R.id.unlock)
......
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