From 9ab0e4ad8dccf1f75fcf6f94a0869a35bcd4ac70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=80=81=E7=9A=AE?=
<14840170+lao-pi123@user.noreply.gitee.com>
Date: Tue, 8 Oct 2024 09:36:42 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=BD=98=E5=A4=9A=E6=8B=89?=
=?UTF-8?q?=E6=96=B0=E4=BA=BA=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=EF=BC=9A?=
=?UTF-8?q?=201=E3=80=81=E6=8B=B7=E8=B4=9D=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/bean/EnterRoomInfoModel.java | 31 ++
.../common/dialog/AbsDialogFragment.java | 3 +-
.../com/yunbao/live/bean/LiveChatBean.java | 2 +
.../live/dialog/LiveHDDialogFragment.java | 16 +-
.../yunbao/live/views/LiveRoomViewHolder.java | 442 ++++++++++++++++++
.../live/views/PortraitLiveManager.java | 13 +
live/src/main/res/layout/view_live_room.xml | 128 -----
7 files changed, 505 insertions(+), 130 deletions(-)
diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java
index d32508ad6..4ba2c27d1 100644
--- a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java
+++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java
@@ -117,6 +117,37 @@ public class EnterRoomInfoModel extends BaseModel {
@SerializedName("connection_info")
private LivePkMicModel connectionInfo;
+ @SerializedName("is_first_entry")
+ private String isFirstEntry;
+ @SerializedName("is_new_user")
+ private String isNewUser;
+ @SerializedName("is_com_all")
+ private String isComAll;
+
+ public String getIsFirstEntry() {
+ return isFirstEntry;
+ }
+
+ public void setIsFirstEntry(String isFirstEntry) {
+ this.isFirstEntry = isFirstEntry;
+ }
+
+ public String getIsNewUser() {
+ return isNewUser;
+ }
+
+ public void setIsNewUser(String isNewUser) {
+ this.isNewUser = isNewUser;
+ }
+
+ public String getIsComAll() {
+ return isComAll;
+ }
+
+ public void setIsComAll(String isComAll) {
+ this.isComAll = isComAll;
+ }
+
public LivePkMicModel getConnectionInfo() {
return connectionInfo;
}
diff --git a/common/src/main/java/com/yunbao/common/dialog/AbsDialogFragment.java b/common/src/main/java/com/yunbao/common/dialog/AbsDialogFragment.java
index 99243dcfb..80de088c4 100644
--- a/common/src/main/java/com/yunbao/common/dialog/AbsDialogFragment.java
+++ b/common/src/main/java/com/yunbao/common/dialog/AbsDialogFragment.java
@@ -27,6 +27,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
protected Context mContext;
protected View mRootView;
+ protected Dialog dialog;
@NonNull
@Override
@@ -37,7 +38,7 @@ public abstract class AbsDialogFragment extends DialogFragment {
} else {
mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
}
- Dialog dialog = new Dialog(mContext, getDialogStyle());
+ dialog = new Dialog(mContext, getDialogStyle());
dialog.setContentView(mRootView);
dialog.setCancelable(canCancel());
dialog.setCanceledOnTouchOutside(canCancel());
diff --git a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java
index 322fff5fe..7d306d765 100644
--- a/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java
+++ b/live/src/main/java/com/yunbao/live/bean/LiveChatBean.java
@@ -32,6 +32,8 @@ public class LiveChatBean {
public static final int TYPE_TO_USER_MSG = 500;//指定信息
public static final int TYPE_TO_ANCHOR_PRANK = 501;//整蠱-開播提示語
public static final int TYPE_TO_ANCHOR_PRANK_GIFT = 502;//整蠱-禮物
+ public static final int TYPE_TO_TASK_INLET =503;//任务入口
+ public static final int TYPE_TO_TASK_INLET1 =504;//任务入口
private String id;
private String userNiceName;
diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java
index 67d15e132..f14cd77df 100644
--- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java
+++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java
@@ -68,11 +68,25 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
private DialogInterface.OnShowListener listener;
private TextView htmlError;
private boolean isSetHeight = false;
+ OnDisListener onDisListener;
+ public interface OnDisListener{
+ void onDis();
+ }
public LiveHDDialogFragment() {
}
-
+ public void setOnDisListener(OnDisListener onDisListener) {
+ this.onDisListener = onDisListener;
+ if(dialog!=null){
+ dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ onDisListener.onDis();
+ }
+ });
+ }
+ }
/**
* 弹出全屏对话框
*
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 4c47e1eb0..81da45000 100644
--- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
+++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
@@ -2,6 +2,7 @@ package com.yunbao.live.views;
import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY;
+import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
@@ -26,6 +27,7 @@ import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
+import android.view.animation.LinearInterpolator;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import android.widget.FrameLayout;
@@ -432,6 +434,353 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public static SVGAVideoEntity drawableTitleCn;
public static SVGAVideoEntity drawableTitleEn;
public static SVGAVideoEntity drawableBg;
+ private int mDp500 = DpUtil.dp2px(-400);;
+ private boolean isComAll;
+ public void setComAll(boolean isComAll) {
+ this.isComAll = isComAll;
+ }
+
+
+ //提醒用户免费礼物
+ private RelativeLayout new_task_send_gift_notify;
+ private TextView new_task_send_gift_details;
+ private ImageView close_task_send_gift_close;
+
+ //完成了任务
+ private RelativeLayout new_task_gift_notify1;
+ private TextView new_task_gift_details1;
+ private ImageView close_task_receive_close1;
+
+ //完成新人任务,领取专属豪礼
+ private RelativeLayout new_task_gift_notify;
+ private TextView new_task_gift_details;
+ private ImageView close_task_receive_close;
+
+ //首次进入该直播间 关注弹窗
+ private RelativeLayout notify_follow_layout;
+ private ImageView notify_follow_coin;
+ private TextView notify_follow_name;
+ private ImageView follow_first_look;
+ private ImageView close_first_look_follow;
+
+
+ /**
+ * // //提醒用户免费礼物 handleler
+ * */
+ private Handler sendGiftTaskHandler = new Handler();
+ private Runnable sendGiftTaskRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (new_task_send_gift_notify != null) {
+ animatorSendGiftTask(false);
+ sendGiftTaskHandler.removeCallbacks(sendGiftTaskRunnable);
+ }
+ }
+ };
+ private ObjectAnimator animator_send_gift_task;
+ public void showSendGiftTaskDetailsNotify() {
+ new_task_send_gift_notify.post(new Runnable() {
+ @Override
+ public void run() {
+ LinearLayout.LayoutParams params1 = (LinearLayout.LayoutParams) new_task_send_gift_notify.getLayoutParams();
+ params1.width = mChatRecyclerView.getWidth() - DpUtil.dp2px(72);
+ new_task_send_gift_notify.setLayoutParams(params1);
+ }
+ });
+ new_task_send_gift_details.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //跳转到免费礼物
+ ((LiveAudienceActivity) mContext).openGiftWindow();
+ animatorSendGiftTask(false);
+ sendGiftTaskHandler.removeCallbacks(sendGiftTaskRunnable);
+ }
+ });
+ close_task_send_gift_close.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ animatorSendGiftTask(false);
+ sendGiftTaskHandler.removeCallbacks(sendGiftTaskRunnable);
+ }
+ });
+ sendGiftTaskHandler.removeCallbacks(sendGiftTaskRunnable);
+ sendGiftTaskHandler.postDelayed(sendGiftTaskRunnable, 10000);
+ new_task_send_gift_notify.setVisibility(View.VISIBLE);
+ mDp500 = DpUtil.dp2px(-400);
+ animatorSendGiftTask(true);
+ }
+ public void animatorSendGiftTask(boolean isIn) {
+ if (isIn) {
+ animator_send_gift_task = ObjectAnimator.ofFloat(new_task_send_gift_notify, "translationX", mDp500, 0);
+ animator_send_gift_task.setDuration(1000);
+ } else {
+ animator_send_gift_task = ObjectAnimator.ofFloat(new_task_send_gift_notify, "translationX", 0, mDp500);
+ animator_send_gift_task.setDuration(1000);
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ new_task_send_gift_notify.setVisibility(View.GONE);
+ }
+ }, 2000);
+ }
+ animator_send_gift_task.setInterpolator(new LinearInterpolator());
+ animator_send_gift_task.start();
+ }
+
+
+ /**
+ * 完成任务 1
+ * */
+ private Handler firstTaskDetailsHandler1 = new Handler();
+ private Runnable firstTaskDetailsRunnable1 = new Runnable() {
+ @Override
+ public void run() {
+ if (new_task_gift_notify1 != null) {
+ animatorTaskDetails1(false);
+ firstTaskDetailsHandler1.removeCallbacks(firstTaskDetailsRunnable1);
+ }
+ }
+ };
+ private ObjectAnimator animator_first_task_details1;
+ public void showTaskDetailsNotify1(String url) {
+ new_task_gift_notify1.post(new Runnable() {
+ @Override
+ public void run() {
+ LinearLayout.LayoutParams params1 = (LinearLayout.LayoutParams) new_task_gift_notify1.getLayoutParams();
+ params1.width = mChatRecyclerView.getWidth() - DpUtil.dp2px(72);
+ new_task_gift_notify1.setLayoutParams(params1);
+ }
+ });
+ new_task_gift_details1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ showH5Dialog();
+ }
+ });
+
+ close_task_receive_close1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ animatorTaskDetails1(false);
+ firstTaskDetailsHandler1.removeCallbacks(firstTaskDetailsRunnable1);
+ }
+ });
+ firstTaskDetailsHandler1.removeCallbacks(firstTaskDetailsRunnable1);
+ firstTaskDetailsHandler1.postDelayed(firstTaskDetailsRunnable1, 7000);
+ new_task_gift_notify1.setVisibility(View.VISIBLE);
+ mDp500 = DpUtil.dp2px(-400);
+ animatorTaskDetails1(true);
+ }
+ public void animatorTaskDetails1(boolean isIn) {
+ if (isIn) {
+ animator_first_task_details1 = ObjectAnimator.ofFloat(new_task_gift_notify1, "translationX", mDp500, 0);
+ animator_first_task_details1.setDuration(1000);
+ } else {
+ animator_first_task_details1 = ObjectAnimator.ofFloat(new_task_gift_notify1, "translationX", 0, mDp500);
+ animator_first_task_details1.setDuration(1000);
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ new_task_gift_notify1.setVisibility(View.GONE);
+ }
+ }, 2000);
+ }
+ animator_first_task_details1.setInterpolator(new LinearInterpolator());
+ animator_first_task_details1.start();
+ }
+
+
+ /**
+ * 完成任务 2
+ * */
+ private Handler firstTaskDetailsHandler = new Handler();
+ private Runnable firstTaskDetailsRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (new_task_gift_notify != null) {
+ animatorTaskDetails(false);
+ firstTaskDetailsHandler.removeCallbacks(firstTaskDetailsRunnable);
+ }
+ }
+ };
+
+ private ObjectAnimator animator_first_task_details;
+ public void showTaskDetailsNotify() {
+ new_task_gift_notify.post(new Runnable() {
+ @Override
+ public void run() {
+ LinearLayout.LayoutParams params1 = (LinearLayout.LayoutParams) new_task_gift_notify.getLayoutParams();
+ params1.width = mChatRecyclerView.getWidth() - DpUtil.dp2px(72);
+ new_task_gift_notify.setLayoutParams(params1);
+ }
+ });
+ new_task_gift_details.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ showH5Dialog();
+ }
+ });
+ close_task_receive_close.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ animatorTaskDetails(false);
+ firstTaskDetailsHandler.removeCallbacks(firstTaskDetailsRunnable);
+ }
+ });
+ firstTaskDetailsHandler.removeCallbacks(firstTaskDetailsRunnable);
+ firstTaskDetailsHandler.postDelayed(firstTaskDetailsRunnable, 7000);
+ new_task_gift_notify.setVisibility(View.VISIBLE);
+ mDp500 = DpUtil.dp2px(-400);
+ animatorTaskDetails(true);
+ }
+ public void animatorTaskDetails(boolean isIn) {
+ if (isIn) {
+ animator_first_task_details = ObjectAnimator.ofFloat(new_task_gift_notify, "translationX", mDp500, 0);
+ animator_first_task_details.setDuration(1000);
+ } else {
+ animator_first_task_details = ObjectAnimator.ofFloat(new_task_gift_notify, "translationX", 0, mDp500);
+ animator_first_task_details.setDuration(1000);
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ new_task_gift_notify.setVisibility(View.GONE);
+ }
+ }, 2000);
+ }
+ animator_first_task_details.setInterpolator(new LinearInterpolator());
+ animator_first_task_details.start();
+ }
+
+
+ /**
+ * 新人关注主播
+ * */
+ private Handler firstFollowLookHandler = new Handler();
+ private Runnable firstFollowLookRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (notify_follow_layout != null) {
+ animatorFollowFirstLook(false);
+ firstFollowLookHandler.removeCallbacks(firstFollowLookRunnable);
+ if (!nothingCheck || !isComAll) {//没有任何操作
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ showTaskDetailsNotify();
+ }
+ }, 2000);
+ }
+ }
+ }
+ };
+
+ private ObjectAnimator animator_follow_first_look;
+ private boolean nothingCheck = false;
+ public void showFirstLookLiveFollowNotify() {
+ notify_follow_layout.post(new Runnable() {
+ @Override
+ public void run() {
+ LinearLayout.LayoutParams params1 = (LinearLayout.LayoutParams) notify_follow_layout.getLayoutParams();
+ params1.width = mChatRecyclerView.getWidth() - DpUtil.dp2px(72);
+ notify_follow_layout.setLayoutParams(params1);
+ }
+ });
+ ImgLoader.displayAvatar(mContext, mAvatarUrl, notify_follow_coin);
+ notify_follow_name.setText(mAnchorName);
+ close_first_look_follow.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ nothingCheck = true;
+ animatorFollowFirstLook(false);
+ }
+ });
+ follow_first_look.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ nothingCheck = true;
+ follow_first_look.setImageResource(R.mipmap.icon_live_room_followed);
+ //關注
+ follow();
+ if (((LiveAudienceActivity) mContext).getCountDownTimer() != null) {
+ ((LiveAudienceActivity) mContext).getCountDownTimer().cancel();
+ }
+ animatorFollowFirstLook(false);
+ firstFollowLookHandler.removeCallbacks(firstFollowLookRunnable);
+ }
+ });
+ firstFollowLookHandler.removeCallbacks(firstFollowLookRunnable);
+ firstFollowLookHandler.postDelayed(firstFollowLookRunnable, 7000);
+ notify_follow_layout.setVisibility(View.VISIBLE);
+ mDp500 = DpUtil.dp2px(-400);
+ animatorFollowFirstLook(true);
+ }
+
+ public void animatorFollowFirstLook(boolean isIn) {
+ if (isIn) {
+ animator_follow_first_look = ObjectAnimator.ofFloat(notify_follow_layout, "translationX", mDp500, 0);
+ animator_follow_first_look.setDuration(1000);
+ } else {
+ animator_follow_first_look = ObjectAnimator.ofFloat(notify_follow_layout, "translationX", 0, mDp500);
+ animator_follow_first_look.setDuration(1000);
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ notify_follow_layout.setVisibility(View.GONE);
+ }
+ }, 2000);
+ }
+ animator_follow_first_look.setInterpolator(new LinearInterpolator());
+ animator_follow_first_look.start();
+ }
+
+
+ //向chatList发送一条活动入口消息
+ public void showSendGiftTaskMsg() {
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ LiveChatBean bean = new LiveChatBean();
+ bean.setType(LiveChatBean.TYPE_TO_TASK_INLET);
+ mLiveChatAdapter.insertItem(bean);
+ }
+ }, 1000);
+ if (mLiveRoomHandler != null) {
+ mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_TASK_INLET_LIVE, getNextTime(1000 * 300));
+ }
+ }
+ public boolean isShowH5Dialog;
+
+ public void showH5Dialog() {
+ Bundle bundle = new Bundle();
+ bundle.putString("url", CommonAppConfig.HOST + "/h5/activity/pdlNewUes/index.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&app_from=PDL");
+ LiveHDDialogFragment fragment = new LiveHDDialogFragment();
+ fragment.setArguments(bundle);
+ fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
+ fragment.setOnDisListener(new LiveHDDialogFragment.OnDisListener() {
+ @Override
+ public void onDis() {
+ startTaskInletTime();
+ }
+ });
+ }
+ public void startTaskInletTime() {
+ if (!isShowH5Dialog) {
+ firstTaskInletNotify();
+ }
+ isShowH5Dialog = true;
+ }
+
+ /**
+ * 打開活動彈窗 关闭5min后
+ */
+ public void firstTaskInletNotify() {
+ if (mLiveRoomHandler != null) {
+ //取消观看200秒后的定时器-产品需求,只需要存在一个逻辑
+ mLiveRoomHandler.removeMessages(LiveRoomHandler.WHAT_TASK_INLET_LIVE);
+ mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_TASK_INLET_LIVE, getNextTime(1000 * 5));
+ }
+ }
+
public LiveRoomViewHolder setGuardType(int guardType) {
this.guardType = guardType;
@@ -1818,6 +2167,48 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
recycler_prank.setLayoutManager(new LinearLayoutManager(mContext));
initPrankAdapter();
+
+ notify_follow_layout = (RelativeLayout) findViewById(R.id.notify_follow_layout);
+ notify_follow_layout.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ L.e("其他區域");
+ }
+ });
+ notify_follow_coin = (ImageView) findViewById(R.id.notify_follow_coin);
+ notify_follow_name = (TextView) findViewById(R.id.notify_follow_name);
+ follow_first_look = (ImageView) findViewById(R.id.follow_first_look);
+ close_first_look_follow = (ImageView) findViewById(R.id.close_first_look_follow);
+
+ new_task_gift_notify = (RelativeLayout) findViewById(R.id.new_task_gift_notify);
+ new_task_gift_notify.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ L.e("其他區域");
+ }
+ });
+ new_task_gift_details = (TextView) findViewById(R.id.new_task_gift_details);
+ close_task_receive_close = (ImageView) findViewById(R.id.close_task_receive_close);
+
+ new_task_gift_notify1 = (RelativeLayout) findViewById(R.id.new_task_gift_notify1);
+ new_task_gift_notify1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ L.e("其他區域");
+ }
+ });
+ new_task_gift_details1 = (TextView) findViewById(R.id.new_task_gift_details1);
+ close_task_receive_close1 = (ImageView) findViewById(R.id.close_task_receive_close1);
+
+ new_task_send_gift_notify = (RelativeLayout) findViewById(R.id.new_task_send_gift_notify);
+ new_task_send_gift_notify.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ L.e("其他區域");
+ }
+ });
+ new_task_send_gift_details = (TextView) findViewById(R.id.new_task_send_gift_details);
+ close_task_send_gift_close = (ImageView) findViewById(R.id.close_task_send_gift_close);
}
/**
@@ -2355,6 +2746,35 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
showAnchorSayAndCallAnchor();
}
+
+ /**
+ * 首次进入直播间
+ */
+ public void firstLookLiveNotify() {
+ if (mLiveRoomHandler != null) {
+ mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_FIRST_LOOK_LIVE, getNextTime(50000));
+ }
+ }
+
+ /**
+ * 首次进入直播间
+ */
+ public void firstLook5MinLiveNotify() {
+ if (mLiveRoomHandler != null) {
+ mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_LOOK_5_MIN_LIVE, getNextTime(1000 * 60 * 5));
+ }
+ }
+
+ /**
+ * 观看200秒之后
+ */
+ public void firstTaskInlet1Notify() {
+ if (mLiveRoomHandler != null) {
+ mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_TASK_INLET_LIVE, getNextTime(1000 * 200));
+ }
+ }
+
+
/**
* 重置数据
*/
@@ -2365,6 +2785,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
anchorTimeHandler.removeCallbacks(anchorTimeRunnable);
pa_pao_layout.setVisibility(View.GONE);
combo_layout.setVisibility(View.GONE);
+ mLiveRoomHandler.removeMessages(LiveRoomHandler.WHAT_ANCHOR_GOD_SHOW_HIDE);
resetViewGone();
visibility = false;
pkUidTmp = "";
@@ -4831,6 +5252,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private static final int WHAT_ANCHOR_PAUSE = 4;//主播切后台
private static final int WHAT_ANCHOR_LIGHT = 5;//主播飘心
private static final int WHAT_ANCHOR_CHECK_LIVE = 6;//主播checkLive
+ private static final int WHAT_FIRST_LOOK_LIVE = 7;//用户首次进入该直播间计时
+ private static final int WHAT_LOOK_5_MIN_LIVE = 8;//用户首次进入该直播间计时
+ private static final int WHAT_TASK_INLET_LIVE = 9;//打开活动页
+ static final int WHAT_ANCHOR_GOD_SHOW_HIDE = 10; //延迟十秒收起女神说
public LiveRoomHandler(LiveRoomViewHolder liveRoomViewHolder) {
mLiveRoomViewHolder = new WeakReference<>(liveRoomViewHolder).get();
@@ -4855,6 +5280,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
case WHAT_ANCHOR_CHECK_LIVE:
mLiveRoomViewHolder.anchorCheckLive();
break;
+
+ case WHAT_FIRST_LOOK_LIVE:
+ if (isAttention == 0) {
+ mLiveRoomViewHolder.showFirstLookLiveFollowNotify();
+ } else {
+ mLiveRoomViewHolder.showTaskDetailsNotify();
+ }
+ break;
+ case WHAT_LOOK_5_MIN_LIVE:
+ mLiveRoomViewHolder.showSendGiftTaskDetailsNotify();
+ break;
+ case WHAT_TASK_INLET_LIVE:
+ mLiveRoomViewHolder.showSendGiftTaskMsg();
+ break;
+ case WHAT_ANCHOR_GOD_SHOW_HIDE:
+ mLiveRoomViewHolder.hideAnchorSay();
+ break;
}
}
}
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 ce19b0fab..b1a998c5e 100644
--- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java
+++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java
@@ -884,6 +884,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//初始化整蠱列表
mLiveRoomViewHolder.initPrankProgress(isShowPrank?1:2);
+ if("1".equals(data.getEnterRoomInfo().getIsNewUser())){
+ //检测是否是首次观看该直播间
+ if("1".equals(data.getEnterRoomInfo().getIsFirstEntry())){
+ mLiveRoomViewHolder.firstLookLiveNotify();
+ }
+ //判断是否有免费礼物
+ if("0".equals(data.getNewPeopleTask().getTask().getSendgift())){
+ mLiveRoomViewHolder.firstLook5MinLiveNotify();
+ }
+ //观看200秒之后,推送活动入口im消息
+ mLiveRoomViewHolder.firstTaskInlet1Notify();
+ }
+
}
@Override
diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml
index 07525ed51..60d317137 100644
--- a/live/src/main/res/layout/view_live_room.xml
+++ b/live/src/main/res/layout/view_live_room.xml
@@ -2996,134 +2996,6 @@
android:src="@mipmap/icon_live_notify_close1" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-