|
@@ -10,7 +10,7 @@ import com.swago.baseswago.baseroom.IRoomActiveListener
|
|
|
import com.swago.baseswago.baseroom.IRoomInfo
|
|
|
import com.swago.baseswago.baseroom.SwagoRoomManager
|
|
|
import com.swago.baseswago.model.live.RoomConfig
|
|
|
-import com.swago.baseswago.model.live.game.RecommendGameModel
|
|
|
+import com.swago.baseswago.model.live.game.GameModel
|
|
|
import com.swago.room.adapter.BannerViewAdapter
|
|
|
import com.swago.room.adapter.RecommendBannerViewAdapter
|
|
|
import com.swago.room.databinding.ViewBannerBinding
|
|
@@ -19,10 +19,10 @@ import com.youth.banner.indicator.CircleIndicator
|
|
|
class RecommendBannerView : FrameLayout,IRoomActiveListener {
|
|
|
|
|
|
private val mData by lazy {
|
|
|
- ArrayList<RecommendGameModel>()
|
|
|
+ ArrayList<GameModel>()
|
|
|
}
|
|
|
|
|
|
- var jumpToWebFun:((RecommendGameModel)->Unit)? = null
|
|
|
+ var jumpToWebFun:((GameModel)->Unit)? = null
|
|
|
|
|
|
private val bannerViewAdapter = RecommendBannerViewAdapter(mData)
|
|
|
|
|
@@ -56,14 +56,14 @@ class RecommendBannerView : FrameLayout,IRoomActiveListener {
|
|
|
SwagoRoomManager.removeListener(this)
|
|
|
}
|
|
|
|
|
|
- fun setData(data:ArrayList<RecommendGameModel>){
|
|
|
+ fun setData(data:ArrayList<GameModel>){
|
|
|
binding?.let {
|
|
|
mData.addAll(data)
|
|
|
it.banner.setAdapter(bannerViewAdapter)
|
|
|
.setIndicator(CircleIndicator(context))
|
|
|
.addBannerLifecycleObserver(findViewTreeLifecycleOwner())
|
|
|
.setOnBannerListener { data, _ ->
|
|
|
- val bannerData = data as RecommendGameModel
|
|
|
+ val bannerData = data as GameModel
|
|
|
jumpToWebFun?.invoke(bannerData)
|
|
|
}
|
|
|
}
|