|
|
|
@@ -2,39 +2,25 @@ package com.yizhuan.erban.home.fragment
|
|
|
|
|
|
|
|
|
|
import android.graphics.Color
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import android.view.View
|
|
|
|
|
import android.widget.LinearLayout
|
|
|
|
|
import android.widget.TextView
|
|
|
|
|
import androidx.core.view.isGone
|
|
|
|
|
import androidx.databinding.DataBindingUtil
|
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
|
import androidx.fragment.app.activityViewModels
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
|
import com.coorchice.library.utils.LogUtils
|
|
|
|
|
import androidx.viewpager.widget.ViewPager
|
|
|
|
|
import com.scwang.smartrefresh.layout.internal.ProgressDrawable
|
|
|
|
|
import com.yizhuan.erban.R
|
|
|
|
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
|
|
|
|
import com.yizhuan.erban.avroom.adapter.RoomVPAdapter
|
|
|
|
|
import com.yizhuan.erban.base.BaseFragment
|
|
|
|
|
import com.yizhuan.erban.base.BaseViewBindingFragment
|
|
|
|
|
import com.yizhuan.erban.common.EmptyViewHelper
|
|
|
|
|
import com.yizhuan.erban.databinding.FragmentLiveBinding
|
|
|
|
|
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
|
|
|
|
import com.yizhuan.erban.home.HomeViewModel
|
|
|
|
|
import com.yizhuan.erban.home.adapter.*
|
|
|
|
|
import com.yizhuan.erban.home.dialog.RecommendRoomDialog
|
|
|
|
|
import com.yizhuan.erban.home.helper.BannerHelper
|
|
|
|
|
import com.yizhuan.erban.home.adapter.HomeLiveTopAdapter
|
|
|
|
|
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter
|
|
|
|
|
import com.yizhuan.erban.home.adapter.PartyMagicIndicatorAdapter
|
|
|
|
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
|
|
|
|
import com.yizhuan.erban.ui.utils.load
|
|
|
|
|
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
|
|
|
|
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
|
|
|
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
|
|
|
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
|
|
|
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
|
|
|
|
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo
|
|
|
|
|
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
|
|
|
|
import com.yizhuan.xchat_android_core.initial.InitialModel
|
|
|
|
|
import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
|
|
|
|
|
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
|
|
|
|
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
|
|
|
@@ -52,7 +38,7 @@ class LiveFragment : BaseViewBindingFragment<FragmentLiveBinding>(),
|
|
|
|
|
PartyMagicIndicatorAdapter.OnItemSelectListener {
|
|
|
|
|
|
|
|
|
|
private val mFragments: ArrayList<Fragment> = ArrayList()
|
|
|
|
|
private val mTabInfoList: ArrayList<CharSequence> = ArrayList()
|
|
|
|
|
private val mTabInfoList: ArrayList<String> = ArrayList()
|
|
|
|
|
private var currentIndex = 0
|
|
|
|
|
private var lastLoadDataTime = 0L
|
|
|
|
|
|
|
|
|
@@ -92,11 +78,25 @@ class LiveFragment : BaseViewBindingFragment<FragmentLiveBinding>(),
|
|
|
|
|
binding.tvTitle.text = if (it.onceLookStatus) "曾经看过的人" else "Top热播"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
binding.viewPager.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
|
|
|
|
override fun onPageSelected(position: Int) {
|
|
|
|
|
super.onPageSelected(position)
|
|
|
|
|
StatisticManager.Instance().onEvent(
|
|
|
|
|
StatisticsProtocol.EVENT_GEBO_TAB_CLICK,
|
|
|
|
|
"个播页二级tab分类点击",
|
|
|
|
|
mapOf("tab_name" to mTabInfoList.getOrElse(position) { "未知tab" })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onResume() {
|
|
|
|
|
super.onResume()
|
|
|
|
|
loadData()
|
|
|
|
|
StatisticManager.Instance().onEvent(
|
|
|
|
|
StatisticsProtocol.EVENT_RECENT_CARD_SHOW, "最近在看卡片曝光"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun onGetSingleRoomSortInfoSuccess(info: List<SingleRoomSortInfo>) {
|
|
|
|
|