女神说定时收齐来

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

View File

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

View File

@ -101,7 +101,8 @@
android:id="@+id/mic_view" android:id="@+id/mic_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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" /> 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:id="@+id/mic_view1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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" /> 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:id="@+id/mic_view2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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" /> app:constraint_referenced_ids="video_chat_bg3,video_chat_circle3,mic_ico2,mic_gift_svga2,userVoice2,userName2,sorNumberTv2" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

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