删除一些无用代码和注释掉的代码
This commit is contained in:
@@ -88,11 +88,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
CircleImageView ivAvatar;
|
||||
ImageView ivHalo;
|
||||
TextView tvNumber;
|
||||
|
||||
TextView tvCharmValue;
|
||||
View viewCenterOfCharm;
|
||||
View llCharmClick;
|
||||
|
||||
ImageView ivCharmLevelTag;
|
||||
|
||||
NormalMicroViewHolder(View itemView) {
|
||||
@@ -168,15 +163,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
if (!TextUtils.isEmpty(chatRoomMember.getAccount()) && Long.valueOf(chatRoomMember.getAccount()) > 0) {
|
||||
ivUpImage.setVisibility(View.GONE);
|
||||
ivAvatar.setVisibility(View.VISIBLE);
|
||||
// tvNick.setText(StringUtil.removeBlanks(chatRoomMember.getNick()));
|
||||
// tvNick.setTextColor(context.getResources().getColor(R.color.white));
|
||||
// if (AvRoomDataManager.get().isOpenPKMode()) {
|
||||
// ViewAdapter.setViewBackground(tvNick, R.color.black_transparent_20, 50, 0, 0);
|
||||
// } else {
|
||||
// int nickBgColor = context.getResources().getColor(
|
||||
// info.gender == 1 ? R.color.color_male_16AEFD : R.color.color_female_FE3F77);
|
||||
// ViewAdapter.setViewBackground(tvNick, nickBgColor, 50, 0, 0);
|
||||
// }
|
||||
setSelectText(position, chatRoomMember.getNick(), chatRoomMember.getGender());
|
||||
ImageLoadUtils.loadAvatar(BasicConfig.INSTANCE.getAppContext(), chatRoomMember.getAvatar(), ivAvatar);
|
||||
// 加载贵族
|
||||
@@ -208,9 +194,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
|
||||
protected void setDefalutText(int index) {
|
||||
tvNick.setTextColor(context.getResources().getColor(R.color.white_transparent_30));
|
||||
// ViewAdapter.setViewBackground(
|
||||
// tvNick, context.getResources().getColor(R.color.white_transparent_12), 50, 0, 0);
|
||||
// tvNick.setText(String.format(context.getString(R.string.number_mic_position), index + 1));
|
||||
tvNick.setText("号麦位");
|
||||
|
||||
if (tvNumber != null) {
|
||||
@@ -226,10 +209,6 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
tvNick.setTextColor(context.getResources().getColor(R.color.white));
|
||||
|
||||
if (tvNumber != null) {
|
||||
// tvNumber.setBackgroundResource(gender == 1 ? R.drawable.bg_number_male : R.drawable.bg_number_female);
|
||||
// tvNumber.setTextColor(context.getResources().getColor(R.color.white));
|
||||
// tvNumber.setText(String.valueOf(index + 1));
|
||||
|
||||
if (AvRoomDataManager.get().isOpenPKMode()) { // pk模式不加性别背景
|
||||
tvNumber.setBackgroundResource(R.drawable.icon_bg_number_default);
|
||||
tvNumber.setTextColor(context.getResources().getColor(R.color.white_transparent_30));
|
||||
|
@@ -126,9 +126,6 @@ import nl.dionsegijn.konfetti.models.Size;
|
||||
* @author Administrator
|
||||
*/
|
||||
public class HomePartyFragment extends AbsRoomFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
||||
public static final int SELECT_DEFAULT = -1;
|
||||
public static final int SELECT_ONLINE_LIST = 0;
|
||||
public static final int SELECT_CONTRIBUTE_LIST = 1;
|
||||
|
||||
private HomePartyRoomFragment roomFragment;
|
||||
|
||||
@@ -144,8 +141,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
private long mTargetRoomUid;
|
||||
private boolean isRoomMin;
|
||||
|
||||
public int selectPage;
|
||||
public int selectContent = -1;
|
||||
private GiftV2View giftView;
|
||||
private ViewStub mVsGift2View;
|
||||
|
||||
@@ -467,18 +462,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
.burst(60);
|
||||
}
|
||||
|
||||
public void clearScreen() {
|
||||
if (roomFragment != null) {
|
||||
roomFragment.clearScreen();
|
||||
}
|
||||
}
|
||||
|
||||
public void addMessage(ChatRoomMessage msg) {
|
||||
if (roomFragment != null) {
|
||||
roomFragment.addMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onResume() {
|
||||
@@ -572,17 +555,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
tipMessage.setContent("礼物特效");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(tipMessage);
|
||||
}
|
||||
// else if (AvRoomDataManager.get().mCurrentRoomInfo != null && !AvRoomDataManager.get().mCurrentRoomInfo.isServerRedEnvelopeSwitch()) {
|
||||
// MsgAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
|
||||
// CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_REDPACKAGE);
|
||||
// ChatRoomMessage closeMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
// String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
// closeMsg.setContent("管理员已关闭全服红包");
|
||||
// IMNetEaseManager.get().addCloseScreenMessages(closeMsg);
|
||||
// ChatRoomMessage tipMessage = ChatRoomMessageBuilder.createTipMessage("");
|
||||
// tipMessage.setContent("管理员已关闭全服红包");
|
||||
// IMNetEaseManager.get().addCloseScreenMessages(tipMessage);
|
||||
// }
|
||||
}
|
||||
|
||||
private void setIdOnlineData() {
|
||||
@@ -610,7 +582,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
});
|
||||
|
||||
gameMainBinding.setRoomInfo(roomInfo);
|
||||
// gameMainBinding.setHasAnimationEffect(AvRoomDataManager.get().mIsNeedGiftEffect);
|
||||
}
|
||||
|
||||
public void updateView() {
|
||||
@@ -669,7 +640,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
break;
|
||||
|
||||
case R.id.room_back:
|
||||
(Objects.requireNonNull(getActivity())).onBackPressed();
|
||||
requireActivity().onBackPressed();
|
||||
break;
|
||||
case R.id.iv_room_share:
|
||||
shareRoom();
|
||||
|
@@ -3,27 +3,13 @@ package com.yizhuan.erban.avroom.fragment;
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
@@ -32,12 +18,17 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.netease.nim.uikit.common.antispam.AntiSpamEvent;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
@@ -67,7 +58,6 @@ 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.dialog.MicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.NewUserTaskDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKMicQueueDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKResultDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.PKScoreBoardDialog;
|
||||
@@ -83,10 +73,6 @@ 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;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.yizhuan.erban.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.avroom.widget.BottomView;
|
||||
import com.yizhuan.erban.avroom.widget.MessageView;
|
||||
@@ -102,6 +88,10 @@ 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;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem;
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog;
|
||||
@@ -110,6 +100,9 @@ import com.yizhuan.erban.ui.widget.dialog.OpenNobleDialog;
|
||||
import com.yizhuan.erban.ui.widget.dynamicface.DynamicFaceDialog;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.marqueeview.AvRoomNobleWelcomeView;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.yizhuan.erban.utils.KeyBoardUtils;
|
||||
import com.yizhuan.tutu.music.widget.MusicPlayerView;
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomInviteFansActivity;
|
||||
@@ -143,13 +136,9 @@ import com.yizhuan.xchat_android_core.mentoring_relationship.event.MentoringStop
|
||||
import com.yizhuan.xchat_android_core.mentoring_relationship.model.MentoringRelationshipModel;
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel;
|
||||
import com.yizhuan.xchat_android_core.radish.task.TaskModel;
|
||||
import com.yizhuan.xchat_android_core.radish.task.bean.CheckNewUserTaskInfo;
|
||||
import com.yizhuan.xchat_android_core.radish.task.bean.PrizeType;
|
||||
import com.yizhuan.xchat_android_core.redPacket.bean.ActionDialogInfo;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.ActivityTimerEvent;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.TimerBean;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.event.RoomClearScreenEvent;
|
||||
import com.yizhuan.xchat_android_core.room.face.DynamicFaceModel;
|
||||
@@ -185,7 +174,6 @@ import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
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.ActivityUtil;
|
||||
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;
|
||||
@@ -218,7 +206,6 @@ import io.reactivex.SingleObserver;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.BiConsumer;
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_KTV_OPEN;
|
||||
import static com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol.Event.EVENT_ROOM_QUICKCHAT_CLICK;
|
||||
@@ -445,24 +432,24 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
RxBus.get().toFlowable(GameEvent.class)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(gameEvent -> handGameEvent(gameEvent));
|
||||
.subscribe(this::handGameEvent);
|
||||
|
||||
RxBus.get().toFlowable(AiPlayEndEvent.class)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.delay(2, TimeUnit.SECONDS)
|
||||
.subscribe(aiPlayEndEvent -> {
|
||||
getMvpPresenter().kickAi(aiPlayEndEvent);
|
||||
});
|
||||
.subscribe(aiPlayEndEvent -> getMvpPresenter().kickAi(aiPlayEndEvent));
|
||||
|
||||
// 接收公屏消息点击 可点击房间编辑页查看 事件
|
||||
RxBus.get().toFlowable(OpenRoomIntroEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(showUserInfoDialog -> showRoomIntroduction(false));
|
||||
|
||||
//换个对手重新发起游戏
|
||||
RxBus.get().toFlowable(ChangeUserEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(changeUserEvent -> ImGameMode.get().sendRoomSponsorGameMsg(changeUserEvent.gameInfo));
|
||||
|
||||
//换个游戏
|
||||
RxBus.get().toFlowable(ChangeGameEvent.class)
|
||||
.compose(bindToLifecycle())
|
||||
@@ -479,94 +466,12 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
// 刷新礼物列表,获取房间专属礼物列表
|
||||
GiftModel.get().refreshGiftList(String.valueOf(AvRoomDataManager.get().getRoomUid())).subscribe();
|
||||
// if (!AvRoomDataManager.get().isCpRoom() && TuTuGuideHelper.isNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_FIRST_ROOM)) {
|
||||
if (!AvRoomDataManager.get().isCpRoom()) {
|
||||
microView.recyclerView.postDelayed(() -> {
|
||||
if (!ActivityUtil.isValidContext(mContext)) {
|
||||
return;
|
||||
}
|
||||
int count = microView.recyclerView.getChildCount();
|
||||
if (count > 0) {
|
||||
View kingView = microView.recyclerView.getChildAt(count - 1);
|
||||
if (kingView == null) {
|
||||
return;
|
||||
}
|
||||
View micro_layout = kingView.findViewById(R.id.micro_layout);
|
||||
if (micro_layout == null) {
|
||||
return;
|
||||
}
|
||||
// TuTuGuideHelper helper = new TuTuGuideHelper(mContext);
|
||||
// helper.createHiGuide(() -> helper.createRoomGuide(micro_layout, bottomView.getSendGiftView()),
|
||||
// new TuTuGuideView.IGuideShowFinishListener() {
|
||||
// @Override
|
||||
// public void onSkip() {
|
||||
// checkNewUserTask();// 跳过指引,判断是否有新人有礼
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onGuideFinish() {
|
||||
// checkNewUserTask();// 引导图显示结束,判断是否有新人有礼
|
||||
// }
|
||||
// });
|
||||
// TuTuGuideHelper.setNoNeedHiGuide(TuTuGuideHelper.KEY_GUIDE_FIRST_ROOM);
|
||||
// checkNewUserTask();// 引导图显示结束,判断是否有新人有礼[20190719 直接去掉新人有礼dialog]
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
checkFollowOwner();
|
||||
checkMiniWorld();
|
||||
otherInitView();
|
||||
getMvpPresenter().loadMessageHistory();
|
||||
}
|
||||
|
||||
private void checkNewUserTask() {
|
||||
new TaskModel().checkNewUserTask(AuthModel.get().getCurrentUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.subscribe(new DontWarnObserver<CheckNewUserTaskInfo>() {
|
||||
@Override
|
||||
public void accept(CheckNewUserTaskInfo checkNewUserTaskInfo, String error) {
|
||||
super.accept(checkNewUserTaskInfo, error);
|
||||
if (error == null) {
|
||||
if (checkNewUserTaskInfo.isHasNewUser()) {// 可以领取新人礼物
|
||||
if (getFragmentManager() != null) {
|
||||
NewUserTaskDialog newUserTaskDialog = NewUserTaskDialog.newInstance(() -> {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_POPUP_NEW_USER_REWARD, "语音房-新人有礼弹窗-领取奖励");
|
||||
// 领取奖励
|
||||
receiveNewUserTaskAward(checkNewUserTaskInfo.getConfigId());
|
||||
});
|
||||
newUserTaskDialog.show(getFragmentManager(), "new_user_task_dialog");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void receiveNewUserTaskAward(long configId) {
|
||||
// getDialogManager().showProgressDialog(mContext, "正在领取奖励...");
|
||||
new TaskModel().receivePrice(configId, PrizeType.RADISH)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.subscribe(new DontWarnObserver<String>() {
|
||||
@Override
|
||||
public void accept(String s, String error) {
|
||||
super.accept(s, error);
|
||||
// getDialogManager().dismissDialog();
|
||||
if (error == null) {
|
||||
SingleToastUtil.showToast("送个萝卜礼物试试吧~");
|
||||
// 领取成功,刷新Dialog布局并且三秒后dismiss
|
||||
if (getFragmentManager() != null) {
|
||||
Fragment newUserTaskDialog = getFragmentManager().findFragmentByTag("new_user_task_dialog");
|
||||
if (newUserTaskDialog instanceof NewUserTaskDialog) {
|
||||
((NewUserTaskDialog) newUserTaskDialog).refreshDialogWithReceiveAwardFinish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SingleToastUtil.showToast(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void handGameEvent(GameEvent gameEvent) {
|
||||
switch (gameEvent.getType()) {
|
||||
case GameEvent.OPEN_GAME_MODEL:
|
||||
@@ -641,7 +546,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
break;
|
||||
case RoomEvent.ROOM_INFO_UPDATE:
|
||||
// changeAudioQuality();
|
||||
Logger.i("房间更新事件");
|
||||
gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
updateScreen();
|
||||
@@ -658,9 +562,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
cpRoomAutoUpMic();
|
||||
getMvpPresenter().leaveModeCheck();
|
||||
|
||||
UserModel.get().getUserInfoFromServer(myUid).subscribe(new Consumer<UserInfo>() {
|
||||
@Override
|
||||
public void accept(UserInfo userInfo) throws Exception {
|
||||
UserModel.get().getUserInfoFromServer(myUid).subscribe(userInfo -> {
|
||||
//如果贵族是超管,则不显示贵族进房提示
|
||||
if (userInfo != null && userInfo.isSuperAdmin()) {
|
||||
return;
|
||||
@@ -674,7 +576,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
mNobleWelcomeView.setData(userInfo.getNobleInfo(), userInfo.getNick());
|
||||
});
|
||||
}
|
||||
});
|
||||
gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
updateView();
|
||||
@@ -1530,20 +1431,12 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
((AVRoomActivity) getActivity()).onBackPressed();
|
||||
}
|
||||
break;
|
||||
// case R.id.activity_img:
|
||||
// if (!ListUtils.isListEmpty(mActionDialogInfoList)) {
|
||||
// ActionDialogInfo dialogInfo = mActionDialogInfoList.get(0);
|
||||
// CommonWebViewActivity.start(getContext(), dialogInfo.getSkipUrl());
|
||||
// }
|
||||
// break;
|
||||
case R.id.iv_ktv_contribute_list:
|
||||
case R.id.contribute_list:
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_CP_ROOM_RANKING_LIST_CLICK, "房间榜");
|
||||
} else
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_MP_ROOM_RANKING_LIST_CLICK, "房间榜");
|
||||
// RoomRankListActivity.start(getActivity());
|
||||
|
||||
if (getChildFragmentManager().findFragmentByTag("dialog_fragment_room_rank") != null) {
|
||||
return;
|
||||
}
|
||||
@@ -1555,12 +1448,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
break;
|
||||
case R.id.iv_treasure_box:
|
||||
case R.id.iv_treasure_box_cp:
|
||||
//隐藏梦幻许愿池
|
||||
// if (!GoldBoxHelper.isShowDiamondBox()) {
|
||||
// TreasureBoxActivity.start(getActivity());
|
||||
// } else {
|
||||
onClickBox();
|
||||
// }
|
||||
break;
|
||||
case R.id.iv_dragon_start_button:
|
||||
if (AvRoomDataManager.get().haveStartDragon) {
|
||||
@@ -1572,7 +1460,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
playDragon();
|
||||
break;
|
||||
case R.id.cancel_dragon:
|
||||
((AVRoomActivity) Objects.requireNonNull(getActivity())).giveUpDragonBar().subscribe(s -> {
|
||||
((AVRoomActivity) requireActivity()).giveUpDragonBar().subscribe(s -> {
|
||||
gameBinding.playDragon.setVisibility(View.INVISIBLE);
|
||||
gameBinding.cancelDragon.setVisibility(View.INVISIBLE);
|
||||
getMvpPresenter().cancelDragon();
|
||||
@@ -1794,7 +1682,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
GiftDialog.GIFT_DIALOG_FROM = "房间";
|
||||
userInfoDialog = new UserInfoDialog(mContext, JavaUtil.str2long(uid), buttonItemList, true);
|
||||
userInfoDialog.show();
|
||||
//getDialogManager().showCommonPopupDialog(buttonItemList, getString(R.string.cancel));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1840,9 +1727,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
String unlockStr = getString(isQueue && (!isBossMic) ? R.string.unlock_mic_queue : R.string.unlock_mic);
|
||||
String lockStr = getString(isQueue && (!isBossMic) ? R.string.lock_mic_queue : R.string.lock_mic);
|
||||
ButtonItem buttonItem3 = new ButtonItem(roomMicInfo.isMicLock() ? unlockStr :
|
||||
lockStr, new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
lockStr, () -> {
|
||||
if (roomMicInfo.isMicLock()) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
SingleToastUtil.showToast(SaConstant.TOAST_ERROR_TIPS);
|
||||
@@ -1855,17 +1740,9 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
getMvpPresenter().roomOperate(SuperAdminModel.LOCK_MIC);
|
||||
getMvpPresenter().lockMicroPhone(micPosition);
|
||||
}
|
||||
}
|
||||
});
|
||||
ButtonItem buttonItem4 = new ButtonItem("上麦", new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
toUpMicroPhone(micPosition, currentUid + "", false);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ButtonItem buttonItem4 = new ButtonItem("上麦", () -> toUpMicroPhone(micPosition, currentUid + "", false));
|
||||
//别问为什么,ui调整了顺序
|
||||
//禁用超管的上麦和抱TA上麦
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
@@ -2000,7 +1877,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
// pkBoardView.updateView();
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@@ -2106,6 +1982,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
* 底部按钮点击处理
|
||||
*/
|
||||
private class GameRoomBottomViewWrapper extends BottomViewListenerWrapper {
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onOpenMicBtnClick() {
|
||||
RoomQueueInfo roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByAccount(
|
||||
@@ -2116,19 +1993,15 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
if (!isHavingMicPermissions()) {
|
||||
RxPermissions rxPermissions = new RxPermissions(HomePartyRoomFragment.this);
|
||||
rxPermissions.request(Manifest.permission.RECORD_AUDIO).subscribe(new Consumer<Boolean>() {
|
||||
@Override
|
||||
public void accept(Boolean aBoolean) throws Exception {
|
||||
rxPermissions.request(Manifest.permission.RECORD_AUDIO).subscribe(aBoolean -> {
|
||||
if (aBoolean) {
|
||||
AvRoomDataManager.get().mIsNeedOpenMic = false;
|
||||
RtcEngineManager.get().setMute(!RtcEngineManager.get().isMute);
|
||||
RtcEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
// AvRoomDataManager.get().mIsNeedOpenMic = RtcEngineManager.get().isMute;
|
||||
updateMicBtn();
|
||||
} else {
|
||||
toast("开启权限后才能开麦");
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -2164,15 +2037,8 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
if (AvRoomDataManager.get().isOnMic(myUid) || AvRoomDataManager.get().isRoomOwner()) {
|
||||
if (dynamicFaceDialog == null) {
|
||||
dynamicFaceDialog = new DynamicFaceDialog(getContext());
|
||||
dynamicFaceDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
dynamicFaceDialog = null;
|
||||
}
|
||||
});
|
||||
dynamicFaceDialog.setFaceFilter(new DynamicFaceDialog.FaceFilter() {
|
||||
@Override
|
||||
public List<FaceInfo> onFilter(List<FaceInfo> faceInfoList) {
|
||||
dynamicFaceDialog.setOnDismissListener(dialog -> dynamicFaceDialog = null);
|
||||
dynamicFaceDialog.setFaceFilter(faceInfoList -> {
|
||||
//审核中版本过滤表情,显示
|
||||
if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
Iterator<FaceInfo> faceInfoIterator = faceInfoList.iterator();
|
||||
@@ -2189,7 +2055,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
return faceInfoList;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!dynamicFaceDialog.isShowing()) {
|
||||
@@ -2263,11 +2128,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
public void onSwitchGiftEffect() {
|
||||
AvRoomDataManager.get().haveSelfChange = true;
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = !AvRoomDataManager.get().mIsNeedGiftEffect;
|
||||
// Toast.makeText(
|
||||
// mContext,
|
||||
// AvRoomDataManager.get().mIsNeedGiftEffect ? "礼物特效已开启" : "礼物特效已关闭",
|
||||
// Toast.LENGTH_SHORT
|
||||
// ).show();
|
||||
SingleToastUtil.showToastShort(AvRoomDataManager.get().mIsNeedGiftEffect ? "礼物特效已开启" : "礼物特效已关闭");
|
||||
|
||||
EventBus.getDefault().post(new HasAnimationEffect());
|
||||
@@ -2408,9 +2268,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.Event.EVENT_ROOM_GIFTVALUE_SWITCH,
|
||||
"礼物值开关,区分状态:" + isOpen);
|
||||
// if (isOpen && getActivity() instanceof AVRoomActivity) {
|
||||
// ((AVRoomActivity) getActivity()).handleGiftValueStartTips();
|
||||
// }
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2548,7 +2405,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
|
||||
private void openOrCloseGame() {
|
||||
getDialogManager().showOkCancelDialog(AvRoomDataManager.get().gameModel ? "确定不再玩一会儿??"
|
||||
getDialogManager().showOkCancelDialog(AvRoomDataManager.get().gameModel ? "确定不再玩一会儿?"
|
||||
: isKtvMode ? "关闭KTV后,所有歌曲将被删除!确认关闭KTV并切换至游戏模式吗?" : "即将开启快玩模式,你准备好了吗?",
|
||||
true, new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
@@ -2680,18 +2537,9 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void changeModelShowView() {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mBoxSwitchVo != null) {
|
||||
boolean isOpenBoxSwitch = AvRoomDataManager.get().mBoxSwitchVo.isOpenBoxSwitch();
|
||||
boolean isDiamondBoxSwitch = AvRoomDataManager.get().mBoxSwitchVo.isDiamondBoxSwitch();
|
||||
String getDiamondBoxOpenTime = AvRoomDataManager.get().mBoxSwitchVo.getDiamondBoxOpenTime();
|
||||
String getOpenBoxIcon = AvRoomDataManager.get().mBoxSwitchVo.getOpenBoxIcon();
|
||||
}
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
@@ -3139,23 +2987,17 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@Override
|
||||
public void noFollow() {
|
||||
messageView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
messageView.post(() -> {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (roomInfo == null || userInfo == null || roomOwnner == null) {
|
||||
return;
|
||||
}
|
||||
// MessageView.SpannableBuilder spannableBuilder = new MessageView.SpannableBuilder();
|
||||
// SpannableString spannableString = new SpannableString(getString(R.string.tip_room_follow_owner,userInfo.getNick()));
|
||||
// spannableString.setSpan(new ForegroundColorSpan(),3,3 + nick.length(),);
|
||||
RoomFollowOwnerAttachment roomFollowOwnerAttachment = new RoomFollowOwnerAttachment();
|
||||
roomFollowOwnerAttachment.setOwnerUid(roomOwnner.getUid());
|
||||
roomFollowOwnerAttachment.setUserInfo(userInfo);
|
||||
messageView.addMessages(ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(roomInfo.getRoomId()), roomFollowOwnerAttachment));
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3181,22 +3023,16 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
@Override
|
||||
public void notInWorld(MiniWorldInWorldInfo miniWorldInWorldInfo) {
|
||||
messageView.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
messageView.postDelayed(() -> {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (roomInfo == null || userInfo == null) {
|
||||
return;
|
||||
}
|
||||
// MessageView.SpannableBuilder spannableBuilder = new MessageView.SpannableBuilder();
|
||||
// SpannableString spannableString = new SpannableString(getString(R.string.tip_room_follow_owner,userInfo.getNick()));
|
||||
// spannableString.setSpan(new ForegroundColorSpan(),3,3 + nick.length(),);
|
||||
JoinMiniWorldAttachment joinMiniWorldAttachment = new JoinMiniWorldAttachment();
|
||||
joinMiniWorldAttachment.setMiniWorldInfo(miniWorldInWorldInfo);
|
||||
mJoinMiniWorldOperationPosition = messageView.addMessages(ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(roomInfo.getRoomId()), joinMiniWorldAttachment));
|
||||
|
||||
}
|
||||
}, SHOW_JOIN_MINI_WORLD_TIME);
|
||||
}
|
||||
|
||||
@@ -3214,17 +3050,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onActivityTimerEvent(ActivityTimerEvent event) {
|
||||
setActTimerVisibility(View.GONE);
|
||||
TimerBean timerBean = event.getData();
|
||||
if (timerBean == null) {
|
||||
return;
|
||||
}
|
||||
/* if (!ListUtils.isListEmpty(specialActivities)) {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
gameBinding.activityTimerCp.start(timerBean);
|
||||
} else {
|
||||
gameBinding.activityTimer.start(timerBean);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private void otherInitView() {
|
||||
|
@@ -112,6 +112,8 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
|
||||
|
||||
private boolean isLeaveMode = false;
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
protected WalletInfo walletInfo;
|
||||
|
||||
public HomePartyPresenter() {
|
||||
@@ -470,7 +472,7 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
|
||||
if (roomQueueInfo != null) {
|
||||
JsonObject valueJsonObj = jsonParser.parse(entry.value).getAsJsonObject();
|
||||
if (valueJsonObj != null) {
|
||||
chatRoomMember =new Gson().fromJson(valueJsonObj,MicMemberInfo.class);
|
||||
chatRoomMember = gson.fromJson(valueJsonObj, MicMemberInfo.class);
|
||||
roomQueueInfo.mChatRoomMember = chatRoomMember;
|
||||
}
|
||||
AvRoomDataManager.get().addRoomQueueInfo(entry.key, roomQueueInfo);
|
||||
@@ -665,13 +667,14 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
|
||||
|
||||
/**
|
||||
* 全服红包公屏
|
||||
*
|
||||
* @param isOpenPackage
|
||||
*/
|
||||
public void updateRedPackage(boolean isOpenPackage){
|
||||
public void updateRedPackage(boolean isOpenPackage) {
|
||||
String contentText;
|
||||
if (isOpenPackage){
|
||||
if (isOpenPackage) {
|
||||
contentText = "管理员已开启全服红包";
|
||||
}else {
|
||||
} else {
|
||||
ChatRoomMessage firstMsg = IMNetEaseManager.get().getFirstMessageContent();
|
||||
IMNetEaseManager.get().addCloseScreenMessages(firstMsg);
|
||||
contentText = "管理员已关闭全服红包";
|
||||
|
@@ -284,6 +284,9 @@ public final class IMNetEaseManager {
|
||||
|
||||
private final AvRoomModel model;
|
||||
|
||||
@NonNull
|
||||
private final Gson gson = new Gson();
|
||||
|
||||
public RoomQueueInfo mCacheRoomQueueInfo;
|
||||
|
||||
private static PublishProcessor<RoomEvent> roomProcessor;
|
||||
@@ -1505,9 +1508,8 @@ public final class IMNetEaseManager {
|
||||
* 麦序更新
|
||||
*
|
||||
* @param extension -
|
||||
* @param gson -
|
||||
*/
|
||||
private void roomQueueMicUpdate(Map<String, Object> extension, Gson gson) {
|
||||
private void roomQueueMicUpdate(Map<String, Object> extension) {
|
||||
String micInfo = (String) extension.get("micInfo");
|
||||
if (!TextUtils.isEmpty(micInfo)) {
|
||||
int type = (int) extension.get("type");
|
||||
@@ -1552,17 +1554,16 @@ public final class IMNetEaseManager {
|
||||
ChatRoomNotificationAttachment notificationAttachment = (ChatRoomNotificationAttachment) msg.getAttachment();
|
||||
Map<String, Object> extension = notificationAttachment.getExtension();
|
||||
if (extension != null) {
|
||||
Gson gson = new Gson();
|
||||
// 1----房间信息更新 2-----麦序信息更新
|
||||
// 3----更新房间信息和麦序信息(排麦模式)
|
||||
int type = (int) extension.get("type");
|
||||
if (type == 2) {
|
||||
roomQueueMicUpdate(extension, gson);
|
||||
roomQueueMicUpdate(extension);
|
||||
} else if (type == 1) {
|
||||
roomInfoUpdate(extension, gson);
|
||||
roomInfoUpdate(extension);
|
||||
} else if (type == 3) {
|
||||
roomQueueMicUpdate(extension, gson);
|
||||
roomInfoUpdate(extension, gson);
|
||||
roomQueueMicUpdate(extension);
|
||||
roomInfoUpdate(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1572,9 +1573,8 @@ public final class IMNetEaseManager {
|
||||
* 房间信息更新
|
||||
*
|
||||
* @param extension --
|
||||
* @param gson --
|
||||
*/
|
||||
private void roomInfoUpdate(Map<String, Object> extension, Gson gson) {
|
||||
private void roomInfoUpdate(Map<String, Object> extension) {
|
||||
String roomInfoStr = (String) extension.get("roomInfo");
|
||||
if (!TextUtils.isEmpty(roomInfoStr)) {
|
||||
RoomInfo roomInfo = gson.fromJson(roomInfoStr, RoomInfo.class);
|
||||
@@ -1893,7 +1893,7 @@ public final class IMNetEaseManager {
|
||||
if (roomQueueInfo == null) {
|
||||
return;
|
||||
}
|
||||
MicMemberInfo chatRoomMember = parseChatRoomMember(contentJsonObj, roomQueueInfo);
|
||||
MicMemberInfo chatRoomMember = gson.fromJson(contentJsonObj, MicMemberInfo.class);
|
||||
//这里处理把这个人添加到队伍,或者移除队伍
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setUid(Long.parseLong(chatRoomMember.getAccount()));
|
||||
@@ -1956,11 +1956,6 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private MicMemberInfo parseChatRoomMember(JsonObject contentJsonObj, RoomQueueInfo roomQueueInfo) {
|
||||
return new Gson().fromJson(contentJsonObj,MicMemberInfo.class);
|
||||
}
|
||||
|
||||
public Single<List<ChatRoomMember>> fetchRoomMembersByIds(final List<String> accounts) {
|
||||
return Single.create((SingleOnSubscribe<List<ChatRoomMember>>) e -> {
|
||||
final RoomInfo mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
|
Reference in New Issue
Block a user