女神说定时收齐来

This commit is contained in:
ningwenqiang 2024-09-21 11:01:28 +08:00
parent 0dc4f5b99b
commit 7ae32bbe77
4 changed files with 38 additions and 19 deletions

View File

@ -983,8 +983,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
sud_layout_name.post(new Runnable() {
@Override
public void run() {
//TODO 这里报了类型错误
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) sud_layout_name.getLayoutParams();
//TODO 这里报了类型错误 android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
ViewGroup.LayoutParams params1 = sud_layout_name.getLayoutParams();
params1.width = mChatRecyclerView.getWidth() - DpUtil.dp2px(85);
sud_layout_name.setLayoutParams(params1);
}
@ -1675,14 +1675,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void onClick(View view) {
MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮");
hideAnchorSay();
newGodSayGroup.setVisibility(View.VISIBLE);
}
});
goddessSayBgView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mAnchorSay.setVisibility(View.VISIBLE);
newGodSayGroup.setVisibility(View.GONE);
if(!isHinde){
mAnchorSay.setVisibility(View.VISIBLE);
newGodSayGroup.setVisibility(View.GONE);
mLiveRoomHandler.removeMessages(LiveRoomHandler.WHAT_ANCHOR_GOD_SHOW_HIDE);
}
}
});
// mAnchorSay.setOnClickListener(new View.OnClickListener() {
@ -2930,12 +2932,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
new XPopup.Builder(mContext).asCustom(new ReceiveRendPacketPopup(mContext, 0, mLiveUid, mStream, redPacket.getRedPacketId(), redPacket, true, isFans)).show();
}
/**
* 隐藏女神说
*/
private void hideAnchorSay() {
mAnchorSay.setVisibility(View.GONE);
if (mAnchorSay.getVisibility() == View.VISIBLE){
mAnchorSay.setVisibility(View.GONE);
newGodSayGroup.setVisibility(View.VISIBLE);
}
// boolean hide = mAnchorSay.getTag() == null || (boolean) mAnchorSay.getTag();
// Animation animation;
// if (hide) {
@ -5666,6 +5672,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private static final int WHAT_FIRST_LOOK_LIVE = 7;//用户首次进入该直播间计时
private static final int WHAT_LOOK_5_MIN_LIVE = 8;//用户首次进入该直播间计时
private static final int WHAT_TASK_INLET_LIVE = 9;//打开活动页
static final int WHAT_ANCHOR_GOD_SHOW_HIDE = 10; //延迟十秒收起女神说
public LiveRoomHandler(LiveRoomViewHolder liveRoomViewHolder) {
mLiveRoomViewHolder = new WeakReference<>(liveRoomViewHolder).get();
@ -5703,6 +5710,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
case WHAT_TASK_INLET_LIVE:
mLiveRoomViewHolder.showSendGiftTaskMsg();
break;
case WHAT_ANCHOR_GOD_SHOW_HIDE:
mLiveRoomViewHolder.hideAnchorSay();
break;
}
}
}
@ -6296,10 +6306,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
changeView();
break;
case LIVE_PK_ING:
//Pk中收齐女神说
hideAnchorSayAndCallAnchor();
break;
case LIVE_PK_END:
//showAnchorSayAndCallAnchor();
//Pk结束可以展开女神说
showAnchorSayAndCallAnchor();
break;
case LIVE_FONT_SIZE:
int fount = event.getNums();
@ -6984,6 +6996,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mAnchorSay.setVisibility(View.INVISIBLE);
newGodSayGroup.setVisibility(View.GONE);
}
mLiveRoomHandler.sendEmptyMessageDelayed(LiveRoomHandler.WHAT_ANCHOR_GOD_SHOW_HIDE,10000);
} else {
mAnchorSay.setVisibility(View.INVISIBLE);
}
@ -7026,7 +7039,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void hideAnchorSayAndCallAnchor() {
isHinde = true;
mAnchorSay.setVisibility(View.GONE);
if(mAnchorSay.getVisibility() == View.VISIBLE){
mAnchorSay.setVisibility(View.GONE);
newGodSayGroup.setVisibility(View.VISIBLE);
}
if (!TextUtils.isEmpty(wishListProgress.getWishlistName()) || !TextUtils.isEmpty(wishListProgress.getWishlistProgress())) {
//topBanner2.setVisibility(View.VISIBLE);
} else {
@ -7039,7 +7055,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
isHinde = false;
if (mAnchorSay.getVisibility() != View.VISIBLE && sayModel != null && sayModel.getLivePreview() != null && sayModel.getLivePreview().getIsShow() == 1) {
Log.i("女神说", "sayModel: " + sayModel);
mAnchorSay.setVisibility(View.VISIBLE);
//mAnchorSay.setVisibility(View.VISIBLE);
}
if (topBanner1.getVisibility() == View.GONE && mTopBannerList != null && !mTopBannerList.isEmpty()) {
Log.i("女神说", "mTopBannerList: " + mTopBannerList.size());

View File

@ -2544,9 +2544,8 @@
android:layout_width="68dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="190dp"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginTop="180dp"
android:visibility="visible"
android:layout_marginRight="10dp" />
<com.yunbao.common.views.weight.FullServiceNotificationView
@ -3151,7 +3150,7 @@
android:ellipsize="marquee"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="主播創建了【游戲名】房間,快來與主播同玩~"
tools:text="主播創建了【游戲名】房間,快來與主播同玩~"
android:textColor="#999999"
android:textSize="12dp" />

View File

@ -101,7 +101,8 @@
android:id="@+id/mic_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:visibility="gone"
tools:visibility="visible"
app:constraint_referenced_ids="video_chat_bg1,video_chat_circle1,mic_ico,mic_gift_svga,userVoice,userName,sorNumberTv" />
@ -200,7 +201,8 @@
android:id="@+id/mic_view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:visibility="gone"
tools:visibility="visible"
app:constraint_referenced_ids="video_chat_bg2,video_chat_circle2,mic_ico1,mic_gift_svga1,userVoice1,userName1,sorNumberTv1" />
<!--第三条目 -->
@ -298,7 +300,8 @@
android:id="@+id/mic_view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:visibility="gone"
tools:visibility="visible"
app:constraint_referenced_ids="video_chat_bg3,video_chat_circle3,mic_ico2,mic_gift_svga2,userVoice2,userName2,sorNumberTv2" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -23,10 +23,11 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/wish_pic"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="热度加成"
android:layout_marginStart="2dp"
android:layout_marginStart="17dp"
android:ellipsize="marquee"
android:focusable="true"
android:gravity="center"