1.纯图片铭牌适配(乱入...) 2.首页派对小游戏tab
This commit is contained in:
@@ -58,7 +58,6 @@ import com.yizhuan.erban.event.OpenRoomIntroEvent
|
||||
import com.yizhuan.erban.friend.view.SelectFriendActivity
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter.RoomActClickListener
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog
|
||||
@@ -67,12 +66,10 @@ import com.yizhuan.erban.ui.widget.GiftDialog.SenGiftCallback
|
||||
import com.yizhuan.erban.ui.widget.UserInfoDialog
|
||||
import com.yizhuan.erban.ui.widget.dialog.OpenNobleDialog
|
||||
import com.yizhuan.erban.ui.widget.dynamicface.DynamicFaceDialog
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.yizhuan.erban.utils.KeyBoardUtils
|
||||
import com.yizhuan.erban.utils.UserUtils
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
@@ -99,7 +96,6 @@ import com.yizhuan.xchat_android_core.room.bean.RoomInfo
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent
|
||||
import com.yizhuan.xchat_android_core.room.face.FaceInfo
|
||||
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel
|
||||
import com.yizhuan.xchat_android_core.room.model.MicQueueModel
|
||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo
|
||||
import com.yizhuan.xchat_android_core.share.bean.SessionType
|
||||
@@ -111,7 +107,6 @@ import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.BaseInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.utils.RxNetWorkUtils
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
@@ -120,7 +115,6 @@ import com.yizhuan.xchat_android_library.utils.config.BasicConfig
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.functions.BiConsumer
|
||||
import io.reactivex.functions.Consumer
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
@@ -674,19 +674,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
}
|
||||
}
|
||||
|
||||
fun isPlaying(): Boolean {
|
||||
val dataJson = iSudFSTAPP?.getGameState(SudMGPMGState.MG_COMMON_PLAYER_PLAYING)
|
||||
LogUtils.d(dataJson)
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
return jsonObject.getBoolean("isPlaying")
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
fun onStart() {
|
||||
iSudFSTAPP?.startMG() //启动游戏
|
||||
}
|
||||
|
@@ -19,6 +19,9 @@ class HomeViewModel : BaseViewModel() {
|
||||
private val _hotRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||
val hotRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _hotRoomLiveData
|
||||
|
||||
private val _gameRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||
val gameRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _gameRoomLiveData
|
||||
|
||||
private val _concernsLiveData = MutableLiveData<List<HomeConcernsInfo>>()
|
||||
val concernsLiveData: LiveData<List<HomeConcernsInfo>> = _concernsLiveData
|
||||
|
||||
@@ -98,6 +101,17 @@ class HomeViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getGameRoom(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_gameRoomLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
val result = HomeModel.getGameRoom(pageNum, pageSize)
|
||||
_gameRoomLiveData.value = ListResult.success(result, pageNum)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getCollectRoom(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
@@ -113,11 +127,21 @@ class HomeViewModel : BaseViewModel() {
|
||||
val collectRooms = async(Dispatchers.IO) {
|
||||
HomeModel.getCollectRoom(pageNum, pageSize)
|
||||
}
|
||||
_concernsLiveData.value = concernsRooms.await()
|
||||
_collectLiveData.value =
|
||||
ListResult.success(collectRooms.await()?.fansRoomList, pageNum)
|
||||
_emptyLiveData.value = concernsRooms.await().isNullOrEmpty() &&
|
||||
collectRooms.await()?.fansRoomList.isNullOrEmpty()
|
||||
try {
|
||||
_concernsLiveData.value = concernsRooms.await()
|
||||
} catch (e: Exception) {
|
||||
_concernsLiveData.value = null
|
||||
}
|
||||
|
||||
try {
|
||||
_collectLiveData.value =
|
||||
ListResult.success(collectRooms.await()?.fansRoomList, pageNum)
|
||||
} catch (e: Exception) {
|
||||
_collectLiveData.value = ListResult.failed(pageNum)
|
||||
}
|
||||
|
||||
_emptyLiveData.value = _concernsLiveData.value.isNullOrEmpty() &&
|
||||
_collectLiveData.value?.data.isNullOrEmpty()
|
||||
} else {
|
||||
val result = HomeModel.getCollectRoom(pageNum, pageSize)
|
||||
_collectLiveData.value = ListResult.success(result?.fansRoomList, pageNum)
|
||||
|
@@ -1,14 +1,17 @@
|
||||
package com.yizhuan.erban.home.adapter
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Shader
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isGone
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
|
||||
|
||||
class RoomGameAdapter : BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.item_room_game) {
|
||||
@@ -17,15 +20,41 @@ class RoomGameAdapter : BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.
|
||||
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
|
||||
helper.apply {
|
||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
||||
setText(R.id.tv_online_number, "${item.onlineNum}人热聊中")
|
||||
setText(R.id.tv_room_title, item.title)
|
||||
itemView.setOnClickListener {
|
||||
AVRoomActivity.start(mContext, item.uid)
|
||||
}
|
||||
val tvRoomGame = helper.getView<TextView>(R.id.tv_room_game)
|
||||
tvRoomGame.text = item.mgName
|
||||
helper.setText(R.id.tv_game_status, if (item.state == 1) "游戏中" else "等人中")
|
||||
setGradient(tvRoomGame)
|
||||
}
|
||||
|
||||
helper.setVisible(R.id.iv_room_tag, !TextUtils.isEmptyText(item.tagPict))
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_room_tag), item.tagPict)
|
||||
val avatars: Array<ImageView> = arrayOf(
|
||||
helper.getView(R.id.iv_avatar_0),
|
||||
helper.getView(R.id.iv_avatar_1),
|
||||
helper.getView(R.id.iv_avatar_2),
|
||||
helper.getView(R.id.iv_avatar_3),
|
||||
helper.getView(R.id.iv_avatar_4)
|
||||
)
|
||||
for (i in avatars.indices) {
|
||||
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
|
||||
avatars[i].isGone = avatarUrl.isNullOrBlank()
|
||||
avatars[i].load(avatarUrl)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setGradient(textView: TextView) {
|
||||
val endX = textView.paint.textSize * textView.text.length
|
||||
val linearGradient = LinearGradient(
|
||||
0f, 0f, endX, 0f,
|
||||
Color.parseColor("#FF61C4FE"),
|
||||
Color.parseColor("#FFA979FF"),
|
||||
Shader.TileMode.CLAMP
|
||||
)
|
||||
textView.paint.shader = linearGradient
|
||||
textView.invalidate()
|
||||
}
|
||||
|
||||
}
|
@@ -11,7 +11,6 @@ import com.yizhuan.erban.home.adapter.RoomGameAdapter
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
|
||||
|
||||
class RoomGameFragment : BaseViewBindingFragment<FragmentRoomGameBinding>() {
|
||||
|
||||
companion object {
|
||||
@@ -35,22 +34,38 @@ class RoomGameFragment : BaseViewBindingFragment<FragmentRoomGameBinding>() {
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.setEmptyView(EmptyViewHelper.createEmptyView(context, "暂无房间"))
|
||||
.setLayoutManager(LinearLayoutManager(mContext))
|
||||
.setRefreshLayout(binding.refreshLayout)
|
||||
.setPageSize(pageSize)
|
||||
.build()
|
||||
|
||||
roomHotAdapter.setOnLoadMoreListener({ loadData(false) }, binding.recyclerView)
|
||||
|
||||
homeViewModel.hotRoomLiveData.observe(this) {
|
||||
binding.refreshLayout.setOnRefreshListener {
|
||||
loadData(true)
|
||||
}
|
||||
homeViewModel.gameRoomLiveData.observe(this) {
|
||||
rvDelegate.loadData(it)
|
||||
}
|
||||
|
||||
binding.tvMatch.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
loadData(true)
|
||||
}
|
||||
|
||||
private fun loadData(isRefresh: Boolean) {
|
||||
|
||||
binding.refreshLayout.isRefreshing = isRefresh
|
||||
|
||||
if (isRefresh) {
|
||||
page = 1
|
||||
} else {
|
||||
page++
|
||||
}
|
||||
homeViewModel.getHotRoom(page, pageSize)
|
||||
homeViewModel.getGameRoom(page, pageSize)
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_home_game_item.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_home_game_item.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_home_game_go_room.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_home_game_go_room.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
@@ -113,7 +113,7 @@
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/in_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
@@ -122,11 +122,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -129,11 +129,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -1,9 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/recycler_view"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_match"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="35dp"
|
||||
android:gravity="center"
|
||||
android:paddingStart="9dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="快速匹配"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="16sp"
|
||||
app:corner="20dp"
|
||||
app:shaderEnable="true"
|
||||
app:shaderEndColor="#FFA936"
|
||||
app:shaderMode="leftToRight"
|
||||
app:shaderStartColor="#FFCB47" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
@@ -72,11 +72,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -67,15 +67,13 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_official_mask"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -5,15 +5,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:background="@drawable/bg_home_common_item"
|
||||
android:layout_height="96dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:background="@drawable/bg_home_game_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -23,6 +22,7 @@
|
||||
android:layout_width="74dp"
|
||||
android:layout_height="74dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -60,108 +60,122 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="14sp"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_room_tag"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_room_game"
|
||||
app:layout_constraintStart_toEndOf="@id/view_room_cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="余生点唱歌曲交友房间" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_tag"
|
||||
<TextView
|
||||
android:id="@+id/tv_room_game"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="10dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_avatar"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
||||
tools:src="@drawable/tag_101"
|
||||
tools:text="聊天" />
|
||||
tools:text="你画我猜" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_line"
|
||||
android:layout_width="1px"
|
||||
android:layout_height="9dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="#FFD8D8D8"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_room_game"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_room_game"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_room_game" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id"
|
||||
android:id="@+id/tv_game_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:textColor="#66333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_tag"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_tag"
|
||||
tools:text="ID:1234" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:drawableStart="@drawable/ic_home_hot_hot"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginStart="4dp"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="266" />
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_room_game"
|
||||
app:layout_constraintStart_toEndOf="@id/view_line"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_room_game"
|
||||
tools:text="游戏中" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_avatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="18dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_room_game">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_0"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
app:cborder_width="2dp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_1"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="14dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_2"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="28dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
app:cborder_width="2dp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_2"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="56dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="2dp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_3"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="44dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="84dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
app:cborder_width="2dp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_4"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="58dp"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="112dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="@color/white"
|
||||
app:cborder_width="1px" />
|
||||
app:cborder_width="2dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_go_room"
|
||||
android:layout_width="68dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_home_game_go_room"
|
||||
android:text="进房"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -56,15 +56,13 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_official_mask"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -10,15 +10,13 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_official_mask"
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -94,9 +94,9 @@
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -103,11 +103,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -67,11 +67,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_official_mask"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_temp_official_mask" />
|
||||
|
@@ -30,6 +30,9 @@ public class HomeRoomInfo implements MultiItemEntity {
|
||||
private boolean crossPking;
|
||||
private boolean valid;
|
||||
private boolean isBanner;
|
||||
private long mgId;
|
||||
private String mgName;
|
||||
public int state;
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
|
@@ -129,6 +129,12 @@ object HomeModel : BaseModel() {
|
||||
api.getCommonRoom(tabId, pageNum, pageSize)
|
||||
}
|
||||
|
||||
suspend fun getGameRoom(pageNum: Int, pageSize: Int): List<HomeRoomInfo>? =
|
||||
launchRequest {
|
||||
api.getGameRoom(pageNum, pageSize)
|
||||
}
|
||||
|
||||
|
||||
|
||||
suspend fun getHomeTag(): List<HomeTagInfo>? =
|
||||
launchRequest {
|
||||
@@ -251,6 +257,17 @@ object HomeModel : BaseModel() {
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<HomeRoomInfo>>
|
||||
|
||||
/**
|
||||
* 首页游戏房间
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("home/miniGameTabList")
|
||||
suspend fun getGameRoom(
|
||||
@Query("pageNum") pageNum: Int,
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<HomeRoomInfo>>
|
||||
|
||||
/**
|
||||
* 首页派对 Tag List
|
||||
*
|
||||
|
Reference in New Issue
Block a user