签约房UI

This commit is contained in:
2025-11-26 09:04:58 +08:00
parent cc42d0f90f
commit 1753d9a98d
44 changed files with 693 additions and 20 deletions

View File

@@ -22,6 +22,11 @@ public enum QXRoomSeatViewType {
*/ */
JUKEBOX(9,"点唱麦位"), JUKEBOX(9,"点唱麦位"),
/**
* 签约
*/
SIGNCONTRACT(7,"签约"),
/** /**
* 小黑屋麦位 * 小黑屋麦位
*/ */

View File

@@ -15,7 +15,8 @@ enum class RoomType(
DATING("交友", 1,3, 4, 8), // 1、3、4、8 均对应交友 DATING("交友", 1,3, 4, 8), // 1、3、4、8 均对应交友
BLACK_ROOM("小黑屋", 6), BLACK_ROOM("小黑屋", 6),
JUKEBOX("点唱", 9), JUKEBOX("点唱", 9),
MUTUAL_ENTERTAINMENT("互娱", 7); MUTUAL_ENTERTAINMENT("互娱", 17),
SIGN_CONTRACT("签约", 7);
companion object { companion object {

View File

@@ -18,7 +18,7 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginStart="@dimen/dp_3" android:layout_marginStart="@dimen/dp_3"
android:src="@mipmap/room_ic_wheat_charm" /> android:src="@mipmap/icon_heart_left_bg" />
<TextView <TextView
android:id="@+id/tv_value" android:id="@+id/tv_value"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -913,7 +913,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {} override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
} }
private fun setView(resp: RoomInfoResp?,isSwitchRoomType:Boolean = false) { private fun setView(resp: RoomInfoResp?, isSwitchRoomType: Boolean = false) {
if (resp == null) if (resp == null)
return return
AppStateManager.getInstance().roomInfo = resp AppStateManager.getInstance().roomInfo = resp
@@ -1048,7 +1048,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
fun getRoomInfoResp(): List<RoomPitBean>? { fun getRoomInfoResp(): List<RoomPitBean>? {
val roomPitBeans = mRoomInfoResp?.room_info?.pit_list.orEmpty().filter { val roomPitBeans = mRoomInfoResp?.room_info?.pit_list.orEmpty().filter {
it.user_id != null && it.user_id != "0" && it.user_id.isNotEmpty()&& it.user_id.toInt() != SpUtil.getUserId() && it.pit_number.toInt()<9 it.user_id != null && it.user_id != "0" && it.user_id.isNotEmpty() && it.user_id.toInt() != SpUtil.getUserId() && it.pit_number.toInt() < 9
} }
return roomPitBeans.ifEmpty { null } return roomPitBeans.ifEmpty { null }
} }
@@ -1484,15 +1484,22 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRedRemove) { } else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRedRemove) {
qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id) qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSongerNum //房间点歌数量变化 } else if (msgType == EMMessageInfo.QXRoomMessageTypeSongerNum //房间点歌数量变化
|| msgType ==EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged //点歌房当前歌曲发生变化 || msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged //点歌房当前歌曲发生变化
||msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged) { //点歌房下一首歌曲发生变化 || msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged
) { //点歌房下一首歌曲发生变化
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) { if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
}else if(msgType == EMMessageInfo.QXRoomMessageTypeCPText){ } else if (msgType == EMMessageInfo.QXRoomMessageTypeCPText) {
LogUtils.e("CPText", messageEvent.text.rights_icon) LogUtils.e("CPText", messageEvent.text.rights_icon)
if(messageEvent.text.rights_icon.isNotEmpty()){ if (messageEvent.text.rights_icon.isNotEmpty()) {
QXGiftPlayerManager.getInstance(this).displayCPView(messageEvent.text.fromUserInfo.avatar,messageEvent.text.toUserInfo.avatar,messageEvent.text.fromUserInfo.nickname, messageEvent.text.toUserInfo.nickname,messageEvent.text.rights_icon) QXGiftPlayerManager.getInstance(this).displayCPView(
messageEvent.text.fromUserInfo.avatar,
messageEvent.text.toUserInfo.avatar,
messageEvent.text.fromUserInfo.nickname,
messageEvent.text.toUserInfo.nickname,
messageEvent.text.rights_icon
)
} }
} }
} }
@@ -1769,7 +1776,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
mBinding!!.rlMore.visibility = View.GONE mBinding!!.rlMore.visibility = View.GONE
mBinding!!.rlMisc.visibility = View.GONE mBinding!!.rlMisc.visibility = View.GONE
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = getPitBean(messageEvent, 1) mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
getPitBean(messageEvent, 1)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
@@ -1848,7 +1856,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
//TODO 下麦更换数据 //TODO 下麦更换数据
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp!!.room_info.label_id
if ("1" == labelId) { if ("1" == labelId) {
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber) mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
RoomPitBean(pitNumber)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) { if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) {
@@ -1856,12 +1865,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
} }
} }
RoomType.MUTUAL_ENTERTAINMENT -> { RoomType.MUTUAL_ENTERTAINMENT -> {
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber) mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
else -> { else -> {
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp) roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
} }
@@ -2532,8 +2543,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
mBinding!!.imVoive.setImageResource(com.xscm.moduleutil.R.mipmap.room_voice_kg) mBinding!!.imVoive.setImageResource(com.xscm.moduleutil.R.mipmap.room_voice_kg)
} }
AgoraManager.getInstance().muteSpeaker(voive) AgoraManager.getInstance().muteSpeaker(voive)
if(mRoomInfoResp?.pk_info != null) { if (mRoomInfoResp?.pk_info != null) {
if (!roomFragment?.singSongFragment?.pkMicIsOn!!){ if (!roomFragment?.singSongFragment?.pkMicIsOn!!) {
AgoraManagerEx.getInstance().muteSpeaker(voive) AgoraManagerEx.getInstance().muteSpeaker(voive)
} }
} }
@@ -2544,7 +2555,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
mRoomInfoResp?.room_info?.is_pk!! mRoomInfoResp?.room_info?.is_pk!!
) )
LogUtils.e("pk_info","id == R.id.rl_more ${mRoomInfoResp?.room_info?.is_pk!!}") LogUtils.e("pk_info", "id == R.id.rl_more ${mRoomInfoResp?.room_info?.is_pk!!}")
fragment.show(supportFragmentManager, "RoomPkDialogFragment") fragment.show(supportFragmentManager, "RoomPkDialogFragment")
addActiveDialogFragment(fragment) // 添加到管理列表 addActiveDialogFragment(fragment) // 添加到管理列表
} else if (id == R.id.rl_message) { } else if (id == R.id.rl_message) {
@@ -3316,9 +3327,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
* @description: 初始化音频,初始的时候,当是在麦上,将用户设置为主持,在麦下,设置为观众, 默认关闭麦克风 * @description: 初始化音频,初始的时候,当是在麦上,将用户设置为主持,在麦下,设置为观众, 默认关闭麦克风
*/ */
fun initializeAudio(isSwitchRoomType: Boolean) { fun initializeAudio(isSwitchRoomType: Boolean) {
if (isSwitchRoomType){ if (isSwitchRoomType) {
AgoraManager.getInstance().muteSpeaker(voive) AgoraManager.getInstance().muteSpeaker(voive)
}else{ } else {
if (mRoomUserBean!!.pit_number != 0) { if (mRoomUserBean!!.pit_number != 0) {
AgoraManager.getInstance().ClientRole(true) AgoraManager.getInstance().ClientRole(true)
AgoraManager.getInstance().muteLocalAudioStream(false) AgoraManager.getInstance().muteLocalAudioStream(false)
@@ -3767,7 +3778,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
this.mRoomInfoResp = resp this.mRoomInfoResp = resp
setView(resp,true) setView(resp, true)
} }
fun upHeight() { fun upHeight() {
@@ -3847,6 +3858,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
QXRoomSeatViewType.JUKEBOX QXRoomSeatViewType.JUKEBOX
} }
RoomType.SIGN_CONTRACT -> {
if (mRoomInfoResp!!.room_info.room_background == null || mRoomInfoResp!!.room_info.room_background == "") {
changeBackground(com.xscm.moduleutil.R.mipmap.jukebox_bj)
} else {
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background)
}
setvisibTop(true)
QXRoomSeatViewType.SIGNCONTRACT
}
null -> { null -> {
LogUtils.e("@@@", "RoomType is null") LogUtils.e("@@@", "RoomType is null")
QXRoomSeatViewType.NONE QXRoomSeatViewType.NONE
@@ -4400,10 +4422,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
} }
private fun userPermissionChange(){ private fun userPermissionChange() {
if (getHostUser() < 4){ if (getHostUser() < 4) {
mBinding?.roomTop?.rl?.visibility = View.VISIBLE mBinding?.roomTop?.rl?.visibility = View.VISIBLE
}else{ } else {
mBinding?.roomTop?.rl?.visibility = View.GONE mBinding?.roomTop?.rl?.visibility = View.GONE
} }
} }

View File

@@ -0,0 +1,16 @@
package com.xscm.modulemain.activity.room.contacts
import android.app.Activity
import com.xscm.moduleutil.activity.IPresenter
import com.xscm.moduleutil.activity.IView
class MentorShipContacts {
interface View : IView<Activity>{
}
interface Ipre : IPresenter{
}
}

View File

@@ -58,6 +58,8 @@ import java.util.List;
* @description:房间fragment * @description:房间fragment
*/ */
public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBinding> implements RoomContacts.View { public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBinding> implements RoomContacts.View {
public static RoomFragment newInstance(RoomActivity roomActivity, RoomInfoResp resp) { public static RoomFragment newInstance(RoomActivity roomActivity, RoomInfoResp resp) {
Bundle args = new Bundle(); Bundle args = new Bundle();
RoomFragment fragment = new RoomFragment(roomActivity, resp); RoomFragment fragment = new RoomFragment(roomActivity, resp);
@@ -100,6 +102,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
private RoomJukeboxFragment roomJukeboxFragment;//点唱房 private RoomJukeboxFragment roomJukeboxFragment;//点唱房
private RoomMentorShipFragment mentorShipFragment;//签约
public QXRoomSeatViewType qxRoomSeatViewType; public QXRoomSeatViewType qxRoomSeatViewType;
private void setRoomSeatViewType() { private void setRoomSeatViewType() {
@@ -126,6 +129,8 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
qxRoomSeatViewType = QXRoomSeatViewType.CABIN; qxRoomSeatViewType = QXRoomSeatViewType.CABIN;
} else if (roomType == RoomType.JUKEBOX) { } else if (roomType == RoomType.JUKEBOX) {
qxRoomSeatViewType = QXRoomSeatViewType.JUKEBOX; qxRoomSeatViewType = QXRoomSeatViewType.JUKEBOX;
} else if (roomType == RoomType.SIGN_CONTRACT) {
qxRoomSeatViewType = QXRoomSeatViewType.SIGNCONTRACT;
} }
} }
@@ -300,6 +305,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (roomJukeboxFragment != null && roomJukeboxFragment.isAdded()) { if (roomJukeboxFragment != null && roomJukeboxFragment.isAdded()) {
roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp); roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp);
} }
}else if (roomType == RoomType.SIGN_CONTRACT) {
if (mentorShipFragment != null && mentorShipFragment.isAdded()) {
mentorShipFragment.roomInfoUpdate(mRoomInfoResp);
}
} }
} }
} }
@@ -419,6 +428,13 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
roomJukeboxFragment = RoomJukeboxFragment.newInstance(mRoomInfoResp); roomJukeboxFragment = RoomJukeboxFragment.newInstance(mRoomInfoResp);
else roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp); else roomJukeboxFragment.roomInfoUpdate(mRoomInfoResp);
newFragment = roomJukeboxFragment; newFragment = roomJukeboxFragment;
} else if (roomType == RoomType.SIGN_CONTRACT) {
if(mentorShipFragment == null){
mentorShipFragment = RoomMentorShipFragment.Companion.newInstance(mRoomInfoResp);
}else{
mentorShipFragment.roomInfoUpdate(mRoomInfoResp);
}
newFragment = mentorShipFragment;
} }
if (newFragment != null) { if (newFragment != null) {
@@ -895,6 +911,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
if (roomJukeboxFragment != null) { if (roomJukeboxFragment != null) {
handleJukeboxEvent(messageEvent); handleJukeboxEvent(messageEvent);
} }
case SIGNCONTRACT:
if (mentorShipFragment != null) {
handleMentorshipEvent(messageEvent);
}
case CABIN: case CABIN:
default: default:
@@ -903,6 +923,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
} }
} }
private void handleMentorshipEvent(RoomMessageEvent messageEvent) {
}
// TODO: 2025/11/17 点唱房 // TODO: 2025/11/17 点唱房
private void handleJukeboxEvent(RoomMessageEvent messageEvent) { private void handleJukeboxEvent(RoomMessageEvent messageEvent) {
switch (messageEvent.getMsgType()) { switch (messageEvent.getMsgType()) {

View File

@@ -0,0 +1,50 @@
package com.xscm.modulemain.activity.room.fragment
import com.blankj.utilcode.util.ActivityUtils
import com.xscm.modulemain.R
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
import com.xscm.modulemain.activity.room.presenter.MentorShipPresenter
import com.xscm.modulemain.databinding.FragmentMentorShipBinding
import com.xscm.moduleutil.base.BaseMvpFragment
import com.xscm.moduleutil.bean.room.RoomInfoResp
/**
* 签约房
* 1234 5 9
*/
class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp) :
BaseMvpFragment<MentorShipPresenter, FragmentMentorShipBinding>(), MentorShipContacts.View {
companion object {
@Volatile
private var INSTANCE: RoomMentorShipFragment? = null
fun newInstance(roomInfoResp: RoomInfoResp): RoomMentorShipFragment {
return INSTANCE ?: synchronized(this) {
INSTANCE ?: RoomMentorShipFragment(roomInfoResp).also { INSTANCE = it }
}
}
}
override fun getLayoutId(): Int {
return R.layout.fragment_mentor_ship
}
override fun bindPresenter(): MentorShipPresenter {
return MentorShipPresenter(ActivityUtils.getTopActivity(), this)
}
override fun initData() {
}
override fun initView() {
}
fun roomInfoUpdate(mRoomInfoResp: RoomInfoResp) {
mRoomInfo = mRoomInfoResp
}
}

View File

@@ -0,0 +1,10 @@
package com.xscm.modulemain.activity.room.presenter
import android.content.Context
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
import com.xscm.moduleutil.presenter.BasePresenter
class MentorShipPresenter(context: Context, view: MentorShipContacts.View) :
BasePresenter<MentorShipContacts.View>(view, context), MentorShipContacts.Ipre {
}

View File

@@ -0,0 +1,126 @@
package com.xscm.modulemain.widget
import android.content.Context
import android.content.res.TypedArray
import android.text.TextUtils
import android.util.AttributeSet
import com.xscm.modulemain.R
import com.xscm.moduleutil.bean.room.RoomPitBean
import com.xscm.moduleutil.utils.ImageUtils
import com.xscm.moduleutil.widget.BaseWheatView
class RoomMentorShipWheatView(context: Context?) : BaseWheatView(context) {
constructor(context: Context?, attrs: AttributeSet?) : this(context) {
initPit(context, attrs)
}
override fun getLayoutId(): Int {
return R.layout.layout_room_mentorship_wheat
}
// 提供一个方法来设置这个属性,便于在代码中动态更改
fun setRoomWheatNumber(number: String?) {
this.pitNumber = number
}
override fun setPitData(bean: RoomPitBean?) {
if (bean == null) return
pitBean = bean // 统一使用参数 bean
stopAndClearAnimation() // 清理之前的动画资源
if (isOn) {
handleOnState(bean)
} else {
handleOffState(bean)
}
}
private fun stopAndClearAnimation() {
if (mIvRipple != null) {
mIvRipple.stopAnimation(true)
}
}
private fun handleOnState(bean: RoomPitBean) {
mIvRipple.visibility = VISIBLE
mTvName.visibility = VISIBLE
mTvName.text = bean.nickname
ImageUtils.loadHeadCC(bean.avatar, mRiv)
mCharmView.visibility = VISIBLE
if (TextUtils.isEmpty(bean.dress)) {
mIvFrame.stopAll()
mIvFrame.visibility = INVISIBLE
} else {
mIvFrame.visibility = VISIBLE
mIvFrame.setSource(bean.dress, 3)
}
}
private fun handleOffState(bean: RoomPitBean) {
if (bean.pit_number == "9") {
mTvName.visibility = GONE
} else {
mTvName.visibility = VISIBLE
mTvName.setText(getPitNumberText())
}
mCharmView.visibility = GONE
mRiv.visibility = VISIBLE
mRiv.setImageResource(R.mipmap.jukebox_room_mask)
mIvShutup.visibility = GONE
mIvFrame.stopAll()
mIvFrame.visibility = GONE
mIvRipple.visibility = GONE
}
private fun getPitNumberText(): String {
if ("-1" == pitNumber) return ""
if ("9" == pitNumber) return ""
if ("10" == pitNumber) return "老板"
return pitNumber + "号麦"
}
override fun initPit(context: Context?, attrs: AttributeSet?) {
var typedArray: TypedArray? = null
try {
typedArray = context!!.obtainStyledAttributes(
attrs,
com.xscm.moduleutil.R.styleable.RoomDefaultWheatView
)
pitNumber =
typedArray.getString(com.xscm.moduleutil.R.styleable.RoomDefaultWheatView_room_wheat_number)
} finally {
typedArray?.recycle()
}
mCharmView = findViewById(R.id.charm_view)
mIvRipple = findViewById(R.id.iv_ripple)
mIvFrame = findViewById(R.id.iv_frame)
mIvShutup = findViewById(R.id.iv_shutup)
mRiv = findViewById(R.id.riv)
}
override fun onRemoteSoundLevelUpdate(userId: String?, soundLevel: Int) {
}
override fun onLocalSoundLevelUpdate(volume: Int) {
}
override fun userJoined(userId: Int, elapsd: Int) {
}
override fun userOffline(userId: Int, reason: Int) {
}
override fun pkOffSide(userId: Int) {
}
}

View File

@@ -0,0 +1,265 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data></data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_10">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="@dimen/dp_10" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/icon_mentor_ship_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/youshebiaotihei"
android:text="签约房"
android:textColor="@color/white"
android:textSize="@dimen/sp_18"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_top" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="@dimen/sp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="倒计时00:00" />
<TextView
android:id="@+id/tv_time_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_3"
android:background="@drawable/shape_15"
android:backgroundTint="#3ABC6D"
android:gravity="center"
android:paddingHorizontal="@dimen/dp_8"
android:paddingVertical="@dimen/dp_1"
android:textColor="@color/white"
android:textSize="@dimen/sp_13"
app:layout_constraintBottom_toBottomOf="@id/tv_time"
app:layout_constraintEnd_toStartOf="@id/tv_time"
app:layout_constraintTop_toTopOf="@id/tv_time"
android:text="开始" />
<TextView
android:id="@+id/tv_time_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_3"
android:background="@drawable/shape_15"
android:backgroundTint="#33FFFFFF"
android:gravity="center"
android:paddingHorizontal="@dimen/dp_8"
android:paddingVertical="@dimen/dp_1"
android:text="结束"
android:textColor="@color/white"
android:textSize="@dimen/sp_13"
app:layout_constraintBottom_toBottomOf="@id/tv_time"
app:layout_constraintStart_toEndOf="@id/tv_time"
app:layout_constraintTop_toTopOf="@id/tv_time" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_1"
android:layout_width="@dimen/dp_36"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_10"
app:layout_constraintDimensionRatio="1:1.4.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_top" />
<ImageView
android:id="@+id/iv_host_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_35"
android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/icon_host_top_tips_bg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_mentor_ship_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="@dimen/dp_10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_left_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<View
android:id="@+id/view_left_price"
android:layout_width="@dimen/dp_84"
android:layout_height="@dimen/dp_86"
android:background="@drawable/shape_dialog"
android:backgroundTint="#33000000"
app:layout_constraintEnd_toStartOf="@id/iv_apply_for_mai"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
<ImageView
android:id="@+id/iv_left_price_gold_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_gold_bg"
app:layout_constraintBottom_toTopOf="@id/tv_left_price"
app:layout_constraintEnd_toEndOf="@id/view_left_price"
app:layout_constraintStart_toStartOf="@id/view_left_price"
app:layout_constraintTop_toTopOf="@id/view_left_price"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/tv_left_price_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_15"
android:backgroundTint="#FF49E4A1"
android:paddingHorizontal="@dimen/dp_8"
android:paddingVertical="@dimen/dp_3"
android:text="起拍价格"
android:textColor="@color/black"
android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="@id/gl_left_price"
app:layout_constraintEnd_toStartOf="@id/iv_apply_for_mai"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
<TextView
android:id="@+id/tv_left_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9998"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:textStyle="normal"
app:layout_constraintBottom_toBottomOf="@id/view_left_price"
app:layout_constraintEnd_toEndOf="@id/view_left_price"
app:layout_constraintStart_toStartOf="@id/view_left_price"
app:layout_constraintTop_toBottomOf="@id/iv_left_price_gold_bg" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_midd"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
<ImageView
android:id="@+id/iv_apply_for_mai"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_75"
android:src="@mipmap/icon_apply_for_mai"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
<ImageView
android:id="@+id/iv_left_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:src="@mipmap/icon_mentor_left_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_left"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintEnd_toEndOf="@id/iv_left_bg"
app:layout_constraintStart_toStartOf="@id/iv_left_bg"
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/fly_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.86" />
<ImageView
android:id="@+id/iv_right_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
android:src="@mipmap/icon_mentor_right_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_right_left"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
android:layout_marginStart="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintStart_toStartOf="@id/iv_right_bg"
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_right_midd"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintEnd_toEndOf="@id/iv_right_bg"
app:layout_constraintStart_toStartOf="@id/iv_right_bg"
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
<com.xscm.modulemain.widget.RoomMentorShipWheatView
android:id="@+id/rmsw_right_right"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="@id/fly_bottom"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintEnd_toEndOf="@id/iv_right_bg"
app:layout_constraintStart_toStartOf="@id/rmsw_right_midd"
app:layout_constraintTop_toTopOf="@id/fly_bottom" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/avatar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:clipChildren="false"
android:clipToPadding="false">
<!-- 离线状态 - 与头像框同样大小 -->
<ImageView
android:id="@+id/iv_online"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@mipmap/room_ic_owner_offline"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/iv_frame"
app:layout_constraintEnd_toEndOf="@id/iv_frame"
app:layout_constraintStart_toStartOf="@id/iv_frame"
app:layout_constraintTop_toTopOf="@id/iv_frame"
tools:visibility="visible" />
<!-- 用户头像 -->
<com.xscm.moduleutil.widget.CircularImage
android:id="@+id/riv"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitCenter"
android:src="@mipmap/room_ic_wheat_default"
app:layout_constraintBottom_toBottomOf="@id/gl_center"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_center"
app:layout_constraintWidth_percent="0.9" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_center"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_1"
app:layout_constraintGuide_percent="0.46"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- 头像框 - 包裹头像 -->
<com.xscm.moduleutil.widget.AvatarFrameView
android:id="@+id/iv_frame"
android:layout_width="0dp"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/gl_center"
app:layout_constraintDimensionRatio="1.1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_center"
app:layout_constraintWidth_percent="1"
tools:visibility="visible" />
<!-- 麦圈 - 在头像框上面展示 -->
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/iv_ripple"
android:layout_width="0dp"
android:layout_height="0dp"
app:autoPlay="false"
app:layout_constraintBottom_toBottomOf="@id/gl_center"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_center"
app:layout_constraintWidth_percent="1"
app:loopCount="0"
app:source="mic.svga" />
<!-- 麦克风状态 - 头像框右下角 -->
<ImageView
android:id="@+id/iv_shutup"
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_2"
android:layout_marginBottom="@dimen/dp_2"
android:src="@mipmap/room_microphone_off"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/tv_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_goneMarginBottom="@dimen/dp_10"
app:layout_goneMarginEnd="@dimen/dp_10"
tools:visibility="visible" />
<!-- 用户名称 - 在头像之下 -->
<TextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_1"
android:gravity="center"
android:paddingVertical="@dimen/dp_2"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:singleLine="true"
android:text="麦位1"
android:textColor="@color/white"
android:textSize="@dimen/sp_8"
app:layout_constraintBottom_toTopOf="@id/charm_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:textColor="@color/color_FF333333" />
<!-- 心动值 - 在名称之下 -->
<com.xscm.moduleutil.widget.WheatCharmView
android:id="@+id/charm_view"
android:layout_width="wrap_content"
android:minWidth="@dimen/dp_20"
android:layout_height="@dimen/dp_12"
android:clipChildren="false"
android:clipToPadding="false"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/iv_gift"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="@id/gl_center"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/gl_center" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>