From 50b598d8a15b64ccab4800780e61a9917886a3e8 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 3 Nov 2022 17:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=BB=E6=92=AD=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E8=A7=82=E4=BC=97=E5=88=97=E8=A1=A8=E4=B8=8E?= =?UTF-8?q?=E5=AE=88=E6=8A=A4=E5=88=97=E8=A1=A8=E7=9A=84=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/activity/LiveActivity.java | 7 +++++-- .../yunbao/live/activity/LiveAudienceActivity.java | 2 +- .../live/dialog/LiveNewGuardBuyDialogFragment.java | 11 +++++++++-- .../live/dialog/LiveNewGuardListDialogFragment.java | 8 ++++++++ .../live/dialog/LiveUserMoreDialogFragment.java | 10 ++++++++-- .../com/yunbao/live/views/LiveRoomViewHolder.java | 10 +++++----- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 8548fca6f..80ca224cc 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -1200,7 +1200,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL /** * 守护列表弹窗 */ - public void openNewGuardListWindow() { + public void openNewGuardListWindow(boolean showBuyView) { LiveHttpUtil.getGuardList(mLiveUid, 1, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -1214,6 +1214,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL Bundle bundle = new Bundle(); bundle.putString(Constants.LIVE_UID, mLiveUid); bundle.putBoolean(Constants.ANCHOR, mIsAnchor); + bundle.putBoolean("showBuyView",!showBuyView); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment"); } @@ -1245,7 +1246,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL /** * 打开观看列表弹窗 */ - public void openUserMoreListWindow(int i, boolean isOnly, boolean noble) { + public void openUserMoreListWindow(int i, boolean isOnly, boolean noble,boolean showBuyView) { if (outRankHideFirst) { //获取隐身的用户的ID @@ -1263,6 +1264,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL bundle.putBoolean("only", isOnly); bundle.putBoolean("noble", noble); bundle.putString("outRankHide", GsonUtils.toJson(outRankHide)); + bundle.putBoolean("showBuyView",!showBuyView); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment"); LiveUserMoreDialogFragment.activity = (LiveActivity) mContext; @@ -1283,6 +1285,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL bundle.putString("By", i + ""); bundle.putBoolean("only", isOnly); bundle.putBoolean("noble", noble); + bundle.putBoolean("showBuyView",!showBuyView); bundle.putString("outRankHide", GsonUtils.toJson(outRankHide)); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveUserMoreDialogFragment"); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 4d25e3062..1420ef4c8 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -758,7 +758,7 @@ public class LiveAudienceActivity extends LiveActivity { liveFansFragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment"); break; case GUARD: - openNewGuardListWindow(); + openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); break; case LIVE_WKS://周星榜 String weeklyStarUrl = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java index 1fd66d732..273f208cf 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java @@ -34,6 +34,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; +import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.adapter.GuardRightAdapter; import com.yunbao.live.adapter.LiveNewGuardBuyItemsAdapter; import com.yunbao.live.bean.GuardBuyBean; @@ -81,8 +82,9 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements private LiveNewGuardBuyItemsAdapter buyItemsAdapter; private GuardRightAdapter mGuardRightAdapter; - private boolean isEmpty; + private boolean isEmpty,showBuyView; private ImageView mBack; + private RelativeLayout relativeLayout; @Override @@ -135,6 +137,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements buy2 = mRootView.findViewById(R.id.buy2); guard_tips = mRootView.findViewById(R.id.guard_textView2); mBack = mRootView.findViewById(R.id.guard_back); + relativeLayout = mRootView.findViewById(R.id.guard_relativeLayout); //iconCover.setImageResource(R.drawable.guardian_img_wings); @@ -166,6 +169,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements mAncherName = bundle.getString(Constants.LIVE_ANCHER_NAME); mAncherIcon = bundle.getString(Constants.LIVE_ANCHER_ICON); mUserIcon = bundle.getString(Constants.USER_ICON); + showBuyView = bundle.getBoolean("showBuyView",true); String coinName = WordUtil.getString(R.string.diamond); mCoinName = coinName; isEmpty=bundle.getBoolean("guard",true); @@ -248,6 +252,9 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements anchorName.setText(title); guard_tips.setText("守護日期截止到:"+ mLiveGuardInfo.getMyGuardEndTime()); } + if(!showBuyView){ + relativeLayout.setVisibility(View.GONE); + } } @@ -285,7 +292,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements } private void gotoBack(){ dismiss(); - ((LiveActivity)mContext).openNewGuardListWindow(); + ((LiveActivity)mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } /** diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java index aef5b1af2..cd2c35fae 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java @@ -7,6 +7,7 @@ import android.view.Window; import android.view.WindowManager; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -53,7 +54,9 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements private LiveGuardInfo mLiveGuardInfo; private String mLiveUid; private boolean mIsAnchor;//是否是主播 + private boolean showBuyView; private List list=new ArrayList<>(); + private RelativeLayout relativeLayout; @Override protected int getLayoutId() { @@ -93,6 +96,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements } mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false); mLiveUid = bundle.getString(Constants.LIVE_UID); + showBuyView = bundle.getBoolean("showBuyView",true); guardIcon = mRootView.findViewById(R.id.guard_imageView); mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout); mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy); @@ -105,6 +109,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements userLayout = mRootView.findViewById(R.id.guard_linearLayout); tip1 = mRootView.findViewById(R.id.guard_tip1); tip2 = mRootView.findViewById(R.id.guard_tip2); + relativeLayout = mRootView.findViewById(R.id.guard_relativeLayout); mBtnBuy.setOnClickListener(this); mBtnBuy.setEnabled(true); mBtnBuy.setText(R.string.guard_buy_2); @@ -163,6 +168,9 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements }); mRefreshView.setRecyclerViewAdapter(mGuardAdapter); mGuardAdapter.notifyDataSetChanged(); + if(!showBuyView){ + relativeLayout.setVisibility(View.GONE); + } } @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserMoreDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserMoreDialogFragment.java index 7184b09f6..18dcfbab7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserMoreDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserMoreDialogFragment.java @@ -35,6 +35,7 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.DpUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; +import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.adapter.UserMoreInfoAdapter; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveUserGiftBean; @@ -68,7 +69,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie private RelativeLayout bottom_msg;//底部信息的布局,在榜单列表下不需要显示底部信息 private String Tips = "1"; private String type = "guanzhong"; - private boolean isOnly, noble; + private boolean isOnly, noble,showBuyView; ImageView no_more; private List outRankHide = new ArrayList<>(); @@ -114,6 +115,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie stream = bundle.getString(Constants.STREAM); isOnly = bundle.getBoolean("only", false); noble = bundle.getBoolean("noble", false); + showBuyView = bundle.getBoolean("showBuyView",true); String outRankHideString = bundle.getString("outRankHide"); outRankHide = GsonUtils.fromJson(outRankHideString, new TypeToken>() { }.getType()); @@ -142,7 +144,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie ((LiveActivity) mContext).openLuckGiftTip(); } else if (Tips.equals("2")) { dismiss(); - ((LiveActivity) mContext).openNewGuardListWindow(); + ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } else if (Tips.equals("3")) { dismiss(); ((LiveActivity) mContext).openFansWindow(); @@ -417,6 +419,10 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie setTextColor(weekRank, audience_btn, guard_btn, fans_btn, gz_view, dayRank); noMoreText.setVisibility(View.VISIBLE); } + if(!showBuyView){ + bottom_msg.setVisibility(View.GONE); + params.bottomMargin = DpUtil.dp2px(0); + } mRefreshView.setLayoutParams(params); } 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 1b8fb54f7..28b94428a 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1964,19 +1964,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //直播间 粉丝排行榜 openMedalRankWindow(); } else if (i == R.id.btn_guard) { - ((LiveActivity) mContext).openNewGuardListWindow(); + ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.btn_red_pack) { ((LiveActivity) mContext).openRedPackListWindow(); } else if (i == R.id.btn_prize_pool_level) { ((LiveActivity) mContext).openPrizePoolWindow(); } else if (i == R.id.user_more) { - ((LiveActivity) mContext).openUserMoreListWindow(1, false, false); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, false,mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.hot_btn) { - ((LiveActivity) mContext).openUserMoreListWindow(1, false, false); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, false,mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.noble_seat) { - ((LiveActivity) mContext).openUserMoreListWindow(1, false, true); + ((LiveActivity) mContext).openUserMoreListWindow(1, false, true,mContext instanceof LiveRyAnchorActivity); } else if (i == R.id.btn_close) { close(); //小屏 @@ -1986,7 +1986,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis ((LiveActivity) mContext).openHotListWindow(1); } else if (i == R.id.user_guard) { // ((LiveActivity) mContext).openUserMoreListWindow(2, true); - ((LiveActivity) mContext).openNewGuardListWindow(); + ((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } if (i == R.id.lt_trickery) { showTrickeryDialog();