Merge branch 'master' into dev_blind_box

# Conflicts:
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
This commit is contained in:
18401019693 2023-05-27 18:25:14 +08:00
commit c3b5f17f44
17 changed files with 115 additions and 13 deletions

View File

@ -182,6 +182,7 @@ public class Constants {
public static final String LIVE_VOTE_CREATE="createVote";
public static final String LIVE_VOTE_UPDATE="updateVote";
public static final String LIVE_VOTE_END="endVote";
public static final String LIVE_PK_END="endPK";//结束PK以这个PK获取到的参数为准
//游戏socket
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花

View File

@ -1177,4 +1177,5 @@ Limited ride And limited avatar frame</string>
<string name="live_vote_hide_text">VOTE</string>
<string name="live_room_vote_over_tip">%s <br/> box disappears after %s seconds</string>
<string name="live_anchor_vote_tip">Please complete the form.</string>
<string name="live_vote_create_error">Create Vote Error</string>
</resources>

View File

@ -1172,4 +1172,5 @@
<string name="complete_information_hint2">愛你,愛你</string>
<string name="you_guide_me">指導下我好嗎</string>
<string name="complete_information">完整填寫領大禮</string>
<string name="live_vote_create_error">投票創建失敗</string>
</resources>

View File

@ -1171,4 +1171,5 @@
<string name="complete_information_hint2">愛你,愛你</string>
<string name="you_guide_me">指導下我好嗎</string>
<string name="complete_information">完整填寫領大禮</string>
<string name="live_vote_create_error">投票創建失敗</string>
</resources>

View File

@ -1177,4 +1177,5 @@
<string name="mini_blind_box">迷你盲盒</string>
<string name="collection_blind_box">典藏盲盒</string>
<string name="pd_blind_box">PD盲盒</string>
<string name="live_vote_create_error">投票創建失敗</string>
</resources>

View File

@ -1192,4 +1192,5 @@ Limited ride And limited avatar frame</string>
<string name="participate_in">參與</string>
<string name="extract_to">%s在%s中抽取到了</string>
<string name="extract_to2">%S送给了%s</string>
<string name="live_vote_create_error">Create Vote Error</string>
</resources>

View File

@ -1,5 +1,7 @@
package com.yunbao.live.activity;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
@ -390,6 +392,17 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
}
@Override
public void onEndPk(long leftUid, long rightUid, long left, long right, LivePKUserListBean bean) {
if (mLiveRyLinkMicPkPresenter != null) {
if (mLiveUid.equals(leftUid + "")) {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right, bean);
} else {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left, bean);
}
}
}
/**
* 收到弹幕消息
*/

View File

