新增牌照房小时榜
This commit is contained in:
@@ -28,6 +28,7 @@ import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvSongListActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.xchat_android_core.helper.AtProxy;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
@@ -266,8 +267,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
break;
|
||||
case RoomEvent.ROOM_PK_INVITE:
|
||||
RoomPkReceivedDialog.newInstance(
|
||||
((RoomPKAttachment) roomEvent.getChatRoomMessage().getAttachment())
|
||||
.getRoomPkBean())
|
||||
((RoomPKAttachment) roomEvent.getChatRoomMessage().getAttachment())
|
||||
.getRoomPkBean())
|
||||
.show(mContext);
|
||||
break;
|
||||
case RoomEvent.ROOM_PK_FINISH:
|
||||
@@ -340,8 +341,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
//这里通过接口获取PK 详情 更新pk 记分板
|
||||
if (PkModel.get().getCurPkInfo() == null) {
|
||||
PkModel.get().loadPKDataByRoomId(
|
||||
AvRoomDataManager.get().getRoomUid()
|
||||
)
|
||||
AvRoomDataManager.get().getRoomUid()
|
||||
)
|
||||
.subscribe(new SingleObserver<RoomPkData>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -447,11 +448,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
changeModelShowView();
|
||||
refreshDatingNextStatus();
|
||||
setDragonView();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void updateMicBtn() {
|
||||
super.updateMicBtn();
|
||||
refreshDatingNextStatus();
|
||||
@@ -583,6 +582,12 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
case R.id.stv_ktv_song:
|
||||
KtvSongListActivity.start(mContext, false);
|
||||
break;
|
||||
case R.id.tv_hour_rank:
|
||||
DialogWebViewActivity.start(
|
||||
mContext,
|
||||
UriProvider.getRoomHourRankUrl(AvRoomDataManager.get().getRoomUid())
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -702,8 +707,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
//加入排队
|
||||
PkModel.get().joinPKMicQueue(
|
||||
teamId
|
||||
)
|
||||
teamId
|
||||
)
|
||||
.subscribe(new SingleObserver<PKRespQueuingMicListInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -771,6 +776,12 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.getIsPermitRoom() == 1) {
|
||||
gameBinding.tvHourRank.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
@@ -896,7 +907,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
private void cancelMyQueue() {
|
||||
if (AvRoomDataManager.get().isQueuingMicro() && AvRoomDataManager.get().myIsInQueue) {
|
||||
MicQueueModel.get().cancelApplyForQueuing(AvRoomDataManager.get().getRoomUid(),
|
||||
AuthModel.get().getCurrentUid())
|
||||
AuthModel.get().getCurrentUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.subscribe(info -> {
|
||||
if (isMicQueueDialogShowing()) {
|
||||
@@ -972,9 +983,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
}
|
||||
//加入排队
|
||||
MicQueueModel.get().applyForQueuing(AvRoomDataManager.get().getRoomUid(),
|
||||
AuthModel.get().getCurrentUid(),
|
||||
groupType
|
||||
)
|
||||
AuthModel.get().getCurrentUid(),
|
||||
groupType
|
||||
)
|
||||
.subscribe(new SingleObserver<RespQueuingMicListInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -1009,8 +1020,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
@Override
|
||||
public void onOk() {
|
||||
MicQueueModel.get().cancelApplyForQueuing(
|
||||
AvRoomDataManager.get().getRoomUid(),
|
||||
AuthModel.get().getCurrentUid())
|
||||
AvRoomDataManager.get().getRoomUid(),
|
||||
AuthModel.get().getCurrentUid())
|
||||
.subscribe(new SingleObserver<RespQueuingMicListInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
@@ -2407,7 +2407,7 @@ public class MessageView extends FrameLayout {
|
||||
if (fromType == AVRoomActivity.FROM_TYPE_RECOMMEND) {
|
||||
enterText = " 根据首页推荐进入了房间";
|
||||
}
|
||||
if (fromType == AVRoomActivity.FROM_TYPE_USER) {
|
||||
if (fromType == AVRoomActivity.FROM_TYPE_USER || fromType == AVRoomActivity.FROM_TYPE_HELLO) {
|
||||
String finalFromUid = fromUid;
|
||||
text.append(" 跟随 ", new ForegroundColorSpan(whiteColor))
|
||||
.append(fromNick, new ForegroundColorSpan(roomTipColor),
|
||||
|
@@ -50,6 +50,8 @@ import com.yizhuan.xchat_android_core.im.custom.bean.LevelUpNoticeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomRankAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomRankMsgBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.SingleRoomRankAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.SingleRoomRankMsgBean;
|
||||
@@ -186,6 +188,9 @@ public class RoomEffectView extends FrameLayout {
|
||||
case RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY:
|
||||
showSingleRoomRankNotify(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
case RoomEvent.ROOM_RANK_TOP_NOTIFY:
|
||||
showRoomRankNotify(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -914,6 +919,23 @@ public class RoomEffectView extends FrameLayout {
|
||||
binding.flSingleRoomRankNotify.postDelayed(() -> binding.flSingleRoomRankNotify.removeView(rootView), SHOW_TIME);
|
||||
}
|
||||
|
||||
private void showRoomRankNotify(ChatRoomMessage chatRoomMessage) {
|
||||
if (binding.clNotify.getVisibility() == View.GONE) {
|
||||
binding.clNotify.setVisibility(View.VISIBLE);
|
||||
}
|
||||
RoomRankMsgBean msgBean = ((RoomRankAttachment) chatRoomMessage.getAttachment()).getMsgBean();
|
||||
View rootView = LayoutInflater.from(mContext).inflate(R.layout.layout_room_rank_notify, null);
|
||||
((TextView) rootView.findViewById(R.id.tv_nick)).setText(StringExtensionKt.subAndReplaceDot(msgBean.getTitle(), 6));
|
||||
((TextView) rootView.findViewById(R.id.tv_desc)).setText(msgBean.getDesc());
|
||||
ImageLoadUtils.loadImage(getContext(), msgBean.getAvatar(), rootView.findViewById(R.id.iv_avatar));
|
||||
rootView.setOnClickListener(v -> AVRoomActivity.start(getContext(), msgBean.getUid()));
|
||||
binding.flSingleRoomRankNotify.addView(rootView);
|
||||
animationLuckyGift = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify);
|
||||
rootView.startAnimation(animationLuckyGift);
|
||||
binding.flSingleRoomRankNotify.postDelayed(() -> binding.flSingleRoomRankNotify.removeView(rootView), SHOW_TIME);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
|
59
app/src/main/res/layout/layout_room_rank_notify.xml
Normal file
59
app/src/main/res/layout/layout_room_rank_notify.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/single_room_bg_rank_notice"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="4dp"
|
||||
tools:layout_height="60dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:text="恭喜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13dp" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:includeFontPadding="false"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="13dp"
|
||||
tools:text="厅的名字七个字" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13dp"
|
||||
tools:text=" 成为上时段 小时榜" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="TOP1"
|
||||
android:textColor="#FFFFFC4C"
|
||||
android:textSize="13dp" />
|
||||
|
||||
</LinearLayout>
|
@@ -24,13 +24,14 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="85dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:clipChildren="false">
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MicroView
|
||||
android:id="@+id/micro_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contribute_list"
|
||||
@@ -77,6 +78,24 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hour_rank"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignTop="@id/contribute_list"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingStart="1dp"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:drawableStart="@drawable/ic_single_room_rank"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:onClick="@{click}"
|
||||
android:text="小时榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dating_step"
|
||||
@@ -344,12 +363,15 @@
|
||||
android:scaleType="center"
|
||||
android:src="@android:drawable/ic_menu_send" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/vs_music_player"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/tv_hour_rank"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout="@layout/avroom_music_player_layout" />
|
||||
|
||||
<com.yizhuan.erban.vip.VipBroadcastView
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<FrameLayout
|
||||
android:id="@+id/music_flag_layout"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/bg_room_music_player"
|
||||
tools:visibility="visible">
|
||||
@@ -16,6 +16,7 @@
|
||||
android:id="@+id/music_flag"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:src="@drawable/icon_music_flag" />
|
||||
|
@@ -457,6 +457,14 @@ public class UriProvider {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/room_rank/hourRank.html?roomUid=" + roomUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 牌照房小时榜
|
||||
*/
|
||||
public static String getRoomHourRankUrl(long roomUid) {
|
||||
return JAVA_WEB_URL.concat("/yinyou/modules/room_rank/index_license.html?roomUid=" + roomUid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 周星榜
|
||||
*/
|
||||
|
@@ -1315,6 +1315,11 @@ public final class IMNetEaseManager {
|
||||
noticeRoomEvent(msg, RoomEvent.SINGLE_ROOM_RANK_TOP_NOTIFY);
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_ROOM_RANK:
|
||||
if (second == CUSTOM_MSG_SUB_ROOM_RANK_TOP) {
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_RANK_TOP_NOTIFY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -580,6 +580,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
case CustomAttachment.CUSTOM_MSG_SINGLE_ROOM_RANK:
|
||||
attachment = new SingleRoomRankAttachment(second);
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_MSG_ROOM_RANK:
|
||||
attachment = new RoomRankAttachment(second);
|
||||
break;
|
||||
default:
|
||||
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
|
||||
break;
|
||||
|
@@ -370,13 +370,18 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int SKILL_MSG_AUDIO = 87;
|
||||
public static final int CP_INVITE_MESSAGE = 88;
|
||||
public static final int CP_INVITE_MESSAGE_TOP_NOTICE = 881;
|
||||
|
||||
public static final int CUSTOM_MSG_SINGLE_ROOM_RANK = 89;
|
||||
public static final int CUSTOM_MSG_SUB_SINGLE_ROOM_RANK_TOP = 891;
|
||||
|
||||
public static final int CUSTOM_MSG_FANS_TEAM = 90;
|
||||
public static final int CUSTOM_MSG_SUB_FANS_TEAM_OPEN = 901; //开通粉丝团
|
||||
public static final int CUSTOM_MSG_SUB_FANS_TEAM_OPEN_FAILED = 902; // 开通粉丝团失败
|
||||
public static final int CUSTOM_MSG_SUB_FANS_TEAM_JOIN = 903; // 加入粉丝团
|
||||
public static final int CUSTOM_MSG_SUB_FANS_TEAM_EXIT = 904; // 退出粉丝团
|
||||
|
||||
public static final int CUSTOM_MSG_ROOM_RANK = 91;
|
||||
public static final int CUSTOM_MSG_SUB_ROOM_RANK_TOP = 911;
|
||||
/**
|
||||
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
||||
*/
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
public class RoomRankAttachment extends CustomAttachment {
|
||||
|
||||
private RoomRankMsgBean msgBean;
|
||||
|
||||
public RoomRankAttachment(int second) {
|
||||
super(CUSTOM_MSG_ROOM_RANK, second);
|
||||
}
|
||||
|
||||
public RoomRankMsgBean getMsgBean() {
|
||||
return msgBean;
|
||||
}
|
||||
|
||||
public void setMsgBean(RoomRankMsgBean msgBean) {
|
||||
this.msgBean = msgBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parseData(JSONObject data) {
|
||||
msgBean = new Gson().fromJson(data.toJSONString(), RoomRankMsgBean.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JSONObject packData() {
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomRankMsgBean {
|
||||
private long uid;
|
||||
private String title;
|
||||
private String avatar;
|
||||
private String desc;
|
||||
}
|
@@ -231,6 +231,8 @@ public class RoomEvent {
|
||||
|
||||
public static final int ROOM_CLEAN_SCREEN = 90;
|
||||
|
||||
public static final int ROOM_RANK_TOP_NOTIFY = 91;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
private int posState = -1;
|
||||
|
Reference in New Issue
Block a user