RoomOperationDialog的点击处理逻辑放到了RoomOperationDialog
This commit is contained in:
@@ -33,20 +33,6 @@ public abstract class BottomViewListenerWrapper {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转成ktv模式
|
||||
*/
|
||||
public void onTransformKTVClick() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转成游戏模式
|
||||
*/
|
||||
public void onTransformGameClick() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击排麦按钮
|
||||
*/
|
||||
|
@@ -159,9 +159,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
public static final int FROM_TYPE_GAME_RECOMMEND = 8;//赛事详情进房
|
||||
public static final int FROM_TYPE_ROOM_PK = 9;//跨房PK进房
|
||||
private static final String TAG = "AVRoomActivity";
|
||||
private static final String GAME_INFO = "gameInfo";
|
||||
private static final String GAME_URL = "gameUrl";
|
||||
private static final String AI_UID = "aiUid";
|
||||
private static final String SHOW_PARTY_ROOM_FIRST_ENTER_TIP = "show_party_room_first_enter_tip";
|
||||
private static final int SHOW_RED_DIALOG_MAX = 10;
|
||||
public static boolean isPKModel = false;
|
||||
@@ -202,7 +199,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
private Dialog giftDialog;
|
||||
private LinkedList<AllServiceGiftProtocol.DataBean> giftList;
|
||||
private boolean isResume = true;
|
||||
private int gvTipsIndex = 0;
|
||||
|
||||
public static void start(Context context, long roomUid) {
|
||||
Intent intent = new Intent(context, AVRoomActivity.class);
|
||||
@@ -264,19 +260,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_INTO_ROOM_CLICK, "进入房间");
|
||||
}
|
||||
|
||||
/**
|
||||
* 师徒任务中特殊的分享跳转
|
||||
*/
|
||||
public static void startForMentoring(Context context, long roomUid) {
|
||||
Intent intent = new Intent(context, AVRoomActivity.class);
|
||||
intent.putExtra(Constants.ROOM_UID, roomUid);
|
||||
// 缓存起来,后面在 HomePartyRoomFragment 里拿出来判断使用
|
||||
AvRoomDataManager.get().setFromMentoring(true);
|
||||
AvRoomDataManager.get().setMasterUid(roomUid);
|
||||
AvRoomDataManager.get().setIsParty(false);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void setBackBg(Context context, RoomInfo roomInfo, SVGAImageView svgaRoomBg, String[] bgPicture, View shade) {
|
||||
if (roomInfo != null) {
|
||||
@@ -596,11 +579,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
toBack(true);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_RED_PACKAGE:
|
||||
try {//防止NPE
|
||||
showRedPackage(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -751,19 +730,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
}
|
||||
}
|
||||
|
||||
private void showPartyRoomTip() {
|
||||
boolean isFirst = (boolean) SharedPreferenceUtils.get(SHOW_PARTY_ROOM_FIRST_ENTER_TIP, true);
|
||||
if (isFirst) {
|
||||
LinearLayout layout = (LinearLayout) mVsPartyRoomTip.inflate();
|
||||
layout.setOnClickListener(view -> {
|
||||
mVsPartyRoomTip.setVisibility(View.GONE);
|
||||
SharedPreferenceUtils.put(SHOW_PARTY_ROOM_FIRST_ENTER_TIP, false);
|
||||
});
|
||||
mVsPartyRoomTip.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mVsPartyRoomTip.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void setUserInfo(UserInfo userInfo) {
|
||||
if (avatarBg == null || avatar == null || nick == null) return;
|
||||
@@ -1275,45 +1241,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
isResume = false;
|
||||
}
|
||||
|
||||
public void handleGiftValueStartTips() {
|
||||
String key_first_open_gift_value_tips = "first_open_gift_value_tips";
|
||||
Boolean firstOpen = (Boolean) SharedPreferenceUtils.get(key_first_open_gift_value_tips, true);
|
||||
if (firstOpen != null && !firstOpen) {
|
||||
//不是首次打开,不提示
|
||||
return;
|
||||
}
|
||||
gvTipsIndex = 0;
|
||||
SharedPreferenceUtils.put(key_first_open_gift_value_tips, false);
|
||||
final int[] topRes = new int[]{R.drawable.icon_gv_start_top_1, R.drawable.icon_gv_start_top_2};
|
||||
//因为0和1是一张图,
|
||||
final int[] bottomRes = new int[]{R.drawable.icon_gv_start_bottom_0, R.drawable.icon_gv_start_bottom_2};
|
||||
ViewStub vs_gift_value_tips = findViewById(R.id.vs_gift_value_tips);
|
||||
View parent = vs_gift_value_tips.inflate();
|
||||
parent.setVisibility(VISIBLE);
|
||||
View iv_gv_status_bar = parent.findViewById(R.id.iv_gv_status_bar);
|
||||
final ImageView iv_gv_top = parent.findViewById(R.id.iv_gv_top);
|
||||
iv_gv_status_bar.getLayoutParams().height = TitleBar.getStatusBarHeight();
|
||||
final TextView tv_skip_guide = parent.findViewById(R.id.tv_skip_guide);
|
||||
tv_skip_guide.setOnClickListener(v -> parent.setVisibility(View.GONE));
|
||||
tv_skip_guide.setVisibility(VISIBLE);
|
||||
ImageView iv_gv_bottom = parent.findViewById(R.id.iv_gv_bottom);
|
||||
parent.setOnClickListener(v -> {
|
||||
if (gvTipsIndex < topRes.length) {
|
||||
iv_gv_top.setImageResource(topRes[gvTipsIndex]);
|
||||
if (gvTipsIndex == topRes.length - 1) {
|
||||
tv_skip_guide.setVisibility(View.GONE);
|
||||
} else {
|
||||
tv_skip_guide.setVisibility(VISIBLE);
|
||||
}
|
||||
} else {
|
||||
parent.setVisibility(View.GONE);
|
||||
}
|
||||
if (gvTipsIndex < bottomRes.length) {
|
||||
iv_gv_bottom.setImageResource(bottomRes[gvTipsIndex]);
|
||||
}
|
||||
gvTipsIndex++;
|
||||
});
|
||||
}
|
||||
|
||||
private void handlePmExitRoom() {
|
||||
EventBus.getDefault().post(new PmDismissAllLimitDialogEvent());
|
||||
|
@@ -4,36 +4,53 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.tongdaxing.erban.sadmin.RoomSAdminManagerActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.avroom.activity.CreatePKActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomSettingActivity;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.ui.widget.marqueeview.Utils;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.ColorDecoration;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.layoutmanager.FullyGridLayoutManager;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomInviteFansActivity;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.giftvalue.GiftValueModel;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.room.model.HomePartyModel;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.super_admin.model.SuperAdminModel;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
|
||||
/**
|
||||
@@ -88,8 +105,6 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
addRoomPKAction(optAdapter);
|
||||
addDatingAction(optAdapter);
|
||||
addRedPacketAction(optAdapter);
|
||||
addKTVAction(optAdapter);
|
||||
//addGameAction(optAdapter);
|
||||
addRoomLimit(optAdapter);
|
||||
addGiftEffectAction(optAdapter);
|
||||
addOpenOrClosePublicScreenAction(optAdapter);
|
||||
@@ -97,8 +112,6 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
addRoomSettingAction(optAdapter);
|
||||
addRedPackageSwitch();
|
||||
addInviteFansOptAdapter();
|
||||
//addRoomModuleHallAction(optAdapter);
|
||||
//addRoomManagerAction(optAdapter);
|
||||
addSuperAdminAction(optAdapter);
|
||||
rvOPtList.setAdapter(optAdapter);
|
||||
}
|
||||
@@ -124,9 +137,15 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
R.drawable.ic_room_opt_op_pk :
|
||||
R.drawable.ic_room_opt_in_pk;
|
||||
optAdapter.addData(new OptAction(icon, str, () -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onPKAction();
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲中不可以开启PK模式!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("跨房PK中不可以开启PK模式!");
|
||||
return;
|
||||
}
|
||||
CreatePKActivity.start(getContext());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -152,9 +171,19 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
R.drawable.ic_room_opt_another_pk_in :
|
||||
R.drawable.ic_room_opt_another_pk_open;
|
||||
optAdapter.addData(new OptAction(icon, str, () -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomPKAction();
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲中不可以开启跨房PK!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast("PK中不可以开启跨房PK!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("正在跨房PK中...");
|
||||
return;
|
||||
}
|
||||
RoomPKCreateActivity.start(getContext());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -182,9 +211,31 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
R.drawable.ic_room_opt_op_dating :
|
||||
R.drawable.ic_room_opt_in_dating;
|
||||
optAdapter.addData(new OptAction(icon, str, () -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onDatingAction();
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast("PK中不可以开启相亲模式!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("跨房PK中不可以开启相亲模式!");
|
||||
return;
|
||||
}
|
||||
new DialogManager(context).showOkCancelWithTitleDialog(
|
||||
AvRoomDataManager.get().isDatingMode() ? "关闭相亲模式?" : "开启相亲模式?开启同时现有礼物值将被清空",
|
||||
AvRoomDataManager.get().isDatingMode() ? "关闭" : "开启",
|
||||
() -> {
|
||||
HomePartyModel homePartyModel = new HomePartyModel();
|
||||
if (!AvRoomDataManager.get().isDatingMode()) {
|
||||
homePartyModel.datingOpen(roomInfo.getUid())
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.doOnError(e -> SingleToastUtil.showToast(e.getMessage()))
|
||||
.subscribe();
|
||||
} else {
|
||||
homePartyModel.datingClose(roomInfo.getUid())
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.doOnError(e -> SingleToastUtil.showToast(e.getMessage()))
|
||||
.subscribe();
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -210,47 +261,6 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加KTV 操作
|
||||
*
|
||||
* @param optAdapter
|
||||
*/
|
||||
private void addKTVAction(OptAdapter optAdapter) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
return;
|
||||
}
|
||||
//添加
|
||||
if (AvRoomDataManager.get().hasKTVPriv()) {
|
||||
if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
optAdapter.addData(new OptAction(R.drawable.ic_room_opt_ktv_select_song,
|
||||
getContext().getResources().getString(R.string.KTV_ing),
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomKTV();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
} else {
|
||||
//如果不是ktv房间,只有管理有ktv按钮
|
||||
if (AvRoomDataManager.get().isManager()) {
|
||||
optAdapter.addData(new OptAction(R.drawable.ic_room_opt_ktv,
|
||||
getContext().getResources().getString(R.string.KTV),
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomKTV();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加房间限制
|
||||
*
|
||||
@@ -261,14 +271,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
if (AvRoomDataManager.get().isRoomOwner() && AvRoomDataManager.get().isCpRoom()) {
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_limit,
|
||||
"进房限制",
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomLimit();
|
||||
}
|
||||
}
|
||||
}));
|
||||
() -> new RoomImposeDialog(context).show()));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -289,13 +292,11 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
R.drawable.icon_open_my_effect;
|
||||
optAdapter.addData(new OptAction(icon,
|
||||
text,
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onSwitchGiftEffect();
|
||||
}
|
||||
}
|
||||
() -> {
|
||||
AvRoomDataManager.get().haveSelfChange = true;
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = !AvRoomDataManager.get().mIsNeedGiftEffect;
|
||||
SingleToastUtil.showToast(AvRoomDataManager.get().mIsNeedGiftEffect ? "礼物特效已开启" : "礼物特效已关闭");
|
||||
EventBus.getDefault().post(new HasAnimationEffect());
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -324,16 +325,22 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
int icon = isCloseScreen ?
|
||||
R.drawable.icon_open_public_screen :
|
||||
R.drawable.icon_close_public_screen;
|
||||
|
||||
optAdapter.addData(new OptAction(icon,
|
||||
text,
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onSwitchPublicScreen();
|
||||
}
|
||||
() -> {
|
||||
SuperAdminModel superAdminModel = new SuperAdminModel();
|
||||
if (isCloseScreen) {
|
||||
superAdminModel.roomOperate(SuperAdminModel.OPEN_PUBLIC_SCREEN).subscribe();
|
||||
} else {
|
||||
superAdminModel.roomOperate(SuperAdminModel.CLOSE_PUBLIC_SCREEN).subscribe();
|
||||
}
|
||||
AvRoomModel.get().closeScreen(roomInfo.getRoomId(),
|
||||
!isCloseScreen)
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.flatMap(data -> IMNetEaseManager.get().closeOpenScreen(
|
||||
data.getRoomId(), data))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe();
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -354,9 +361,13 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
R.drawable.ic_room_close_redpackage;
|
||||
optAdapter.addData(new OptAction(icon, text,
|
||||
() -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onSwitchRedPackage();
|
||||
}
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
RedPackageModel.INSTANCE.setRedPackageSwitch(AvRoomDataManager.get().getRoomUid()).subscribe(setIsNeedOpenRedPackage -> {
|
||||
roomInfo.setServerRedEnvelopeSwitch(setIsNeedOpenRedPackage);
|
||||
IMNetEaseManager.get().closeOpenRedPackage(roomInfo.getRoomId(), roomInfo);
|
||||
SingleToastUtil.showToast(setIsNeedOpenRedPackage ? "全服红包通知已开启" : "全服红包通知已关闭");
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -370,9 +381,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
optAdapter.addData(new OptAction(R.drawable.ic_room_invite_fans,
|
||||
"邀请粉丝",
|
||||
() -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onInviteFans();
|
||||
}
|
||||
RoomInviteFansActivity.start(context);
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -398,12 +407,52 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
getContext().getResources().getString(
|
||||
openGiftValue ? R.string.close_gift_value_text : R.string.open_gift_value_text),
|
||||
() -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onGiftValue();
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲模式需开启礼物值");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
SingleToastUtil.showToast(R.string.before_open_gift_value_should_close_ktv_model);
|
||||
return;
|
||||
}
|
||||
//开启礼物值不需要弹框
|
||||
if (!AvRoomDataManager.get().isShowGiftValue()) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
if (!GiftValueDialogUiHelper.get().isNeedConfirmDialog(
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE)) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
GiftValueDialogUiHelper.get().showGiftValueDialog(context, null,
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE,
|
||||
this::handleOpenGiftValue);
|
||||
}));
|
||||
}
|
||||
|
||||
private void handleOpenGiftValue() {
|
||||
boolean isOpen = !AvRoomDataManager.get().isShowGiftValue();
|
||||
GiftValueModel.get().openGiftValue(isOpen)
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.subscribe(new DontWarnObserver<String>() {
|
||||
@Override
|
||||
public void accept(String s, String error) {
|
||||
super.accept(s, error);
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error);
|
||||
} else {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_ROOM_GIFTVALUE_SWITCH,
|
||||
"礼物值开关,区分状态:" + isOpen);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间设置
|
||||
*
|
||||
@@ -415,54 +464,8 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
if (AvRoomDataManager.get().isManager()) {
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_setting,
|
||||
getContext().getResources().getString(R.string.room_setting), () -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onSetting();
|
||||
getContext().getResources().getString(R.string.room_setting), () -> RoomSettingActivity.start(getContext())));
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间管理员
|
||||
*
|
||||
* @param optAdapter
|
||||
*/
|
||||
private void addRoomManagerAction(OptAdapter optAdapter) {
|
||||
if (!AvRoomDataManager.get().isRoomOwner() || AvRoomDataManager.get().isCpRoom()) {
|
||||
return;
|
||||
}
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_admin,
|
||||
getContext().getResources().getString(R.string.team_admin),
|
||||
new OptAction.OnAction() {
|
||||
@Override
|
||||
public void onAction() {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomAdmin();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 厅管理
|
||||
*/
|
||||
private void addRoomModuleHallAction(OptAdapter optAdapter) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
return;
|
||||
}
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null || HallDataManager.get().getOwnerUid() != AvRoomDataManager.get().mCurrentRoomInfo.getUid())
|
||||
return;
|
||||
|
||||
optAdapter.addData(new OptAction(R.drawable.icon_room_module_hall,
|
||||
getContext().getResources().getString(R.string.label_room_hall_manage),
|
||||
() -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onRoomHall();
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -476,9 +479,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
getContext().getResources().getString(R.string.sa_label_room_super_a_manager),
|
||||
true,
|
||||
() -> {
|
||||
if (onActionListener != null) {
|
||||
onActionListener.onSuperAdmin();
|
||||
}
|
||||
RoomSAdminManagerActivity.start(context);
|
||||
}
|
||||
));
|
||||
}
|
||||
@@ -495,36 +496,9 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
}
|
||||
|
||||
public interface OnActionListener {
|
||||
void onSwitchGiftEffect();
|
||||
|
||||
void onSwitchPublicScreen();
|
||||
|
||||
void onSetting();
|
||||
|
||||
void onRoomLimit();
|
||||
|
||||
void onRoomAdmin();
|
||||
|
||||
void onRoomKTV();
|
||||
|
||||
void onPKAction();
|
||||
|
||||
void onRoomPKAction();
|
||||
|
||||
void onDatingAction();
|
||||
|
||||
void onRedPackageAction();
|
||||
|
||||
void onRoomHall();
|
||||
|
||||
void onGiftValue();
|
||||
|
||||
void onSuperAdmin();
|
||||
|
||||
void onSwitchRedPackage();
|
||||
|
||||
void onInviteFans();
|
||||
|
||||
}
|
||||
|
||||
static class OptAction {
|
||||
@@ -552,7 +526,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
|
||||
private class OptAdapter extends BaseQuickAdapter<OptAction, BaseViewHolder> {
|
||||
|
||||
private Context context;
|
||||
private final Context context;
|
||||
|
||||
OptAdapter(Context context, @Nullable List<OptAction> data) {
|
||||
super(R.layout.item_room_opt_dialog, data);
|
||||
@@ -565,12 +539,9 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
.setImageResource(R.id.iv_icon, item.icon)
|
||||
.setTextColor(R.id.tv_name, context.getResources().getColor(
|
||||
item.isAppColor ? R.color.appColor : R.color.white_transparent_50));
|
||||
helper.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
helper.itemView.setOnClickListener(v -> {
|
||||
item.onAction.onAction();
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,6 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -575,7 +574,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
public void onRoomOnlineNumberSuccess(int onlineNumber) {
|
||||
super.onRoomOnlineNumberSuccess(onlineNumber);
|
||||
updateOnlineNumberView(onlineNumber);
|
||||
// setIdOnlineData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -650,34 +648,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 提示音
|
||||
* <p>
|
||||
* * @param mContext
|
||||
* <p>
|
||||
*
|
||||
*/
|
||||
|
||||
private void playFromRawFile(Context mContext, int res) {
|
||||
try {
|
||||
MediaPlayer player = new MediaPlayer();
|
||||
AssetFileDescriptor file = mContext.getResources().openRawResourceFd(res);
|
||||
try {
|
||||
player.setDataSource(file.getFileDescriptor(), file.getStartOffset(), file.getLength());
|
||||
file.close();
|
||||
if (!player.isPlaying()) {
|
||||
player.prepare();
|
||||
player.start();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
player = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void dismissGiftDialog() {
|
||||
if (roomFragment != null) {
|
||||
roomFragment.dismissGiftDialog();
|
||||
|
@@ -43,17 +43,13 @@ import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomStatusChangeData;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
import com.tongdaxing.erban.sadmin.RoomSAdminManagerActivity;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.BottomViewListenerWrapper;
|
||||
import com.yizhuan.erban.avroom.ButtonItemFactory;
|
||||
import com.yizhuan.erban.avroom.SoftKeyBoardListener;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.activity.CreatePKActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomInviteActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomManagerListActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomSettingActivity;
|
||||
import com.yizhuan.erban.avroom.activity.RoomTitleEditActivity;
|
||||
import com.yizhuan.erban.avroom.adapter.BaseMicroViewAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.CpMicroViewAdapter;
|
||||
@@ -61,7 +57,6 @@ import com.yizhuan.erban.avroom.adapter.DatingMicroViewAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.KtvMicroViewAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.MicroViewAdapter;
|
||||
import com.yizhuan.erban.avroom.adapter.OnMicroItemClickListener;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPKCreateActivity;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkForceFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkReceivedDialog;
|
||||
@@ -70,7 +65,6 @@ import com.yizhuan.erban.avroom.dialog.MicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKMicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKResultDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.RoomImposeDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.RoomOperationDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
@@ -78,7 +72,6 @@ import com.yizhuan.erban.avroom.giftvalue.GiftValueDialogUiHelper;
|
||||
import com.yizhuan.erban.avroom.helper.RoomViewModel;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvHelper;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvMusicManager;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvSelectSongActivity;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvSongListActivity;
|
||||
import com.yizhuan.erban.avroom.presenter.HomePartyPresenter;
|
||||
import com.yizhuan.erban.avroom.redpackage.RedPackageSendDialog;
|
||||
@@ -96,7 +89,6 @@ import com.yizhuan.erban.event.OpenRoomIntroEvent;
|
||||
import com.yizhuan.erban.friend.view.SelectFriendActivity;
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter;
|
||||
import com.yizhuan.erban.miniworld.activity.MiniWorldGuestPageActivity;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.yizhuan.erban.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
@@ -117,7 +109,6 @@ import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.yizhuan.erban.utils.KeyBoardUtils;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomInviteFansActivity;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
@@ -150,7 +141,6 @@ import com.yizhuan.xchat_android_core.mentoring_relationship.model.MentoringRela
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.ActivityTimerEvent;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent;
|
||||
@@ -159,7 +149,6 @@ import com.yizhuan.xchat_android_core.room.event.DatingSelectUserEvent;
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent;
|
||||
import com.yizhuan.xchat_android_core.room.face.DynamicFaceModel;
|
||||
import com.yizhuan.xchat_android_core.room.face.FaceInfo;
|
||||
import com.yizhuan.xchat_android_core.room.giftvalue.GiftValueModel;
|
||||
import com.yizhuan.xchat_android_core.room.giftvalue.helper.GiftValueMrg;
|
||||
import com.yizhuan.xchat_android_core.room.ktv.KtvModel;
|
||||
import com.yizhuan.xchat_android_core.room.ktv.bean.MusicInfo;
|
||||
@@ -173,7 +162,6 @@ import com.yizhuan.xchat_android_core.room.pk.event.PKStateEvent;
|
||||
import com.yizhuan.xchat_android_core.room.pk.model.PkModel;
|
||||
import com.yizhuan.xchat_android_core.room.queue.bean.MicMemberInfo;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.bean.RespQueuingMicListInfo;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.QueuingMicEmptyEvent;
|
||||
import com.yizhuan.xchat_android_core.room.queuing_mic.event.QueuingMicNotEmptyEvent;
|
||||
import com.yizhuan.xchat_android_core.share.bean.SessionType;
|
||||
@@ -187,7 +175,6 @@ import com.yizhuan.xchat_android_core.user.bean.BaseInfo;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.utils.RxNetWorkUtils;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||
@@ -242,7 +229,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
private AvRoomNobleWelcomeView mNobleWelcomeView;
|
||||
private ViewStub mVsNobleWelcome;
|
||||
private Disposable mDisposable;
|
||||
private int audioQulity;
|
||||
private FragmentAvRoomGameBinding gameBinding;
|
||||
//添加变量
|
||||
private boolean isKtvMode = false;
|
||||
@@ -409,9 +395,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
if (!AvRoomDataManager.get().mIsNeedOpenMic && !isHavingMicPermissions()) {
|
||||
AvRoomDataManager.get().mIsNeedOpenMic = true;
|
||||
}
|
||||
|
||||
myUid = AuthModel.get().getCurrentUid();
|
||||
//audioQulity = AvRoomDataManager.get().mCurrentRoomInfo.getAudioQuality();
|
||||
gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
isCloseScreen = AvRoomDataManager.get().isCloseScreen();
|
||||
isOpenRedPackage = AvRoomDataManager.get().isOpenRedPackage();
|
||||
@@ -425,7 +409,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
updatePkScoreBoard();
|
||||
microView.setOnMicroItemClickListener(this);
|
||||
|
||||
|
||||
mDisposable = IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.subscribe(this::onReceiveRoomEvent);
|
||||
|
||||
@@ -1191,7 +1174,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
bottomView.showHomePartyDownMicBottom();
|
||||
}
|
||||
bottomView.showInputOrIcon(isOnMic);
|
||||
bottomView.showGameBottom();
|
||||
// 更新听筒消息
|
||||
bottomView.setRemoteMuteOpen(!AudioEngineManager.get().isRemoteMute());
|
||||
}
|
||||
@@ -1400,8 +1382,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onAntiSpamEvent(AntiSpamEvent event) {
|
||||
// Toast.makeText(getContext(), "发送失败,音游提醒您文明用语~", Toast.LENGTH_SHORT).show();
|
||||
SingleToastUtil.showToastShort("发送失败,音游提醒您文明用语~");
|
||||
SingleToastUtil.showToast("发送失败,音游提醒您文明用语~");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1617,7 +1598,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.roomcp_gift_open_click, "礼物面板按钮");
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.roomcp_gift_send_click, "礼物赠送按钮");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1781,7 +1761,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@Override
|
||||
public void onAvatarBtnClick(int position) {
|
||||
//getMvpPresenter().avatarClick(position, null);
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && roomInfo.isLeaveMode() && position == -1) {
|
||||
showUserCardDialog(String.valueOf(roomInfo.getUid()));
|
||||
@@ -2638,7 +2617,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
inputEdit.setFocusableInTouchMode(true);
|
||||
inputEdit.requestFocus();
|
||||
KeyBoardUtils.showKeyBoard(getContext(), inputEdit);
|
||||
|
||||
//
|
||||
StatisticManager.Instance().onEvent(BasicConfig.INSTANCE.getAppContext(),
|
||||
StatisticsProtocol.Event.EVENT_ROOM_INPUT_BOX_CLICK, "底部文字输入框点击", null);
|
||||
@@ -2671,223 +2649,16 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
} else
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_MP_ROOM_MORE_CLICK, "更多面板按钮");
|
||||
|
||||
|
||||
RoomOperationDialog dialog = new RoomOperationDialog(mContext);
|
||||
dialog.setOnActionListener(new RoomOperationDialog.OnActionListener() {
|
||||
@Override
|
||||
public void onSwitchGiftEffect() {
|
||||
AvRoomDataManager.get().haveSelfChange = true;
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = !AvRoomDataManager.get().mIsNeedGiftEffect;
|
||||
SingleToastUtil.showToastShort(AvRoomDataManager.get().mIsNeedGiftEffect ? "礼物特效已开启" : "礼物特效已关闭");
|
||||
|
||||
EventBus.getDefault().post(new HasAnimationEffect());
|
||||
}
|
||||
|
||||
//公屏开关
|
||||
@Override
|
||||
public void onSwitchPublicScreen() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (roomInfo.isCloseScreen()) {
|
||||
getMvpPresenter().roomOperate(SuperAdminModel.OPEN_PUBLIC_SCREEN);
|
||||
} else {
|
||||
getMvpPresenter().roomOperate(SuperAdminModel.CLOSE_PUBLIC_SCREEN);
|
||||
}
|
||||
AvRoomModel.get().closeScreen(roomInfo.getRoomId(),
|
||||
!roomInfo.isCloseScreen())
|
||||
.compose(bindToLifecycle())
|
||||
.flatMap(data -> IMNetEaseManager.get().closeOpenScreen(
|
||||
data.getRoomId(), data))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onSwitchRedPackage() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
RedPackageModel.INSTANCE.setRedPackageSwitch(AvRoomDataManager.get().getRoomUid()).subscribe(setIsNeedOpenRedPackage -> {
|
||||
roomInfo.setServerRedEnvelopeSwitch(setIsNeedOpenRedPackage);
|
||||
IMNetEaseManager.get().closeOpenRedPackage(roomInfo.getRoomId(), roomInfo);
|
||||
SingleToastUtil.showToastShort(setIsNeedOpenRedPackage ? "全服红包通知已开启" : "全服红包通知已关闭");
|
||||
});
|
||||
}
|
||||
|
||||
//邀请粉丝
|
||||
@Override
|
||||
public void onInviteFans() {
|
||||
RoomInviteFansActivity.start(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetting() {
|
||||
RoomSettingActivity.start(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomLimit() {
|
||||
new RoomImposeDialog(getActivity()).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomAdmin() {
|
||||
RoomManagerListActivity.start(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomKTV() {
|
||||
if (!isKtvMode) {
|
||||
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
|
||||
if (roomInfo.isLeaveMode()) {
|
||||
SingleToastUtil.showToast("开启ktv请先关闭离开模式");
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.roomcp_ktv_open_click, "开启KTV");
|
||||
}
|
||||
String giftValueTips = "";
|
||||
if (AvRoomDataManager.get().isShowGiftValue()) {
|
||||
giftValueTips = "\n开启KTV模式默认关闭礼物值";
|
||||
}
|
||||
getDialogManager().showOkCancelWithTitleDialog(
|
||||
isGameMode ? "当前正在游戏中,切换至KTV后将会关闭游戏模式,确认切换至KTV吗?" :
|
||||
"是否开启KTV功能?\n开启后所有麦上用户可通过KTV入口点歌" + giftValueTips,
|
||||
HomePartyRoomFragment.this::openKtvModelByRequest);
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.roomcp_ktv_choosesong_click, "KTV点唱");
|
||||
}
|
||||
|
||||
KtvSelectSongActivity.start(mContext, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPKAction() {
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲中不可以开启PK模式!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("跨房PK中不可以开启PK模式!");
|
||||
return;
|
||||
}
|
||||
CreatePKActivity.start(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomPKAction() {
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲中不可以开启跨房PK!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast("PK中不可以开启跨房PK!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("正在跨房PK中...");
|
||||
return;
|
||||
}
|
||||
RoomPKCreateActivity.start(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDatingAction() {
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
SingleToastUtil.showToast("PK中不可以开启相亲模式!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
SingleToastUtil.showToast("跨房PK中不可以开启相亲模式!");
|
||||
return;
|
||||
}
|
||||
if (getMvpPresenter() == null) return;
|
||||
getDialogManager().showOkCancelWithTitleDialog(
|
||||
AvRoomDataManager.get().isDatingMode() ? "关闭相亲模式?" : "开启相亲模式?开启同时现有礼物值将被清空",
|
||||
AvRoomDataManager.get().isDatingMode() ? "关闭" : "开启",
|
||||
() -> getMvpPresenter().datingOpen());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRedPackageAction() {
|
||||
dialog.setOnActionListener(() -> {
|
||||
redPackageSendDialog = new RedPackageSendDialog();
|
||||
redPackageSendDialog.show(getActivity());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_SENDHONGBAO_CLICK,
|
||||
"进入发红包页面");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomHall() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_MY_HALL_CLICK, "厅管理入口");
|
||||
ModuleHallActivity.start(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGiftValue() {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isDatingMode()) {
|
||||
SingleToastUtil.showToast("相亲模式需开启礼物值");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isOpenKTV()) {
|
||||
SingleToastUtil.showToast(mContext.getResources().getString(
|
||||
R.string.before_open_gift_value_should_close_ktv_model));
|
||||
return;
|
||||
}
|
||||
//开启礼物值不需要弹框
|
||||
if (!AvRoomDataManager.get().isShowGiftValue()) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
if (!GiftValueDialogUiHelper.get().isNeedConfirmDialog(
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE)) {
|
||||
handleOpenGiftValue();
|
||||
return;
|
||||
}
|
||||
GiftValueDialogUiHelper.get().showGiftValueDialog(mContext, getDialogManager(),
|
||||
GiftValueDialogUiHelper.TYPE_CLOSE_SHOW_GIFT_VALUE,
|
||||
this::handleOpenGiftValue);
|
||||
|
||||
}
|
||||
|
||||
private void handleOpenGiftValue() {
|
||||
boolean isOpen = !AvRoomDataManager.get().isShowGiftValue();
|
||||
GiftValueModel.get().openGiftValue(isOpen)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe(new DontWarnObserver<String>() {
|
||||
@Override
|
||||
public void accept(String s, String error) {
|
||||
super.accept(s, error);
|
||||
if (error != null) {
|
||||
SingleToastUtil.showToast(error);
|
||||
} else {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_ROOM_GIFTVALUE_SWITCH,
|
||||
"礼物值开关,区分状态:" + isOpen);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuperAdmin() {
|
||||
RoomSAdminManagerActivity.start(mContext);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点击排麦按钮
|
||||
*/
|
||||
@@ -2975,11 +2746,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransformGameClick() {
|
||||
super.onTransformGameClick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomMessageClick() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_MESSAGE_CLICK, "语音房_消息");
|
||||
|
@@ -1,185 +0,0 @@
|
||||
package com.yizhuan.erban.avroom.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
|
||||
/**
|
||||
* 轰趴房用户在线列表+贡献榜
|
||||
*
|
||||
* @author chenran
|
||||
* @date 2017/9/1
|
||||
*/
|
||||
public class HomePartyUserListFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
public final static int SHOW_PAGE_ONLINE_LIST = 1;
|
||||
public final static int SHOW_PAGE_CONTRIBUTE_LIST = 2;
|
||||
public final static int SHOW_PAGE_CHARM_LIST = 3;
|
||||
|
||||
private TextView onlineLayout;
|
||||
private TextView contributeLayout;
|
||||
private TextView tvCharmList;
|
||||
|
||||
OnlineUserFragment onlineFragment;
|
||||
RoomContributeListFragment contributeFragment;
|
||||
RoomCharmListFragment charmListFragment;
|
||||
|
||||
public int mSelectPage = SHOW_PAGE_ONLINE_LIST;
|
||||
private long mRoomUid;
|
||||
|
||||
public static HomePartyUserListFragment newInstance(long roomUid) {
|
||||
HomePartyUserListFragment fragment = new HomePartyUserListFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putLong(Constants.ROOM_UID, roomUid);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInitArguments(Bundle bundle) {
|
||||
super.onInitArguments(bundle);
|
||||
if (bundle != null) {
|
||||
mRoomUid = bundle.getLong(Constants.ROOM_UID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
if (intent != null)
|
||||
mRoomUid = intent.getLongExtra(Constants.ROOM_UID, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mSelectPage = outState.getInt(Constants.KEY_ROOM_IS_SHOW_ONLINE, SHOW_PAGE_ONLINE_LIST);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void restoreState(@Nullable Bundle savedInstanceState) {
|
||||
super.restoreState(savedInstanceState);
|
||||
if (savedInstanceState != null) {
|
||||
savedInstanceState.putInt(Constants.KEY_ROOM_IS_SHOW_ONLINE, mSelectPage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
onlineLayout = mView.findViewById(R.id.tv_online);
|
||||
contributeLayout = mView.findViewById(R.id.tv_contribute);
|
||||
tvCharmList = (TextView) mView.findViewById(R.id.tv_charm_list);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
onlineLayout.setOnClickListener(this);
|
||||
contributeLayout.setOnClickListener(this);
|
||||
tvCharmList.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiate() {
|
||||
showPage(mSelectPage);
|
||||
}
|
||||
|
||||
public void showPage(int selectPage) {
|
||||
this.mSelectPage = selectPage;
|
||||
showBackground();
|
||||
FragmentManager manager = getChildFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
onlineFragment = (OnlineUserFragment) manager.findFragmentByTag(OnlineUserFragment.class.getSimpleName());
|
||||
contributeFragment = (RoomContributeListFragment) manager.findFragmentByTag(RoomContributeListFragment.class.getSimpleName());
|
||||
charmListFragment = (RoomCharmListFragment) manager.findFragmentByTag(RoomCharmListFragment.class.getSimpleName());
|
||||
|
||||
for (int i = 0; i < manager.getFragments().size(); i++) {
|
||||
transaction.hide(manager.getFragments().get(i));
|
||||
}
|
||||
if (this.mSelectPage == SHOW_PAGE_ONLINE_LIST){
|
||||
if (onlineFragment == null) {
|
||||
onlineFragment = new OnlineUserFragment();
|
||||
transaction.add(R.id.fragment_user_list_container, onlineFragment, OnlineUserFragment.class.getSimpleName());
|
||||
}
|
||||
transaction.show(onlineFragment);
|
||||
onlineFragment.setShowToUser(true);
|
||||
}else if (this.mSelectPage == SHOW_PAGE_CONTRIBUTE_LIST){
|
||||
if (contributeFragment == null) {
|
||||
contributeFragment = new RoomContributeListFragment();
|
||||
transaction.add(R.id.fragment_user_list_container, contributeFragment, RoomContributeListFragment.class.getSimpleName());
|
||||
}
|
||||
transaction.show(contributeFragment);
|
||||
}else if (this.mSelectPage == SHOW_PAGE_CHARM_LIST){
|
||||
if (charmListFragment == null){
|
||||
charmListFragment = RoomCharmListFragment.newInstance();
|
||||
transaction.add(R.id.fragment_user_list_container, charmListFragment, RoomCharmListFragment.class.getSimpleName());
|
||||
}
|
||||
transaction.show(charmListFragment);
|
||||
}
|
||||
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
private void showBackground() {
|
||||
contributeLayout.setBackground(null);
|
||||
onlineLayout.setBackground(null);
|
||||
tvCharmList.setBackground(null);
|
||||
if (this.mSelectPage == SHOW_PAGE_ONLINE_LIST){
|
||||
onlineLayout.setBackgroundResource(R.drawable.bg_game_room_tab_select);
|
||||
}else if (this.mSelectPage == SHOW_PAGE_CONTRIBUTE_LIST){
|
||||
contributeLayout.setBackgroundResource(R.drawable.bg_game_room_tab_select);
|
||||
}else if (this.mSelectPage == SHOW_PAGE_CHARM_LIST){
|
||||
tvCharmList.setBackgroundResource(R.drawable.bg_game_room_tab_select);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_game_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_online:
|
||||
showPage(SHOW_PAGE_ONLINE_LIST);
|
||||
break;
|
||||
case R.id.tv_contribute:
|
||||
showPage(SHOW_PAGE_CONTRIBUTE_LIST);
|
||||
break;
|
||||
case R.id.tv_charm_list:
|
||||
showPage(SHOW_PAGE_CHARM_LIST);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置在线人数OnlineUserFragment 是否可见
|
||||
* @param position
|
||||
*/
|
||||
public void setViewPagerPosition(int position) {
|
||||
if (onlineFragment != null){
|
||||
if (position == 1 && mSelectPage == SHOW_PAGE_ONLINE_LIST) {
|
||||
onlineFragment.setShowToUser(true);
|
||||
}else {
|
||||
onlineFragment.setShowToUser(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,6 +2,8 @@ package com.yizhuan.erban.avroom.giftvalue;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
@@ -52,10 +54,6 @@ public class GiftValueDialogUiHelper {
|
||||
*/
|
||||
public final static String KEY_CHANGE_MIC_NEED_DIALOG_TIPS = "change_mic_need_dialog_tips";
|
||||
|
||||
private static final class Helper {
|
||||
public static final GiftValueDialogUiHelper INSTANCE = new GiftValueDialogUiHelper();
|
||||
}
|
||||
|
||||
public static GiftValueDialogUiHelper get() {
|
||||
return Helper.INSTANCE;
|
||||
}
|
||||
@@ -88,7 +86,7 @@ public class GiftValueDialogUiHelper {
|
||||
return AvRoomDataManager.get().isShowGiftValue() && isNeedConfirmDialog(TYPE_CHANGE_MIC);
|
||||
}
|
||||
|
||||
public void showGiftValueDialog(Context context, DialogManager dialogManager, int type,
|
||||
public void showGiftValueDialog(Context context, @Nullable DialogManager dialogManager, int type,
|
||||
DialogManager.OkCancelDialogListener l) {
|
||||
if (!ActivityUtil.isValidContext(context)) {
|
||||
return;
|
||||
@@ -127,5 +125,9 @@ public class GiftValueDialogUiHelper {
|
||||
});
|
||||
}
|
||||
|
||||
private static final class Helper {
|
||||
public static final GiftValueDialogUiHelper INSTANCE = new GiftValueDialogUiHelper();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -861,24 +861,6 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
|
||||
});
|
||||
}
|
||||
|
||||
public void datingOpen(){
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (!AvRoomDataManager.get().isDatingMode()){
|
||||
mHomePartyMode.datingOpen(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.doOnError(e -> SingleToastUtil.showToast(e.getMessage()))
|
||||
.subscribe();
|
||||
}
|
||||
else {
|
||||
mHomePartyMode.datingClose(roomInfo.getUid())
|
||||
.compose(bindToLifecycle())
|
||||
.doOnError(e -> SingleToastUtil.showToast(e.getMessage()))
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void datingNext() {
|
||||
final RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
|
@@ -75,8 +75,6 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
private ImageView remoteMute;
|
||||
private LinearLayout faceLayout;
|
||||
private LinearLayout micLayout;
|
||||
// private ImageView ivRoomKtv;
|
||||
private ImageView ivRoomGame;
|
||||
private ImageView iconMicQueue;
|
||||
private ImageView iconRoomMsg;
|
||||
|
||||
@@ -111,7 +109,6 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
sendGift = findViewById(R.id.icon_room_send_gift);
|
||||
sendMagic = findViewById(R.id.icon_room_send_magic);
|
||||
remoteMute = findViewById(R.id.icon_room_open_remote_mic);
|
||||
ivRoomGame = findViewById(R.id.icon_room_game);
|
||||
faceLayout = findViewById(R.id.room_face_layout);
|
||||
micLayout = findViewById(R.id.room_mic_layout);
|
||||
|
||||
@@ -126,8 +123,6 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
sendGift.setOnClickListener(this);
|
||||
remoteMute.setOnClickListener(this);
|
||||
sendMagic.setOnClickListener(this);
|
||||
// ivRoomKtv.setOnClickListener(this);
|
||||
ivRoomGame.setOnClickListener(this);
|
||||
iconMicQueue.setOnClickListener(this);
|
||||
iconRoomMsg.setOnClickListener(this);
|
||||
|
||||
@@ -280,30 +275,9 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
R.drawable.icon_room_mic_queue_not_empty);
|
||||
}
|
||||
|
||||
public void showGameBottom() {
|
||||
if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
ivRoomGame.setVisibility(GONE);
|
||||
} else {
|
||||
ivRoomGame.setVisibility((AvRoomDataManager.get().isCpRoom() && AvRoomDataManager.get().isRoomOwner()) ? VISIBLE : GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setGameClose() {
|
||||
ivRoomGame.setImageResource(R.drawable.icon_room_game_close);
|
||||
}
|
||||
|
||||
public void setGameOpen() {
|
||||
ivRoomGame.setImageResource(R.drawable.icon_room_game);
|
||||
}
|
||||
|
||||
public void showKtvBottom(boolean isShow) {
|
||||
// ivRoomKtv.setImageResource(isShow ? R.drawable.ic_ktv_select : R.drawable.icon_room_ktv_entrance);
|
||||
boolean hasKTVPriv = false;
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
hasKTVPriv = roomInfo.hasKTVPriv;
|
||||
}
|
||||
// ivRoomKtv.setVisibility(((isShow || AvRoomDataManager.get().isManager()) && hasKTVPriv) ? VISIBLE : GONE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -350,22 +324,12 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
wrapper.onMoreBtnClick();
|
||||
}
|
||||
break;
|
||||
// case R.id.icon_room_ktv:
|
||||
// if (wrapper != null) {
|
||||
// wrapper.onTransformKTVClick();
|
||||
// }
|
||||
// break;
|
||||
case R.id.icon_mic_queue:
|
||||
case R.id.iv_queuing_micro://注意这里是在HomePartyRoomFragment调用的
|
||||
if (wrapper != null) {
|
||||
wrapper.onMicQueueClick();
|
||||
}
|
||||
break;
|
||||
case R.id.icon_room_game:
|
||||
if (wrapper != null) {
|
||||
wrapper.onTransformGameClick();
|
||||
}
|
||||
break;
|
||||
case R.id.iv_room_message:
|
||||
if (wrapper != null) {
|
||||
wrapper.onRoomMessageClick();
|
||||
@@ -383,10 +347,6 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
llSendMsg.setVisibility(isIcon ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
public View getSendGiftView() {
|
||||
return sendGift;
|
||||
}
|
||||
|
||||
private void dismissMsgPopupWindow() {
|
||||
if (msgTipPopupWindow != null) {
|
||||
try {
|
||||
|
@@ -112,15 +112,6 @@
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_send_magic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_game"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_game"
|
||||
android:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
|
Reference in New Issue
Block a user