签约 1
This commit is contained in:
@@ -73,6 +73,10 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
for ((idx, view) in viewList.withIndex()) {
|
||||
if (mRoomInfo?.room_info?.pit_list!!.size > indexList[idx].toInt() - 1) {
|
||||
view.setRoomWheatNumber(indexList[idx])
|
||||
if (idx == 0) {
|
||||
view.setHostTv(mBinding.tvHostName)
|
||||
}
|
||||
view.isMentorShip(true)
|
||||
view.setData(mRoomInfo?.room_info?.pit_list!![indexList[idx].toInt() - 1])
|
||||
view.setOnClickListener { v ->
|
||||
if (ClickUtils.isFastDoubleClick(v)) {
|
||||
@@ -107,7 +111,14 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
pitBean =
|
||||
mRoomInfo?.room_info?.pit_list!![indexList[idx].toInt() - 1]
|
||||
|
||||
showPopupMenu(view)
|
||||
// 处理抱麦逻辑
|
||||
RoomOnlineDialogFragment.show(
|
||||
roomId,
|
||||
pitBean?.pit_number,
|
||||
mRoomInfo?.user_info,
|
||||
mRoomInfo,
|
||||
childFragmentManager
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,13 @@ import android.content.res.TypedArray
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
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 : BaseWheatView {
|
||||
private var iv_tag_type: ImageView? = null
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
@@ -24,6 +23,10 @@ class RoomMentorShipWheatView : BaseWheatView {
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
|
||||
private var iv_tag_type: ImageView? = null
|
||||
private var hostTv:TextView? = null
|
||||
|
||||
override fun initPit(context: Context, attrs: AttributeSet) {
|
||||
var typedArray: TypedArray? = null
|
||||
try {
|
||||
@@ -54,14 +57,25 @@ class RoomMentorShipWheatView : BaseWheatView {
|
||||
this.pitNumber = number
|
||||
}
|
||||
|
||||
fun setHostTv(hostTv:TextView){
|
||||
this.hostTv = hostTv
|
||||
}
|
||||
|
||||
public override fun setPitData(bean: RoomPitBean) {
|
||||
pitBean = bean // 统一使用参数 bean
|
||||
stopAndClearAnimation() // 清理之前的动画资源
|
||||
|
||||
if (pitBean.pit_number == "9" || pitBean.pit_number == "1") {
|
||||
if ((pitBean.pit_number == "9" || pitBean.pit_number == "1") && bean.user_id != "0") {
|
||||
mCharmView.visibility = VISIBLE
|
||||
if (pitBean.pit_number == "9") {
|
||||
mTvName.visibility = GONE
|
||||
hostTv?.visibility = VISIBLE
|
||||
hostTv?.text = bean.nickname
|
||||
}
|
||||
}else{
|
||||
mTvName.visibility = VISIBLE
|
||||
mCharmView.visibility = INVISIBLE
|
||||
hostTv?.visibility = GONE
|
||||
}
|
||||
|
||||
if (isOn) {
|
||||
@@ -70,8 +84,7 @@ class RoomMentorShipWheatView : BaseWheatView {
|
||||
handleOffState(bean)
|
||||
}
|
||||
|
||||
iv_tag_type!!.visibility = if (bean.isImageType) VISIBLE else GONE
|
||||
iv_tag_type!!.setImageResource(com.xscm.moduleutil.R.mipmap.mu_yc)
|
||||
iv_tag_type!!.visibility = GONE
|
||||
}
|
||||
|
||||
fun setSex(value: String?, format: Boolean) {
|
||||
@@ -86,7 +99,6 @@ class RoomMentorShipWheatView : BaseWheatView {
|
||||
|
||||
private fun handleOnState(bean: RoomPitBean) {
|
||||
mIvRipple.visibility = VISIBLE
|
||||
mTvName.visibility = VISIBLE
|
||||
mTvName.text = bean.nickname
|
||||
ImageUtils.loadHeadCC(bean.avatar, mRiv)
|
||||
mCharmView.visibility = VISIBLE
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
android:layout_width="@dimen/dp_36"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintDimensionRatio="1:1.2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/gl_top" />
|
||||
|
||||
@@ -97,12 +97,22 @@
|
||||
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:layout_marginStart="@dimen/dp_40"
|
||||
android:src="@mipmap/icon_host_top_tips_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_host_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_48"
|
||||
android:textColor="#FFEFEAFF"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_mentor_ship_help"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -110,11 +110,7 @@
|
||||
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="虚位以待"
|
||||
android:textColor="@color/white"
|
||||
@@ -134,6 +130,7 @@
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"
|
||||
android:backgroundTint="@color/transparent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
Reference in New Issue
Block a user