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" />