[Modify]首页逻辑调整
This commit is contained in:
@@ -22,6 +22,14 @@ public class EmptyViewHelper {
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static View createEmptyTextViewHeight(Context context, String text) {
|
||||||
|
if (!NetworkUtils.isNetworkAvailable(context)) text = ResUtil.getString(R.string.erban_common_emptyviewhelper_01);
|
||||||
|
View view = LayoutInflater.from(context).inflate(R.layout.layout_wrap_empty, null);
|
||||||
|
view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||||
|
((TextView) view.findViewById(R.id.tv_hint)).setText(text);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
public static View createEmptyTextViewNoImage(Context context, String text) {
|
public static View createEmptyTextViewNoImage(Context context, String text) {
|
||||||
if (!NetworkUtils.isNetworkAvailable(context)) text = ResUtil.getString(R.string.erban_common_emptyviewhelper_01);
|
if (!NetworkUtils.isNetworkAvailable(context)) text = ResUtil.getString(R.string.erban_common_emptyviewhelper_01);
|
||||||
View view = LayoutInflater.from(context).inflate(R.layout.layout_text_empty, null);
|
View view = LayoutInflater.from(context).inflate(R.layout.layout_text_empty, null);
|
||||||
|
@@ -4,10 +4,7 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.yizhuan.erban.base.BaseViewModel
|
import com.yizhuan.erban.base.BaseViewModel
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
import com.yizhuan.xchat_android_core.home.bean.*
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo
|
|
||||||
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||||
import com.yizhuan.xchat_android_core.room.bean.AnchorInfo
|
import com.yizhuan.xchat_android_core.room.bean.AnchorInfo
|
||||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
@@ -23,6 +20,15 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
|
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
|
||||||
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
|
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
|
||||||
|
|
||||||
|
private val _currentResourceLiveData = MutableLiveData<List<CurrentResourceInfo>?>()
|
||||||
|
val currentResourceLiveData: MutableLiveData<List<CurrentResourceInfo>?> = _currentResourceLiveData
|
||||||
|
|
||||||
|
private val _resourceJumpLiveData = MutableLiveData<HomeRoomInfo?>()
|
||||||
|
val resourceJumpLiveData: LiveData<HomeRoomInfo?> = _resourceJumpLiveData
|
||||||
|
|
||||||
|
private val _homeChatPickLiveData = MutableLiveData<String?>()
|
||||||
|
val homeChatPickLiveData: LiveData<String?> = _homeChatPickLiveData
|
||||||
|
|
||||||
private val _gameRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
private val _gameRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||||
val gameRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _gameRoomLiveData
|
val gameRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _gameRoomLiveData
|
||||||
|
|
||||||
@@ -50,8 +56,8 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
private val _homePlayInfoLiveData = MutableLiveData<List<HomeRoomInfo>?>()
|
private val _homePlayInfoLiveData = MutableLiveData<List<HomeRoomInfo>?>()
|
||||||
val homePlayInfoData: MutableLiveData<List<HomeRoomInfo>?> = _homePlayInfoLiveData
|
val homePlayInfoData: MutableLiveData<List<HomeRoomInfo>?> = _homePlayInfoLiveData
|
||||||
|
|
||||||
private val _homeHotRoomLiveData = MutableLiveData<List<HomeRoomInfo>?>()
|
private val _homeHotRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||||
val homeHotRoomLiveData: LiveData<List<HomeRoomInfo>?> = _homeHotRoomLiveData
|
val homeHotRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _homeHotRoomLiveData
|
||||||
|
|
||||||
private val _newFriendLiveData = MutableLiveData<ListResult<UserInfo>>()
|
private val _newFriendLiveData = MutableLiveData<ListResult<UserInfo>>()
|
||||||
val newFriendLiveData: LiveData<ListResult<UserInfo>> = _newFriendLiveData
|
val newFriendLiveData: LiveData<ListResult<UserInfo>> = _newFriendLiveData
|
||||||
@@ -67,6 +73,44 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页改版资源位
|
||||||
|
*/
|
||||||
|
fun getCurrentResourceInfo() {
|
||||||
|
safeLaunch(
|
||||||
|
onError = {
|
||||||
|
_currentResourceLiveData.value = null
|
||||||
|
},
|
||||||
|
block = {
|
||||||
|
_currentResourceLiveData.value = HomeModel.getCurrentResource()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getResourceJumpInfo(id: Int) {
|
||||||
|
safeLaunch(
|
||||||
|
onError = {
|
||||||
|
_resourceJumpLiveData.value = null
|
||||||
|
it.message.toast()
|
||||||
|
},
|
||||||
|
block = {
|
||||||
|
_resourceJumpLiveData.value = HomeModel.getResourceJumpInfo(id)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getHomeChatPick() {
|
||||||
|
safeLaunch(
|
||||||
|
onError = {
|
||||||
|
_homeChatPickLiveData.value = null
|
||||||
|
it.message.toast()
|
||||||
|
},
|
||||||
|
block = {
|
||||||
|
_homeChatPickLiveData.value = HomeModel.getHomeChatPick()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun getBannerInfo() {
|
fun getBannerInfo() {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
@@ -181,10 +225,11 @@ class HomeViewModel : BaseViewModel() {
|
|||||||
fun getHotRoom() {
|
fun getHotRoom() {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
_homeHotRoomLiveData.value = null
|
_homeHotRoomLiveData.value = ListResult.failed(1)
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
_homeHotRoomLiveData.value = HomeModel.getHotRoom()
|
val result = HomeModel.getHotRoom()
|
||||||
|
_homeHotRoomLiveData.value = ListResult.success(result, 1)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -10,15 +10,18 @@ import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
|||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.application.IReportConstants
|
import com.yizhuan.erban.application.IReportConstants
|
||||||
import com.yizhuan.erban.application.ReportManager
|
import com.yizhuan.erban.application.ReportManager
|
||||||
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||||
import com.yizhuan.erban.databinding.FragmentHomeBinding
|
import com.yizhuan.erban.databinding.FragmentHomeBinding
|
||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.PartyMagicIndicatorAdapter
|
import com.yizhuan.erban.home.dialog.RecommendRoomDialog
|
||||||
import com.yizhuan.erban.home.helper.BannerHelper
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||||
|
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity
|
||||||
import com.yizhuan.erban.ui.search.SearchActivity
|
import com.yizhuan.erban.ui.search.SearchActivity
|
||||||
import com.yizhuan.erban.ui.user.adapter.MainIndicatorAdapter
|
import com.yizhuan.erban.ui.user.adapter.MainIndicatorAdapter
|
||||||
import com.yizhuan.erban.ui.user.adapter.UserInfoIndicatorAdapter
|
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
|
||||||
@@ -57,7 +60,58 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
homeViewModel.currentResourceLiveData.observe(this) {
|
||||||
|
it?.let {
|
||||||
|
if(it.size != 2){
|
||||||
|
binding.csResource.visibility = View.GONE
|
||||||
|
return@observe
|
||||||
|
}
|
||||||
|
binding.csResource.visibility = View.VISIBLE
|
||||||
|
val resourceViews = arrayOf(
|
||||||
|
binding.ivResource0,
|
||||||
|
binding.ivResource1
|
||||||
|
)
|
||||||
|
for (i in resourceViews.indices) {
|
||||||
|
resourceViews[i].load(it[i].icon)
|
||||||
|
resourceViews[i].setOnClickListener { _ ->
|
||||||
|
when {
|
||||||
|
it[i].resourceType == 5 -> {
|
||||||
|
CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||||
|
}
|
||||||
|
i == 3 -> {
|
||||||
|
dialogManager.showProgressDialog(mContext)
|
||||||
|
homeViewModel.getHomeChatPick()
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
dialogManager.showProgressDialog(mContext)
|
||||||
|
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
homeViewModel.resourceJumpLiveData.observe(this) {
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
it?.let {
|
||||||
|
if (it.isPick) {
|
||||||
|
AVRoomActivity.start(context, it.uid)
|
||||||
|
} else {
|
||||||
|
RecommendRoomDialog.newInstance(it).show(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
homeViewModel.homeChatPickLiveData.observe(viewLifecycleOwner) {
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
it?.let {
|
||||||
|
if (it.isNotEmpty()) {
|
||||||
|
NimP2PMessageActivity.start(context, it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
homeViewModel.getBannerInfo()
|
homeViewModel.getBannerInfo()
|
||||||
|
homeViewModel.getCurrentResourceInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initListener() {
|
private fun initListener() {
|
||||||
|
@@ -3,6 +3,8 @@ package com.yizhuan.erban.home.fragment
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.application.IReportConstants
|
import com.yizhuan.erban.application.IReportConstants
|
||||||
@@ -11,19 +13,23 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
|||||||
import com.yizhuan.erban.avroom.dialog.CreateRoomDialog
|
import com.yizhuan.erban.avroom.dialog.CreateRoomDialog
|
||||||
import com.yizhuan.erban.base.BaseActivity
|
import com.yizhuan.erban.base.BaseActivity
|
||||||
import com.yizhuan.erban.base.BaseViewBindingFragment
|
import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||||
|
import com.yizhuan.erban.common.EmptyViewHelper
|
||||||
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
import com.yizhuan.erban.databinding.FragmentRecommendBinding
|
||||||
import com.yizhuan.erban.home.HomeViewModel
|
import com.yizhuan.erban.home.HomeViewModel
|
||||||
import com.yizhuan.erban.home.adapter.HomeChatAdapter
|
import com.yizhuan.erban.home.adapter.HomeChatAdapter
|
||||||
import com.yizhuan.erban.home.adapter.HomeHotAdapter
|
import com.yizhuan.erban.home.adapter.HomeHotAdapter
|
||||||
import com.yizhuan.erban.home.adapter.HomeTopAdapter
|
import com.yizhuan.erban.home.adapter.HomeTopAdapter
|
||||||
|
import com.yizhuan.erban.home.adapter.RoomNewFriendsAdapter
|
||||||
import com.yizhuan.erban.home.helper.BannerHelper
|
import com.yizhuan.erban.home.helper.BannerHelper
|
||||||
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
import com.yizhuan.erban.home.helper.OpenRoomHelper
|
||||||
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||||
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo
|
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo
|
||||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent
|
||||||
import com.yizhuan.xchat_android_core.room.event.RoomShieldEvent
|
import com.yizhuan.xchat_android_core.room.event.RoomShieldEvent
|
||||||
import com.yizhuan.xchat_android_core.user.UserModel
|
import com.yizhuan.xchat_android_core.user.UserModel
|
||||||
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||||
import com.zhpan.bannerview.BannerViewPager
|
import com.zhpan.bannerview.BannerViewPager
|
||||||
@@ -35,8 +41,11 @@ import org.greenrobot.eventbus.ThreadMode
|
|||||||
* Peko首页
|
* Peko首页
|
||||||
*/
|
*/
|
||||||
class RecommendFragment : BaseViewBindingFragment<FragmentRecommendBinding>() {
|
class RecommendFragment : BaseViewBindingFragment<FragmentRecommendBinding>() {
|
||||||
|
|
||||||
private lateinit var roomHotAdapter: HomeHotAdapter
|
private lateinit var roomHotAdapter: HomeHotAdapter
|
||||||
|
|
||||||
|
private lateinit var rvDelegate: RVDelegate<HomeRoomInfo>
|
||||||
|
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
|
|
||||||
//是否需要刷新接口进行屏蔽房间操作
|
//是否需要刷新接口进行屏蔽房间操作
|
||||||
@@ -72,11 +81,14 @@ class RecommendFragment : BaseViewBindingFragment<FragmentRecommendBinding>() {
|
|||||||
AVRoomActivity.start(mContext, homePlayInfo.uid)
|
AVRoomActivity.start(mContext, homePlayInfo.uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.mRecyclerRoom.adapter = roomHotAdapter
|
rvDelegate = RVDelegate.Builder<HomeRoomInfo>()
|
||||||
|
.setAdapter(roomHotAdapter)
|
||||||
|
.setRecyclerView(binding.mRecyclerRoom)
|
||||||
|
.setEmptyView(EmptyViewHelper.createEmptyTextViewHeight(context, "暂无熱門推薦"))
|
||||||
|
.setLayoutManager(GridLayoutManager(mContext, 2))
|
||||||
|
.build()
|
||||||
homeViewModel.homeHotRoomLiveData.observe(this) {
|
homeViewModel.homeHotRoomLiveData.observe(this) {
|
||||||
it?.let {
|
rvDelegate.loadData(it)
|
||||||
roomHotAdapter.setNewData(it)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,85 +67,40 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cs_resource"
|
||||||
android:paddingStart="@dimen/dp_14"
|
android:paddingStart="@dimen/dp_14"
|
||||||
android:paddingEnd="@dimen/dp_14"
|
android:paddingEnd="@dimen/dp_14"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="90dp">
|
android:layout_height="90dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_heartbeat"
|
android:id="@+id/iv_resource0"
|
||||||
android:layout_width="@dimen/dp_0"
|
android:layout_width="@dimen/dp_0"
|
||||||
android:layout_height="90dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/bg_heartbeat"
|
android:background="@drawable/default_banner"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/iv_accompany"
|
android:scaleType="centerCrop"
|
||||||
|
app:layout_constraintDimensionRatio="168:80"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/iv_resource1"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/tv_heartbeat"
|
|
||||||
android:text="@string/heartbeat_love"
|
|
||||||
android:textSize="@dimen/sp_18"
|
|
||||||
android:textColor="@color/color_white"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv_heartbeat"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:text="@string/level_goddess_gathering_place"
|
|
||||||
android:textSize="@dimen/sp_12"
|
|
||||||
android:textColor="@color/white_transparent_80"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
|
||||||
android:layout_marginTop="@dimen/dp_4"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv_heartbeat"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_heartbeat"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_accompany"
|
android:id="@+id/iv_resource1"
|
||||||
android:layout_width="@dimen/dp_0"
|
android:layout_width="@dimen/dp_0"
|
||||||
android:layout_height="90dp"
|
android:layout_height="@dimen/dp_0"
|
||||||
android:background="@drawable/bg_accompany"
|
android:background="@drawable/default_banner"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:layout_marginStart="@dimen/dp_10"
|
||||||
|
app:layout_constraintDimensionRatio="168:80"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
app:layout_constraintStart_toEndOf="@+id/iv_heartbeat"
|
app:layout_constraintStart_toEndOf="@+id/iv_resource0"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/tv_accompany"
|
|
||||||
android:text="@string/accompany_and_make_friends"
|
|
||||||
android:textSize="@dimen/sp_18"
|
|
||||||
android:textColor="@color/color_white"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv_accompany"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:text="@string/interesting_people_are_here"
|
|
||||||
android:textSize="@dimen/sp_12"
|
|
||||||
android:textColor="@color/white_transparent_80"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
|
||||||
android:layout_marginTop="@dimen/dp_4"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv_accompany"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_heartbeat"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_marginTop="@dimen/dp_4"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
@@ -174,6 +129,7 @@
|
|||||||
android:id="@+id/magic_indicator"
|
android:id="@+id/magic_indicator"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_25"
|
android:layout_height="@dimen/dp_25"
|
||||||
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
android:layout_marginEnd="@dimen/dp_12" />
|
android:layout_marginEnd="@dimen/dp_12" />
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<com.yizhuan.xchat_android_library.common.widget.VpRecyclerView
|
<com.yizhuan.xchat_android_library.common.widget.VpRecyclerView
|
||||||
android:id="@+id/mRecyclerRoom"
|
android:id="@+id/mRecyclerRoom"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
android:scrollbars="none"
|
android:scrollbars="none"
|
||||||
|
23
app/src/main/res/layout/layout_wrap_empty.xml
Normal file
23
app/src/main/res/layout/layout_wrap_empty.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:src="@drawable/icon_common_failure" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="@string/layout_layout_ktv_empty_01"
|
||||||
|
android:textColor="#ff666666"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
@@ -0,0 +1,13 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.home.bean
|
||||||
|
|
||||||
|
import lombok.Data
|
||||||
|
|
||||||
|
@Data
|
||||||
|
data class CurrentResourceInfo(
|
||||||
|
val icon: String = "",
|
||||||
|
val id: Int = 0,
|
||||||
|
val posSeq: Int = 0,
|
||||||
|
val resourceContent: String = "",
|
||||||
|
val resourceType: Int = 0,
|
||||||
|
val strategySeq: Int = 0
|
||||||
|
)
|
@@ -3,6 +3,7 @@ package com.yizhuan.xchat_android_core.home.model
|
|||||||
import com.yizhuan.xchat_android_core.R
|
import com.yizhuan.xchat_android_core.R
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||||
import com.yizhuan.xchat_android_core.base.BaseModel
|
import com.yizhuan.xchat_android_core.base.BaseModel
|
||||||
|
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||||
import com.yizhuan.xchat_android_core.community.CommunityConstant
|
import com.yizhuan.xchat_android_core.community.CommunityConstant
|
||||||
import com.yizhuan.xchat_android_core.community.bean.UnReadCountInfo
|
import com.yizhuan.xchat_android_core.community.bean.UnReadCountInfo
|
||||||
@@ -115,6 +116,12 @@ object HomeModel : BaseModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//首页改版资源位
|
||||||
|
suspend fun getCurrentResource(): List<CurrentResourceInfo>? =
|
||||||
|
launchRequest {
|
||||||
|
api.getCurrentResource()
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun getDiamondGiveHistory(page: Int, pageSize: Int): List<DiamondGiveHistoryInfo>? =
|
suspend fun getDiamondGiveHistory(page: Int, pageSize: Int): List<DiamondGiveHistoryInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getRecord(page, pageSize)
|
api.getRecord(page, pageSize)
|
||||||
@@ -155,6 +162,11 @@ object HomeModel : BaseModel() {
|
|||||||
api.getResourceJumpInfo(id)
|
api.getResourceJumpInfo(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun getHomeChatPick(): String? =
|
||||||
|
launchRequest {
|
||||||
|
api.getHomeChatPick()
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
|
suspend fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
|
||||||
launchRequest {
|
launchRequest {
|
||||||
api.getCommonRoom(tabId, pageNum, pageSize)
|
api.getCommonRoom(tabId, pageNum, pageSize)
|
||||||
@@ -305,6 +317,14 @@ object HomeModel : BaseModel() {
|
|||||||
@Query("ticket") ticket: String
|
@Query("ticket") ticket: String
|
||||||
): ServiceResult<List<BannerInfo>>
|
): ServiceResult<List<BannerInfo>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页改版资源位
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("/home/currentResource")
|
||||||
|
suspend fun getCurrentResource(): ServiceResult<List<CurrentResourceInfo>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页热门房间
|
* 首页热门房间
|
||||||
*
|
*
|
||||||
@@ -329,6 +349,14 @@ object HomeModel : BaseModel() {
|
|||||||
@GET("/home/pickResource")
|
@GET("/home/pickResource")
|
||||||
suspend fun getResourceJumpInfo(@Query("id") id: Int): ServiceResult<HomeRoomInfo>
|
suspend fun getResourceJumpInfo(@Query("id") id: Int): ServiceResult<HomeRoomInfo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页资源位跳转
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GET("home/chat/pick")
|
||||||
|
suspend fun getHomeChatPick(): ServiceResult<String>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页热门房间
|
* 首页热门房间
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user