酒吧 撩她动画播放 and setTime 显示。
This commit is contained in:
@@ -50,7 +50,7 @@ import java.net.URL;
|
|||||||
|
|
||||||
public abstract class BaseWheatView extends ConstraintLayout implements IBaseWheat {
|
public abstract class BaseWheatView extends ConstraintLayout implements IBaseWheat {
|
||||||
public ImageView mRiv;
|
public ImageView mRiv;
|
||||||
public ImageView mIvGift;
|
|
||||||
public WheatCharmView mCharmView;
|
public WheatCharmView mCharmView;
|
||||||
public TextView mTvName;
|
public TextView mTvName;
|
||||||
public ImageView mIvSex;
|
public ImageView mIvSex;
|
||||||
@@ -73,9 +73,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
|
|
||||||
public static final String WHEAT_HOST = "9";//主持位
|
public static final String WHEAT_HOST = "9";//主持位
|
||||||
|
|
||||||
public float oX;
|
|
||||||
public float oY;
|
|
||||||
|
|
||||||
boolean closePhone = false;//自己麦位关闭话筒,用于判断声纹显示
|
boolean closePhone = false;//自己麦位关闭话筒,用于判断声纹显示
|
||||||
|
|
||||||
public String pitNumber;
|
public String pitNumber;
|
||||||
@@ -105,7 +102,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
inflate(context, getLayoutId(), this);
|
inflate(context, getLayoutId(), this);
|
||||||
mRiv = findViewById(R.id.riv);
|
mRiv = findViewById(R.id.riv);
|
||||||
mIvGift = findViewById(R.id.iv_gift);
|
// mIvGift = findViewById(R.id.iv_gift);
|
||||||
mCharmView = findViewById(R.id.charm_view);
|
mCharmView = findViewById(R.id.charm_view);
|
||||||
mTvName = findViewById(R.id.tv_name);
|
mTvName = findViewById(R.id.tv_name);
|
||||||
mIvSex = findViewById(R.id.iv_sex);
|
mIvSex = findViewById(R.id.iv_sex);
|
||||||
@@ -122,8 +119,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
tv_zhul = findViewById(R.id.tv_zhul);
|
tv_zhul = findViewById(R.id.tv_zhul);
|
||||||
setClipChildren(false);
|
setClipChildren(false);
|
||||||
setClipToPadding(false);
|
setClipToPadding(false);
|
||||||
oX = mIvGift.getX();
|
|
||||||
oY = mIvGift.getY();
|
|
||||||
initPit(context, attrs);
|
initPit(context, attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,14 +500,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
@Override
|
@Override
|
||||||
public void showGift(RoomGiveGiftModel.GiftListBean listBean) {
|
public void showGift(RoomGiveGiftModel.GiftListBean listBean) {
|
||||||
if (!showGiftAnim) {
|
|
||||||
mIvGift.setVisibility(GONE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (listBean.getUser_id() == null || !listBean.getUser_id().equals(pitBean.getUser_id())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
WheatGiftAnim.addGift(mIvGift, listBean.getPicture());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -125,6 +125,10 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
val bean = mRoomInfoResp?.room_info?.pit_list!![indexList[idx].toInt() - 1]
|
val bean = mRoomInfoResp?.room_info?.pit_list!![indexList[idx].toInt() - 1]
|
||||||
view.setData(bean)
|
view.setData(bean)
|
||||||
|
|
||||||
|
if (idx == 0 && mUserInfo?.user_id.toString() == bean.user_id) {
|
||||||
|
mBinding.ivSetTime.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
if (idx != 0 && idx != 1) {
|
if (idx != 0 && idx != 1) {
|
||||||
if (!TextUtils.isEmpty(bean.user_id) && !bean.user_id.equals("0")) {
|
if (!TextUtils.isEmpty(bean.user_id) && !bean.user_id.equals("0")) {
|
||||||
startTimer(bean.end_time.toLong())
|
startTimer(bean.end_time.toLong())
|
||||||
@@ -308,12 +312,18 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
|
|
||||||
fun event1003(messageEvent: RoomMessageEvent) {
|
fun event1003(messageEvent: RoomMessageEvent) {
|
||||||
val pitNumber = messageEvent.text.pit_number
|
val pitNumber = messageEvent.text.pit_number
|
||||||
|
|
||||||
if (indexList.contains(pitNumber)) {
|
if (indexList.contains(pitNumber)) {
|
||||||
val viewPos = indexList.indexOf(pitNumber)
|
val viewPos = indexList.indexOf(pitNumber)
|
||||||
val pitBean = mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1]
|
val pitBean = mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1]
|
||||||
pitBean.end_time = messageEvent.text.end_time
|
pitBean.end_time = messageEvent.text.end_time
|
||||||
viewList[viewPos].setData(pitBean)
|
viewList[viewPos].setData(pitBean)
|
||||||
|
|
||||||
|
if (mUserInfo?.user_id.toString() == pitBean.user_id) {
|
||||||
|
mBinding.ivSetTime.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startTimer(messageEvent.text.end_time.toLong())
|
startTimer(messageEvent.text.end_time.toLong())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.xscm.modulemain.widget
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.TypedArray
|
import android.content.res.TypedArray
|
||||||
import android.media.Image
|
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -15,7 +14,6 @@ import com.xscm.moduleutil.utils.ImageUtils
|
|||||||
import com.xscm.moduleutil.utils.SpUtil
|
import com.xscm.moduleutil.utils.SpUtil
|
||||||
import com.xscm.moduleutil.widget.AvatarFrameView
|
import com.xscm.moduleutil.widget.AvatarFrameView
|
||||||
import com.xscm.moduleutil.widget.BaseWheatView
|
import com.xscm.moduleutil.widget.BaseWheatView
|
||||||
import com.xscm.moduleutil.widget.WheatGiftAnim
|
|
||||||
|
|
||||||
class RoomPubWheatView : BaseWheatView {
|
class RoomPubWheatView : BaseWheatView {
|
||||||
constructor(context: Context?) : super(context)
|
constructor(context: Context?) : super(context)
|
||||||
@@ -35,10 +33,11 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
private var hostTv: TextView? = null
|
private var hostTv: TextView? = null
|
||||||
private var tv_time: TextView? = null
|
private var tv_time: TextView? = null
|
||||||
private var ll_bottom: LinearLayout? = null
|
private var ll_bottom: LinearLayout? = null
|
||||||
private var iv_gift: ImageView? = null
|
private var iv_gift: AvatarFrameView? = null
|
||||||
var ivYueT: ImageView? = null
|
var ivYueT: ImageView? = null
|
||||||
var ivLiaoT: ImageView? = null
|
var ivLiaoT: ImageView? = null
|
||||||
|
|
||||||
|
|
||||||
override fun initPit(context: Context, attrs: AttributeSet) {
|
override fun initPit(context: Context, attrs: AttributeSet) {
|
||||||
var typedArray: TypedArray? = null
|
var typedArray: TypedArray? = null
|
||||||
try {
|
try {
|
||||||
@@ -77,10 +76,6 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
this.pitNumber = number
|
this.pitNumber = number
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setHostTv(hostTv: TextView) {
|
|
||||||
this.hostTv = hostTv
|
|
||||||
}
|
|
||||||
|
|
||||||
public override fun setPitData(bean: RoomPitBean) {
|
public override fun setPitData(bean: RoomPitBean) {
|
||||||
pitBean = bean // 统一使用参数 bean
|
pitBean = bean // 统一使用参数 bean
|
||||||
stopAndClearAnimation() // 清理之前的动画资源
|
stopAndClearAnimation() // 清理之前的动画资源
|
||||||
@@ -103,7 +98,7 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
tv_time?.visibility = View.INVISIBLE
|
tv_time?.visibility = View.INVISIBLE
|
||||||
ll_bottom?.visibility = View.GONE
|
ll_bottom?.visibility = View.INVISIBLE
|
||||||
iv_custom_gift?.visibility = View.GONE
|
iv_custom_gift?.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,10 +116,9 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
fun setSex(value: String?, format: Boolean) {
|
fun setSex(value: String?, format: Boolean) {
|
||||||
mCharmView.setSex("", "", value, format)
|
mCharmView.setSex("", "", value, format)
|
||||||
}
|
}
|
||||||
|
fun setPitGift(giftPlayString: String){
|
||||||
fun setPitGift(giftPlayString: String) {
|
iv_gift?.visibility=VISIBLE
|
||||||
mIvGift?.visibility = VISIBLE
|
iv_gift?.setSource(giftPlayString, 2)
|
||||||
WheatGiftAnim.addGift(mIvGift, giftPlayString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleOnState(bean: RoomPitBean) {
|
private fun handleOnState(bean: RoomPitBean) {
|
||||||
@@ -155,7 +149,7 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
|
|
||||||
private val pitNumberText: String
|
private val pitNumberText: String
|
||||||
get() {
|
get() {
|
||||||
return "虚位以待"
|
return pitNumber+"号麦"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleOffState(bean: RoomPitBean) {
|
private fun handleOffState(bean: RoomPitBean) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_30"
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
android:visibility="gone"
|
||||||
android:src="@mipmap/icon_left_set_time"
|
android:src="@mipmap/icon_left_set_time"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintWidth_percent="0.6" />
|
app:layout_constraintWidth_percent="0.6" />
|
||||||
|
|
||||||
<ImageView
|
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||||
android:id="@+id/iv_gift"
|
android:id="@+id/iv_gift"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user