@ -64,7 +64,13 @@ public class LiveNewRoomClassDialogFragment extends AbsDialogFragment implements
if (configBean != null) {
List<LiveClassBean> list1 = configBean.getLiveClass();
for (int i = 0; i < list1.size(); i++) {
if (!list1.get(i).getName().equals("New") && !list1.get(i).getName().equals("Hot") && !list1.get(i).getName().equals("熱門") && !list1.get(i).getName().equals("新秀")) {
if (!list1.get(i).getName().equals("New") &&
!list1.get(i).getName().equals("新秀") &&
!list1.get(i).getName().equals("熱門") &&
!list1.get(i).getName().equals("Hot") &&
!list1.get(i).getName().equals("男神") &&
!list1.get(i).getName().equals("Mr.Right")
) {
list.add(list1.get(i));
}
}

View File

@ -206,6 +206,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
Log.d("RYM_DG", "Other onLeaveRoom: room = " + room.getRoomId());
}
};
public LiveRyLinkMicPkPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, View root) {
mContext = context;
mIsAnchor = isAnchor;
@ -2184,6 +2185,18 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
nextPkTimeCountDown(2);
}
/**
* 修改最终PK数据
* @param leftGift 左边数据
* @param rightGift 右边数据
* @param bean 排位数据
*/
public void onPkProgressEnd(long leftGift, long rightGift,LivePKUserListBean bean) {
if (mLiveLinkMicPkViewHolder != null) {
mLiveLinkMicPkViewHolder.onProgressChanged(leftGift, rightGift, bean, true);
}
}
/**
* 进房间的时候懲罰开始

View File

@ -291,6 +291,16 @@ public interface SocketMessageListener {
*/
void onPrizePoolUp(String level);
/**
* 最终PK数据
* @param leftUid 左边uid
* @param rightUid 右边uid
* @param left 左边分数
* @param right 右边分数
* @param bean 排位顺序
*/
void onEndPk(long leftUid,long rightUid,long left,long right,LivePKUserListBean bean);
/***********************以下是游戏*********************************/
/**
* 游戏 智勇三张 游戏的回调

View File

@ -7,8 +7,10 @@ import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
@ -40,6 +42,7 @@ import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
@ -66,6 +69,8 @@ import org.greenrobot.eventbus.EventBus;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.base.RTCErrorCode;
@ -670,6 +675,14 @@ public class SocketRyClient {
.setObject(map)
);
break;
case Constants.LIVE_PK_END:
mListener.onEndPk(map.getLong("uid"),
map.getLong("pkuid"),
map.getLong("uid_score"),
map.getLong("pkuid_score"),
JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class)
);
break;
}
}

View File

@ -64,9 +64,8 @@ public class LiveAnchorVoteManager {
@Override
public void onError(String error) {
ToastUtil.show(error);
LiveRoomVoteModel voteModel = new LiveRoomVoteModel();
voteModel.setContent(error);
voteModel.setContent(CommonAppContext.getTopActivity().getString(com.yunbao.common.R.string.live_vote_create_error));
listener.onItemClick(voteModel, -1);
}
});

View File

@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.RectF;
@ -198,6 +199,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
animationDrawable.start();
}
mLeft.setTag(null);
}
public void showTime() {
@ -233,6 +235,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
}
if (mLeft != null) {
mLeft.setTranslationX(0);
mLeft.setTag(null);
mLeft2.setTranslationX(0);
}
if (mRight != null) {
@ -241,7 +244,27 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
}
}
/**
* 修改PK进度条进度
* @param leftGift 左边进度
* @param rightGift 右边进度
* @param bean 排位信息
*/
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean) {
onProgressChanged(leftGift, rightGift, bean, false);
}
/**
* 修改PK进度条进度
* @param leftGift 左边进度
* @param rightGift 右边进度
* @param bean 排位信息
* @param isEnd 是否为最终数据是的话就不再接收后续修改数据默认false
*/
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean, boolean isEnd) {
if (mLeft.getTag() != null && ((boolean) mLeft.getTag())) {
return;
}
mLeft.setText(mLeftString + " " + leftGift);
mRight.setText(rightGift + " " + mRightString);
if (leftGift == rightGift) {
@ -262,9 +285,11 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
animationDrawable.start();
}
mLeft.setTag(isEnd);
if (bean != null) {
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean));
}
}
private void changeLine(float nowIndex, long leftGift, long rightGift) {
mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2;

View File

@ -5,6 +5,7 @@ import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@ -1098,7 +1099,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
mChatRecyclerView.getLayoutParams();
params1.topMargin = 180;
params1.topMargin = DpUtil.dp2px(65);
mChatRecyclerView.setLayoutParams(params1);
mChatRecyclerView.setHasFixedSize(true);

View File

@ -1,6 +1,7 @@
package com.yunbao.live.views;
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
import android.app.Activity;
import android.app.Dialog;
@ -9,6 +10,7 @@ import android.content.res.Configuration;
import android.graphics.drawable.AnimationDrawable;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@ -97,6 +99,8 @@ import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
@ -1204,6 +1208,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
@Override
public void onEndPk(long leftUid, long rightUid, long left, long right,LivePKUserListBean bean) {
if (mLiveRyLinkMicPkPresenter != null) {
if (mLiveUid.equals(leftUid + "")) {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right,bean);
} else {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left,bean);
}
}
}
@Override
public void onSendDanMu(LiveDanMuBean bean) {
if (mLiveRoomViewHolder != null) {

View File

@ -399,7 +399,6 @@
android:id="@+id/live_duration_anchor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"

View File

@ -16,6 +16,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="0dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:scaleType="centerCrop"