From 61a966ea41d8778728fd9804e80f74c6fc4fba1d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 22 Mar 2024 11:23:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=86=85=E7=BA=A2=E5=8C=85=E5=92=8C=E7=A5=9E=E9=BE=99=E9=80=81?= =?UTF-8?q?=E8=B4=A2=E7=9A=84=E4=BD=8D=E7=BD=AE=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/dialog/LiveGuardDialog.java | 10 +++--- .../yunbao/live/views/LiveRoomViewHolder.java | 34 +++++++++++++++++++ .../views/MainHomeLiveItemViewHolder.java | 4 +-- .../main/res/layout/item_main_home_lives.xml | 4 +-- 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java index c2bd14628..5a27ddae5 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java @@ -34,12 +34,14 @@ import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.TimeUtils; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; +import com.yunbao.live.activity.ZhuangBanActivity; import com.yunbao.live.adapter.NewGuardAdapter; import com.yunbao.live.bean.GuardUserModel; @@ -290,6 +292,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { ViewClicksAntiShake.clicksAntiShake(myGraudGrade, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + dismiss(); StringBuffer htmlUrl = new StringBuffer(); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); htmlUrl.append(CommonAppConfig.HOST) @@ -302,13 +305,8 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { .append(mLiveUid) .append("&isZh=") .append(((WordUtil.isNewZh()) ? "1" : "0")); + RouteUtil.forwardZhuangBanActivity(htmlUrl.toString()); - Bundle bundle = new Bundle(); - bundle.putString("url", htmlUrl.toString()); - bundle.putInt("height", DeviceUtils.getScreenHeight(getActivity()) / 5 * 3); - LiveHDDialogFragment fragment = new LiveHDDialogFragment(); - fragment.setArguments(bundle); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); } }); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 404a7af30..8a3bc077c 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1675,6 +1675,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } else { redPacket.setVisibility(View.GONE); + if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(110); + dragonImmediateParticipation.setLayoutParams(layoutParams); + } anchorTimeHandler.removeCallbacks(anchorTimeRunnable); LiveNetManager.get(mContext). endRedPacket(mLiveUid, mRedPacketModel.getRedPacketId(), new com.yunbao.common.http.base.HttpCallback() { @@ -1701,6 +1706,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mRedPacketModel = redPacketModel; if (redPacketModel.getIsShow() == 1) { redPacket.setVisibility(View.VISIBLE); + if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(190); + dragonImmediateParticipation.setLayoutParams(layoutParams); + } if (redPacketModel.getCountdown() > 180) { redPacketQueue.setVisibility(View.GONE); redPacketCountdown.setVisibility(View.VISIBLE); @@ -1772,6 +1782,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void hindeRedPacket() { redPacket.setVisibility(View.GONE); + if (dragonImmediateParticipation.getVisibility() == View.VISIBLE) { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(110); + dragonImmediateParticipation.setLayoutParams(layoutParams); + } } public void setRedPacketInfoModel(RedPacketInfoModel redPacket) { @@ -3179,6 +3194,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis participation_time.post(sendMoneyRunnable); } else { dragonImmediateParticipation.setVisibility(View.VISIBLE); + if (redPacket.getVisibility()==View.VISIBLE){ + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(190); + dragonImmediateParticipation.setLayoutParams(layoutParams); + }else { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(110); + dragonImmediateParticipation.setLayoutParams(layoutParams); + } } } @@ -3188,6 +3212,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis dragonImmediateParticipationTime.setVisibility(View.GONE); } else { dragonImmediateParticipation.setVisibility(View.GONE); + } } @@ -3221,6 +3246,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onSendMoneyLong() { dragonImmediateParticipation.setVisibility(View.VISIBLE); + if (redPacket.getVisibility()==View.VISIBLE){ + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(190); + dragonImmediateParticipation.setLayoutParams(layoutParams); + }else { + RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams(); + layoutParams.topMargin = DpUtil.dp2px(110); + dragonImmediateParticipation.setLayoutParams(layoutParams); + } } /** diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index b8d7b257f..7e24e732a 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -155,10 +155,10 @@ public class MainHomeLiveItemViewHolder extends RecyclerView.ViewHolder { } RelativeLayout.LayoutParams dragon_moneyLayoutParams = (RelativeLayout.LayoutParams) dragon_money.getLayoutParams(); if (bean.getRedPacketStatus() == 1) { - dragon_moneyLayoutParams.leftMargin = DpUtil.dp2px(35); + dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(55); redPacket.setVisibility(View.VISIBLE); } else { - dragon_moneyLayoutParams.leftMargin = DpUtil.dp2px(20); + dragon_moneyLayoutParams.topMargin = DpUtil.dp2px(25); redPacket.setVisibility(View.GONE); } diff --git a/main/src/main/res/layout/item_main_home_lives.xml b/main/src/main/res/layout/item_main_home_lives.xml index 0cc6afbfa..0d704d999 100644 --- a/main/src/main/res/layout/item_main_home_lives.xml +++ b/main/src/main/res/layout/item_main_home_lives.xml @@ -292,8 +292,8 @@ android:layout_height="30dp" android:layout_alignParentStart="true" android:layout_alignParentTop="true" - android:layout_marginStart="35dp" - android:layout_marginTop="25dp" + android:layout_marginStart="25dp" + android:layout_marginTop="55dp" android:visibility="gone" app:srcCompat="@mipmap/icon_live_dragon_money" tools:visibility="visible" />