资源位兼容大鹅配置
This commit is contained in:
@@ -47,8 +47,8 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
private val _emptyLiveData = MutableLiveData<Boolean>()
|
private val _emptyLiveData = MutableLiveData<Boolean>()
|
||||||
val emptyLiveData: LiveData<Boolean> = _emptyLiveData
|
val emptyLiveData: LiveData<Boolean> = _emptyLiveData
|
||||||
|
|
||||||
private val _resourceLiveData = MutableLiveData<List<ResourceInfo>>()
|
private val _resourceLiveData = MutableLiveData<MutableList<ResourceInfo>>()
|
||||||
val resourceLiveData: LiveData<List<ResourceInfo>> = _resourceLiveData
|
val resourceLiveData: LiveData<MutableList<ResourceInfo>> = _resourceLiveData
|
||||||
|
|
||||||
private val _resourceJumpLiveData = MutableLiveData<HomeRoomInfo>()
|
private val _resourceJumpLiveData = MutableLiveData<HomeRoomInfo>()
|
||||||
val resourceJumpLiveData: LiveData<HomeRoomInfo> = _resourceJumpLiveData
|
val resourceJumpLiveData: LiveData<HomeRoomInfo> = _resourceJumpLiveData
|
||||||
|
@@ -96,6 +96,7 @@ class RecommendFragment : BaseFragment(),
|
|||||||
mBinding.llResource.isGone = true
|
mBinding.llResource.isGone = true
|
||||||
return@observe
|
return@observe
|
||||||
}
|
}
|
||||||
|
it.add(0, it.removeAt(1))
|
||||||
mBinding.llResource.isGone = false
|
mBinding.llResource.isGone = false
|
||||||
val resourceViews = arrayOf(
|
val resourceViews = arrayOf(
|
||||||
mBinding.ivResource0,
|
mBinding.ivResource0,
|
||||||
@@ -189,7 +190,7 @@ class RecommendFragment : BaseFragment(),
|
|||||||
singleAnchorAdapter = HomeSingleAnchorAdapter()
|
singleAnchorAdapter = HomeSingleAnchorAdapter()
|
||||||
mBinding.rvSingleAnchor.adapter = singleAnchorAdapter
|
mBinding.rvSingleAnchor.adapter = singleAnchorAdapter
|
||||||
val layoutManager =
|
val layoutManager =
|
||||||
GridLayoutManager(requireContext(),4, LinearLayoutManager.VERTICAL, false)
|
GridLayoutManager(requireContext(), 4, LinearLayoutManager.VERTICAL, false)
|
||||||
mBinding.rvSingleAnchor.layoutManager = layoutManager
|
mBinding.rvSingleAnchor.layoutManager = layoutManager
|
||||||
homeViewModel.singleAnchorHomeLiveData.observe(this) {
|
homeViewModel.singleAnchorHomeLiveData.observe(this) {
|
||||||
if (it.data.isNullOrEmpty()) {
|
if (it.data.isNullOrEmpty()) {
|
||||||
|
@@ -104,7 +104,7 @@ object HomeModel : BaseModel() {
|
|||||||
api.getHotRoom()
|
api.getHotRoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getHomeResource(): List<ResourceInfo>? =
|
suspend fun getHomeResource(): MutableList<ResourceInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getHomeResource()
|
api.getHomeResource()
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ object HomeModel : BaseModel() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET("/home/currentResource")
|
@GET("/home/currentResource")
|
||||||
suspend fun getHomeResource(): ServiceResult<List<ResourceInfo>>
|
suspend fun getHomeResource(): ServiceResult<MutableList<ResourceInfo>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页资源位跳转
|
* 首页资源位跳转
|
||||||
|
Reference in New Issue
Block a user