Commit 8e8ef62c authored by mengcuiguang2's avatar mengcuiguang2

代码优化

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