diff --git a/Share/src/main/res/layout/item_invite_reward.xml b/Share/src/main/res/layout/item_invite_reward.xml index 33cbd0d57..55e80f88f 100644 --- a/Share/src/main/res/layout/item_invite_reward.xml +++ b/Share/src/main/res/layout/item_invite_reward.xml @@ -4,43 +4,66 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + app:layout_constraintTop_toTopOf="parent" /> + + + + + + \ No newline at end of file diff --git a/common/src/main/java/com/yunbao/common/bean/BannerBean.java b/common/src/main/java/com/yunbao/common/bean/BannerBean.java index 7eab80175..45e58e583 100644 --- a/common/src/main/java/com/yunbao/common/bean/BannerBean.java +++ b/common/src/main/java/com/yunbao/common/bean/BannerBean.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import androidx.annotation.NonNull; + import com.alibaba.fastjson.annotation.JSONField; import com.google.gson.annotations.SerializedName; @@ -187,6 +189,7 @@ public class BannerBean { this.mIconRes = mIconRes; } + @NonNull @Override public String toString() { return "BannerBean{" + @@ -197,6 +200,12 @@ public class BannerBean { ", mIntoUrl='" + mIntoUrl + '\'' + ", type=" + type + ", name='" + name + '\'' + + ", activityId=" + activityId + + ", mIconRes=" + mIconRes + + ", wishlistIcon='" + wishlistIcon + '\'' + + ", wishlistNum='" + wishlistNum + '\'' + + ", wishlistProgress='" + wishlistProgress + '\'' + + ", wishlistName='" + wishlistName + '\'' + ", model=" + model + '}'; } diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 5f1b43eaa..3bcb03d2e 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -301,7 +301,9 @@ public class LiveAudienceEvent extends BaseModel { LUCKY_100_CHECK(55, "幸运百分百"), LIVE_END(56, "主播下播"), LIVE_HIDE_MSG_RED(57,"隐藏红点"), - LIVE_SHARE(58,"直播間分享"); + LIVE_SHARE(58,"直播間分享"), + LIVE_PK_ING(59,"PK中"), + LIVE_PK_END(60,"PK结束"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java index 9bd798386..449bb0a38 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveLinkMicPkPresenter.java @@ -1008,6 +1008,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener { } mLiveLinkMicPkViewHolder.startAnim(); mLiveLinkMicPkViewHolder.showTime(); + mPkTimeCount = 100; nextPkTimeCountDown(); if (mIsAnchor) { ((LiveAnchorActivity) mContext).setPkBtnVisible(false); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index 78c0b0f8e..04ff5fc05 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -1689,7 +1689,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { @Override public void onError(String error) { - ToastUtil.show( R.string.net_error); + ToastUtil.show(R.string.net_error); } }); @@ -2247,6 +2247,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { mLiveLinkMicPkViewHolder.startAnim(); EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid)); mLiveLinkMicPkViewHolder.showTime(); + mPkTimeCount = 100; nextPkTimeCountDown(2); if (mIsAnchor) { ((LiveRyAnchorActivity) mContext).setPkBtnVisible(false); diff --git a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java index 0a83e1c49..5bc6407d8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveLinkMicPkViewHolder.java @@ -9,6 +9,8 @@ import android.graphics.Path; import android.graphics.PathMeasure; import android.graphics.RectF; import android.graphics.drawable.AnimationDrawable; +import android.text.Editable; +import android.text.TextWatcher; import android.util.Log; import android.view.View; import android.view.ViewGroup; @@ -20,6 +22,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.yunbao.common.CommonAppConfig; +import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.WordUtil; @@ -143,6 +146,27 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { img_pk_show_r = (ImageView) findViewById(R.id.img_pk_show_r); img_pk_show_l.setVisibility(View.GONE); img_pk_show_r.setVisibility(View.GONE); + + mTime.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + Log.i("女神说", "倒计时状态:"+s); + if (mTime.getVisibility() == View.VISIBLE) { + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); + } + } + + @Override + public void afterTextChanged(Editable s) { + + } + }); } public void startAnim() { @@ -190,10 +214,10 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder { public void setTime(String content) { if (mTime != null) { - Log.i("vvvs",content); - if(content.trim().equals("00:00")){ + Log.i("vvvs", content); + if (content.trim().equals("00:00")) { mTime.setText("結算中"); - }else { + } else { mTime.setText(content); } } 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 d76e5c309..cdb485d22 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1316,6 +1316,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mBannerList2.clear(); mBannerList3.clear(); mBannerList4.clear(); + mTopBannerList.clear(); + sayModel = null; updataCleanMic(); // initStarChallengeStatus(); enterRoomLeave.setVisibility(View.GONE); @@ -4040,6 +4042,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis case PK_TWO_END: EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", "")); closePkTwo(); + showAnchorSayAndCallAnchor(); break; case CUSTOM_FULL_SERVICE_NOTIFY: customFullServiceNotify(event.getCustomFullServiceNotifyEvent()); @@ -4054,6 +4057,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis case CHANGE_VIEW: changeView(); break; + case LIVE_PK_ING: + hideAnchorSayAndCallAnchor(); + break; + case LIVE_PK_END: + showAnchorSayAndCallAnchor(); + break; } } @@ -4457,21 +4466,25 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void hideAnchorSayAndCallAnchor() { - mAnchorSay.setX((float) mAnchorSayImage.getTag()); - mAnchorSayImage.setTag(null); - mAnchorSayImage.setVisibility(View.VISIBLE); - mAnchorSayText.setVisibility(View.VISIBLE); - mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show); + mAnchorSay.setVisibility(View.GONE); topBanner1.setVisibility(View.GONE); } public void showAnchorSayAndCallAnchor() { - mAnchorSayImage.setTag(mAnchorSay.getX()); - mAnchorSay.setX(-DpUtil.dp2px(45)); - mAnchorSayImage.setVisibility(View.INVISIBLE); - mAnchorSayText.setVisibility(View.INVISIBLE); - mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide); - topBanner1.setVisibility(View.VISIBLE); + if (mAnchorSay.getVisibility() == View.GONE && + sayModel != null && sayModel.getLivePreview() != null && + sayModel.getLivePreview().getIsShow() == 1 + ) { + Log.i("女神说", "sayModel: " + sayModel); + mAnchorSay.setVisibility(View.VISIBLE); + } + if (topBanner1.getVisibility() == View.GONE && mTopBannerList != null && !mTopBannerList.isEmpty()) { + Log.i("女神说", "mTopBannerList: " + mTopBannerList.size()); + for (BannerBean bean : mTopBannerList) { + Log.i("女神说", "BannerBean: " + bean); + } + topBanner1.setVisibility(View.VISIBLE); + } } public void updateTopBanner(WishModel wishListProgress) { diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index e19be54db..6136964b3 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -1032,7 +1032,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe new Handler().postDelayed(new Runnable() { @Override public void run() { - mLiveRoomViewHolder.hideHighGrade(); + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.hideHighGrade(); + } enterRoomLeaveHandler.post(enterRoomLeaveRunnable); } }, 3000); @@ -1376,11 +1378,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void setPkStatus(boolean isPk) { if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.hotAddVisibility(isPk); - if (isPk) { - mLiveRoomViewHolder.hideAnchorSayAndCallAnchor(); - } else { - mLiveRoomViewHolder.showAnchorSayAndCallAnchor(); - } } }