diff --git a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java index 16f974b1d..5047d7c1b 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveGiftBean.java @@ -48,6 +48,112 @@ public class LiveGiftBean { @JSONField(name = "operate_url") private String operateUrl; + @JSONField(name = "naming_liveuid") + private String namingLiveuid; + @JSONField(name = "naming_uid") + private String namingUid; + @JSONField(name = "naming_live_name") + private String namingLiveName; + @JSONField(name = "naming_user_name") + private String namingUserName; + @JSONField(name = "naming_live_avatar") + private String namingLiveAvatar; + @JSONField(name = "naming_user_avatar") + private String namingUserAvatar; + @JSONField(name = "naming_status") + private String namingStatus; + @JSONField(name = "naming_coin") + private String namingCoin; + + public View getmView() { + return mView; + } + + public LiveGiftBean setmView(View mView) { + this.mView = mView; + return this; + } + + public String getmGiftNum() { + return mGiftNum; + } + + public LiveGiftBean setmGiftNum(String mGiftNum) { + this.mGiftNum = mGiftNum; + return this; + } + + public String getNamingLiveuid() { + return namingLiveuid; + } + + public LiveGiftBean setNamingLiveuid(String namingLiveuid) { + this.namingLiveuid = namingLiveuid; + return this; + } + + public String getNamingUid() { + return namingUid; + } + + public LiveGiftBean setNamingUid(String namingUid) { + this.namingUid = namingUid; + return this; + } + + public String getNamingLiveName() { + return namingLiveName; + } + + public LiveGiftBean setNamingLiveName(String namingLiveName) { + this.namingLiveName = namingLiveName; + return this; + } + + public String getNamingUserName() { + return namingUserName; + } + + public LiveGiftBean setNamingUserName(String namingUserName) { + this.namingUserName = namingUserName; + return this; + } + + public String getNamingLiveAvatar() { + return namingLiveAvatar; + } + + public LiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) { + this.namingLiveAvatar = namingLiveAvatar; + return this; + } + + public String getNamingUserAvatar() { + return namingUserAvatar; + } + + public LiveGiftBean setNamingUserAvatar(String namingUserAvatar) { + this.namingUserAvatar = namingUserAvatar; + return this; + } + + public String getNamingStatus() { + return namingStatus; + } + + public LiveGiftBean setNamingStatus(String namingStatus) { + this.namingStatus = namingStatus; + return this; + } + + public String getNamingCoin() { + return namingCoin; + } + + public LiveGiftBean setNamingCoin(String namingCoin) { + this.namingCoin = namingCoin; + return this; + } public String getOperateImage() { return operateImage; diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 99d965be4..41f967ed3 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -542,9 +542,15 @@ public class JavascriptInterfaceUtils { Bus.get().post(new JavascriptInterfaceEvent() .setMethod("closeLiveRoom")); } + @JavascriptInterface public void clickLogOffAccount() { Bus.get().post(new JavascriptInterfaceEvent() .setMethod("clickLogOffAccount")); } + + @JavascriptInterface + public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl) { + RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0); + } } diff --git a/common/src/main/res/layout/dialog_live_gift_popup.xml b/common/src/main/res/layout/dialog_live_gift_popup.xml index 81361b32b..e51c57a5d 100644 --- a/common/src/main/res/layout/dialog_live_gift_popup.xml +++ b/common/src/main/res/layout/dialog_live_gift_popup.xml @@ -6,23 +6,87 @@ android:layout_gravity="bottom" android:orientation="vertical"> - - + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1"> - - layout="@layout/view_blind_box" /> + + + + + + + + + + + + + + + + + + + android:src="@mipmap/icon_arrow_right_2" /> 去點亮 我的荣誉墙 成就詳情 + 冠名主播: + 冠名金主: diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 06d7054d1..3e99a8762 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -49,6 +49,7 @@ import com.yunbao.common.bean.LiveGiftBean2; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.event.GiftNumberEvent; +import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.event.SendBlindGiftEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; @@ -74,7 +75,6 @@ import com.yunbao.live.bean.GiftTopBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.event.GiftTitleEvent; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.live.event.LiveGiftItemEvent; import com.yunbao.live.event.LiveParcelItemRefreshEvent; import com.yunbao.live.http.LiveHttpUtil; @@ -94,14 +94,14 @@ import java.util.List; * 直播间新送礼弹窗 */ public class LiveGiftPopup extends AbsDialogFragment { - private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage; + private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage, namingAvatar; private JSONArray liveGiftList; private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber; private RecyclerView giftTitle; private GiftTitleAdapter giftTitleAdapter; private FrameLayout contextLayoutGift; private String mStream, mLiveUid; - private FrameLayout blindBox, frameBlindTop, noNobility, giftNumberLayout, giftSendLayout; + private FrameLayout blindBox, frameBlindTop, noNobility, giftNumberLayout, giftSendLayout, namingLayout; private ProgressBar progressBlind, progressBlind1, progressBlind2; private SVGAImageView blindSvga, blindBoxOpen; private View iconMasking; @@ -116,7 +116,7 @@ public class LiveGiftPopup extends AbsDialogFragment { private String by; private boolean isWrap; private ProgressBar progressBar; - private MarqueeTextView giftDescription; + private MarqueeTextView giftDescription, namingName; private boolean isPk; @@ -144,6 +144,7 @@ public class LiveGiftPopup extends AbsDialogFragment { giftTitle = mRootView.findViewById(R.id.gift_title); liveWrap = mRootView.findViewById(R.id.live_wrap); giftDescription = mRootView.findViewById(R.id.gift_description); + namingName = mRootView.findViewById(R.id.naming_name); blindBox = mRootView.findViewById(R.id.blind_box); frameBlindTop = mRootView.findViewById(R.id.frame_blind_top); progressBlind = mRootView.findViewById(R.id.progress_blind1); @@ -166,13 +167,16 @@ public class LiveGiftPopup extends AbsDialogFragment { mLianText = mRootView.findViewById(R.id.lian_text); mBtnSendGroup = mRootView.findViewById(R.id.btn_send_lian); giftSendLayout = mRootView.findViewById(R.id.gift_send_layout); + namingLayout = mRootView.findViewById(R.id.naming_layout); description = mRootView.findViewById(R.id.description); lvStr = mRootView.findViewById(R.id.lv_str); iconArrow = mRootView.findViewById(R.id.icon_arrow); operateImage = mRootView.findViewById(R.id.operate_image); + namingAvatar = mRootView.findViewById(R.id.naming_avatar); leaveHint = mRootView.findViewById(R.id.leave_hint); progressBar = mRootView.findViewById(R.id.progressBar); levelingLayout = mRootView.findViewById(R.id.leveling_layout); + namingLayout.setVisibility(View.GONE); //设置礼物弹窗背景 ImgLoader.displayBlurLive(getContext(), R.drawable.backgroud_custom_gift2, gitBackground); gitBackground.setAlpha(0.97f); @@ -653,8 +657,22 @@ public class LiveGiftPopup extends AbsDialogFragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onLiveGiftItemEvent(LiveGiftItemEvent event) { - liveGiftModel = event.getLiveGiftModel(); + + if (!TextUtils.equals(liveGiftModel.getNamingLiveuid(), "0") && !TextUtils.equals(liveGiftModel.getNamingUid(), "0")) { + namingLayout.setVisibility(View.VISIBLE); + ImgLoader.display(mContext, liveGiftModel.getNamingLiveAvatar(), namingAvatar); + StringBuffer namingNameText = new StringBuffer(); + namingNameText.append(mContext.getText(com.yunbao.live.R.string.title_anchor)) + .append(liveGiftModel.getNamingLiveName()) + .append(mContext.getText(com.yunbao.live.R.string.the_title_financier)) + .append(liveGiftModel.getNamingUserName()); + namingName.setText(namingNameText.toString()); + } else { + namingLayout.setVisibility(View.GONE); + + } + if (liveGiftModel.getType() == 7) { showBlindProgress(liveGiftModel.getBlind_box_type()); } else { @@ -853,6 +871,7 @@ public class LiveGiftPopup extends AbsDialogFragment { textBlindGiftName.setText(stringBuilder); boxBlindHandler.postDelayed(boxBlindRunnable, 1500); stringBuilders.remove(0); + } else { textBlindGiftName.setText(String.format(mContext.getString(R.string.random_availability), blindGiftNamesBuffer.toString())); } diff --git a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java index d89aa8c62..86ce8a3ed 100644 --- a/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/FrameGiftViewHolder.java @@ -2,6 +2,7 @@ package com.yunbao.live.views; import android.content.Context; import android.graphics.Color; +import android.text.TextUtils; import android.util.TypedValue; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; @@ -20,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.lxj.xpopup.XPopup; import com.yunbao.common.bean.LiveGiftBean; +import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.utils.Bus; @@ -28,7 +30,6 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.dialog.SendRendPacketPopup; -import com.yunbao.common.event.LiveGiftDialogEvent; import java.io.File; @@ -76,7 +77,12 @@ public class FrameGiftViewHolder extends RecyclerView.ViewHolder { } ImgLoader.display(mContext, model.getIcon(), giftIcon); ImgLoader.display(mContext, model.getCornerMark(), cornerMark); - giftName.setText(model.getName()); + if (!TextUtils.equals(model.getNamingLiveuid(), "0") && !TextUtils.equals(model.getNamingUid(), "0")) { + giftName.setText(model.getNamingUserName()); + } else { + giftName.setText(model.getName()); + } + //特殊礼物红包 if (model.getType() == 9999999) { mPayIco.setVisibility(View.GONE); 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 39db6a2b5..5dfa58d56 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -2669,7 +2669,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bundle.putBoolean("isLive", mContext instanceof LiveRyAnchorActivity); giftWallDialog.setArguments(bundle); giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog"); -// RouteUtil.forwardGiftWallActivity(mStream,mAnchorName,mLiveUid,mAvatarUrl,isAttention); + } public boolean pkHandler = true;