Merge remote-tracking branch 'origin/dev_680_礼物展馆' into dev_680_礼物展馆
This commit is contained in:
commit
ba8090eec7
@ -58,23 +58,27 @@ public class GiftWallAchieveAdapter extends RecyclerView.Adapter {
|
|||||||
private TextView achieveName;
|
private TextView achieveName;
|
||||||
private ImageView achieveImg;
|
private ImageView achieveImg;
|
||||||
|
|
||||||
|
private ImageView achieveImgLock;
|
||||||
|
|
||||||
public GiftWallAchieveViewHolder(@NonNull View itemView) {
|
public GiftWallAchieveViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
itemView.setOnClickListener(new View.OnClickListener() {
|
itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if(onItemClickListener!=null){
|
if (onItemClickListener != null) {
|
||||||
onItemClickListener.onItemClick(getAdapterPosition());
|
onItemClickListener.onItemClick(getAdapterPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
achieveName = itemView.findViewById(R.id.achieveName);
|
achieveName = itemView.findViewById(R.id.achieveName);
|
||||||
achieveImg = itemView.findViewById(R.id.achieve_img);
|
achieveImg = itemView.findViewById(R.id.achieve_img);
|
||||||
|
achieveImgLock = itemView.findViewById(R.id.achieve_img_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showData(UserMedalListModel quantityModel) {
|
public void showData(UserMedalListModel quantityModel) {
|
||||||
achieveName.setText(quantityModel.getDressName());
|
achieveName.setText(quantityModel.getDressName());
|
||||||
ImgLoader.display(mContext,quantityModel.getDisplaySrc(),achieveImg);
|
ImgLoader.display(mContext, quantityModel.getDisplaySrc(), achieveImg);
|
||||||
|
achieveImgLock.setVisibility(quantityModel.getDressStatus().equals("1") ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import com.stx.xhb.androidx.transformers.Transformer;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
import com.yunbao.common.bean.HttpCallbackModel;
|
||||||
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.bean.UserMedalModel;
|
import com.yunbao.common.bean.UserMedalModel;
|
||||||
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
import com.yunbao.common.custom.LiveGuardScalePageTransformer;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@ -105,6 +106,9 @@ public class GiftWallAchieveWearDialog extends AbsDialogPopupWindow {
|
|||||||
public void onSuccess(HttpCallbackModel data) {
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
ToastUtil.show(data.getMsg());
|
ToastUtil.show(data.getMsg());
|
||||||
if (data.getCode() == 0) {
|
if (data.getCode() == 0) {
|
||||||
|
UserBean u = CommonAppConfig.getInstance().getUserBean();
|
||||||
|
u.setMedal_no_display_src(achieveWearModels.get(selectPosition).getDisplaySrc());
|
||||||
|
CommonAppConfig.getInstance().setUserBean(u);
|
||||||
if(userUseDressSuccess!=null){
|
if(userUseDressSuccess!=null){
|
||||||
userUseDressSuccess.onSuccess();
|
userUseDressSuccess.onSuccess();
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center"
|
android:layout_height="120dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_height="110dp">
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/achieve_img"
|
android:id="@+id/achieve_img"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="90dp"/>
|
android:layout_height="90dp"
|
||||||
|
android:layout_centerHorizontal="true" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/achieve_img_lock"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:src="@mipmap/achieve_img_lock" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/achieveName"
|
android:id="@+id/achieveName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="26dp"
|
android:layout_height="26dp"
|
||||||
|
android:layout_below="@+id/achieve_img"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
BIN
common/src/main/res/mipmap-mdpi/achieve_img_lock.png
Normal file
BIN
common/src/main/res/mipmap-mdpi/achieve_img_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
@ -28,6 +28,7 @@ import com.yunbao.common.Constants;
|
|||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.manager.RandomPkManager;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
@ -44,6 +45,7 @@ import com.yunbao.live.momo.GenerateTestUserSig;
|
|||||||
import com.yunbao.live.socket.SocketClient;
|
import com.yunbao.live.socket.SocketClient;
|
||||||
import com.yunbao.live.socket.SocketLinkMicPkUtil;
|
import com.yunbao.live.socket.SocketLinkMicPkUtil;
|
||||||
import com.yunbao.live.socket.SocketSendBean;
|
import com.yunbao.live.socket.SocketSendBean;
|
||||||
|
import com.yunbao.live.socket.SocketSwClient;
|
||||||
import com.yunbao.live.views.LiveLinkMicPkViewHolder;
|
import com.yunbao.live.views.LiveLinkMicPkViewHolder;
|
||||||
import com.yunbao.live.views.LivePushTxViewHolder;
|
import com.yunbao.live.views.LivePushTxViewHolder;
|
||||||
|
|
||||||
@ -53,10 +55,16 @@ import java.util.List;
|
|||||||
|
|
||||||
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
||||||
import static com.tencent.trtc.TRTCCloudDef.TRTC_APP_SCENE_LIVE;
|
import static com.tencent.trtc.TRTCCloudDef.TRTC_APP_SCENE_LIVE;
|
||||||
|
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
|
||||||
import static com.yunbao.live.activity.LiveAnchorActivity.isDRPK;
|
import static com.yunbao.live.activity.LiveAnchorActivity.isDRPK;
|
||||||
import static com.yunbao.live.views.AbsLivePushViewHolder.mPreView;
|
import static com.yunbao.live.views.AbsLivePushViewHolder.mPreView;
|
||||||
import static com.yunbao.live.views.LivePushTxViewHolder.dr_pk_view;
|
import static com.yunbao.live.views.LivePushTxViewHolder.dr_pk_view;
|
||||||
|
|
||||||
|
import io.rong.imlib.IRongCallback;
|
||||||
|
import io.rong.imlib.RongIMClient;
|
||||||
|
import io.rong.imlib.model.Conversation;
|
||||||
|
import io.rong.message.TextMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/11/16.
|
* Created by cxf on 2018/11/16.
|
||||||
* 主播与主播PK逻辑
|
* 主播与主播PK逻辑
|
||||||
@ -389,20 +397,39 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//接受PK回调
|
//接受PK回调
|
||||||
private void pkAccept() {
|
private void pkAccept(String uid) {
|
||||||
/*mTRTCCloud1 = LivePushTxViewHolder.mTRTCCloud.createSubCloud();
|
if(RandomPkManager.getInstance().getStatus()==RandomPkManager.PK_STATUS_START){
|
||||||
mTRTCParams1 = new TRTCCloudDef.TRTCParams();
|
final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LINK_MIC_PK).param("action", 8);
|
||||||
mTRTCParams1.sdkAppId = GenerateTestUserSig.SDKAPPID;
|
msg1.create();
|
||||||
mTRTCParams1.userId = CommonAppConfig.getInstance().getUid() + "pk";
|
|
||||||
mTRTCParams1.roomId = Integer.parseInt(mApplyUid);
|
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||||
mTRTCParams1.userSig = GenerateTestUserSig.genTestUserSig(mTRTCParams1.userId);
|
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||||
mTRTCParams1.role = TRTCCloudDef.TRTCRoleAudience;
|
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(uid, conversationType, messageContent);
|
||||||
mTRTCCloud1.enterRoom(mTRTCParams1, TRTC_APP_SCENE_LIVE);
|
|
||||||
mTRTCCloud1.startRemoteView(mApplyUid, LivePushTxViewHolder.mPreView1);
|
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
mTRTCCloud1.setListener(new TRTCCloudImplListener(mContext));*/
|
@Override
|
||||||
LivePushTxViewHolder.btn_close.setVisibility(View.VISIBLE);
|
public void onAttached(io.rong.imlib.model.Message message) {
|
||||||
SocketLinkMicPkUtil.linkMicPkAccept(mSocketClient, mApplyUid, mApplyUrl, mApplyNmae);
|
|
||||||
onLinkMicPkStart(mApplyUid, mApplyUrl, mApplyNmae);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||||
|
Log.e("ry", "发送成功");
|
||||||
|
if (SocketSwClient.mSocketHandler != null) {
|
||||||
|
SocketSwClient.mSocketHandler.processBroadcast(msg1.mResult.toString() + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
Log.e("ry", "发送失敗" + mApplyUid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
LivePushTxViewHolder.btn_close.setVisibility(View.VISIBLE);
|
||||||
|
SocketLinkMicPkUtil.linkMicPkAccept(mSocketClient, mApplyUid, mApplyUrl, mApplyNmae);
|
||||||
|
onLinkMicPkStart(mApplyUid, mApplyUrl, mApplyNmae);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -423,7 +450,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
showApplyDialog(u);
|
showApplyDialog(u);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pkAccept();
|
pkAccept(u.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,7 +717,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
// public void onSuccess(int code, String msg, String[] info) {
|
// public void onSuccess(int code, String msg, String[] info) {
|
||||||
// if (code == 0) {
|
// if (code == 0) {
|
||||||
|
|
||||||
pkAccept();
|
pkAccept(u.getId());
|
||||||
} else {
|
} else {
|
||||||
if (mPkWaitCount < 0) {
|
if (mPkWaitCount < 0) {
|
||||||
SocketLinkMicPkUtil.linkMicPkNotResponse(mSocketClient, mApplyUid);
|
SocketLinkMicPkUtil.linkMicPkNotResponse(mSocketClient, mApplyUid);
|
||||||
|
@ -1349,18 +1349,42 @@ public class SocketSwClient {
|
|||||||
break;
|
break;
|
||||||
case 2://收到对方主播PK回调
|
case 2://收到对方主播PK回调
|
||||||
L.eSw("收到对方主播PK回调");
|
L.eSw("收到对方主播PK回调");
|
||||||
/*if("1".equals(map.getString("random_pk"))){
|
if(RandomPkManager.getInstance().getStatus()==RandomPkManager.PK_STATUS_START){
|
||||||
|
final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LINK_MIC_PK).param("action", 8);
|
||||||
|
msg1.create();
|
||||||
|
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||||
|
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||||
|
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(map.getString("uid"), conversationType, messageContent);
|
||||||
|
|
||||||
}*/
|
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_START);
|
@Override
|
||||||
mListener.onLinkMicToPk(map.getString("uid"), map.getString("uhead"), map.getString("uhead"));
|
public void onAttached(io.rong.imlib.model.Message message) {
|
||||||
mListener.onLinkMicPkStart(map.getString("uid"), map.getString("uhead"), map.getString("uname"), map.getString("is_ladders"));// mListener.onLinkMicPkStart(map.getString("uid"));
|
|
||||||
if (livePushSwViewHolder != null) {
|
}
|
||||||
UserBean userBean = new UserBean();
|
|
||||||
userBean.setId(map.getString("uid"));
|
@Override
|
||||||
userBean.setAvatar(map.getString("uhead"));
|
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||||
userBean.setUserNiceName(map.getString("uname"));
|
Log.e("ry", "发送成功");
|
||||||
livePushSwViewHolder.setAnPkRtc(userBean);
|
if (SocketSwClient.mSocketHandler != null) {
|
||||||
|
SocketSwClient.mSocketHandler.processBroadcast(msg1.mResult.toString() + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_START);
|
||||||
|
mListener.onLinkMicToPk(map.getString("uid"), map.getString("uhead"), map.getString("uhead"));
|
||||||
|
mListener.onLinkMicPkStart(map.getString("uid"), map.getString("uhead"), map.getString("uname"), map.getString("is_ladders"));// mListener.onLinkMicPkStart(map.getString("uid"));
|
||||||
|
if (livePushSwViewHolder != null) {
|
||||||
|
UserBean userBean = new UserBean();
|
||||||
|
userBean.setId(map.getString("uid"));
|
||||||
|
userBean.setAvatar(map.getString("uhead"));
|
||||||
|
userBean.setUserNiceName(map.getString("uname"));
|
||||||
|
livePushSwViewHolder.setAnPkRtc(userBean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3://对方主播拒绝PK的回调
|
case 3://对方主播拒绝PK的回调
|
||||||
|
Loading…
Reference in New Issue
Block a user