房间UI修改
@@ -583,11 +583,12 @@ public abstract class BaseMicroViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
}
|
||||
|
||||
tvNick.setBackgroundColor(context.getResources().getColor(R.color.transparent));
|
||||
if (AvRoomDataManager.get().isManager()) {
|
||||
/* if (AvRoomDataManager.get().isManager()) {
|
||||
ivRoomCanEdit.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
ivRoomCanEdit.setVisibility(View.GONE);
|
||||
}
|
||||
}*/
|
||||
ivRoomCanEdit.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.nnbc123.app.avroom.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -9,6 +8,8 @@ import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.nnbc123.app.R;
|
||||
@@ -20,8 +21,8 @@ import com.nnbc123.core.noble.NobleInfo;
|
||||
import com.nnbc123.core.noble.NobleUtil;
|
||||
import com.nnbc123.core.room.bean.RoomContributeUserInfo;
|
||||
import com.nnbc123.core.room.bean.RoomRankMultiItem;
|
||||
import com.nnbc123.library.utils.FormatUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -174,14 +175,7 @@ public class RoomConsumeListAdapter extends BaseMultiItemQuickAdapter<RoomContri
|
||||
* 设置共同的部分
|
||||
*/
|
||||
private void setCommonView(BaseViewHolder baseViewHolder, RoomContributeUserInfo roomConsumeInfo) {
|
||||
String goldAmount;
|
||||
if (roomConsumeInfo.getGoldAmount() >= 10000) {
|
||||
BigDecimal b = new BigDecimal(roomConsumeInfo.getGoldAmount() / 10000.0);
|
||||
double df = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
goldAmount = String.valueOf(df) + "万";
|
||||
} else {
|
||||
goldAmount = String.valueOf(roomConsumeInfo.getGoldAmount());
|
||||
}
|
||||
String goldAmount = FormatUtils.formatRankValue(roomConsumeInfo.getGoldAmount());
|
||||
baseViewHolder.setText(R.id.tv_erban_id, roomConsumeInfo.isHide() ? "****" : "ID:" + roomConsumeInfo.getErbanNo())
|
||||
.setImageResource(R.id.iv_sex,
|
||||
roomConsumeInfo.getGender() == 1 ? R.drawable.ic_gender_male : R.drawable.ic_gender_female)
|
||||
|
@@ -602,7 +602,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
} else {
|
||||
bottomView.showHomePartyDownMicBottom()
|
||||
}
|
||||
bottomView.showInputOrIcon(isOnMic)
|
||||
// 更新听筒消息
|
||||
bottomView.setRemoteMuteOpen(!AudioEngineManager.get().isRemoteMute)
|
||||
if (isOnMic) {
|
||||
|
@@ -1,687 +0,0 @@
|
||||
package com.nnbc123.app.avroom.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewStub;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity;
|
||||
import com.nnbc123.app.avroom.activity.RoomOnlineUserActivity;
|
||||
import com.nnbc123.app.avroom.adapter.SelectGameAdapter;
|
||||
import com.nnbc123.app.avroom.dialog.ExitRoomPopupWindow;
|
||||
import com.nnbc123.app.avroom.widget.GiftV2View;
|
||||
import com.nnbc123.app.base.BaseFragment;
|
||||
import com.nnbc123.app.databinding.FragmentChatroomGameMainBinding;
|
||||
import com.nnbc123.app.friend.view.SelectFriendActivity;
|
||||
import com.nnbc123.app.home.helper.OpenRoomHelper;
|
||||
import com.nnbc123.app.ui.widget.ShareDialog;
|
||||
import com.nnbc123.app.utils.RegexUtil;
|
||||
import com.nnbc123.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftReceiveInfo;
|
||||
import com.nnbc123.core.gift.bean.LuckyBagGifts;
|
||||
import com.nnbc123.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.nnbc123.core.home.event.FollowRoomEvent;
|
||||
import com.nnbc123.core.home.event.ShareRoomEvent;
|
||||
import com.nnbc123.core.home.model.CollectionRoomModel;
|
||||
import com.nnbc123.core.im.custom.bean.CustomAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.RoomInfoAttachment;
|
||||
import com.nnbc123.core.magic.bean.MagicReceivedInfo;
|
||||
import com.nnbc123.core.magic.bean.MultiMagicReceivedInfo;
|
||||
import com.nnbc123.core.manager.AvRoomDataManager;
|
||||
import com.nnbc123.core.manager.IMNetEaseManager;
|
||||
import com.nnbc123.core.manager.RoomEvent;
|
||||
import com.nnbc123.core.praise.PraiseModel;
|
||||
import com.nnbc123.core.room.bean.RoomInfo;
|
||||
import com.nnbc123.core.room.bean.RoomModeType;
|
||||
import com.nnbc123.core.room.game.GameInfo;
|
||||
import com.nnbc123.core.room.game.GameModel;
|
||||
import com.nnbc123.core.room.queuing_mic.event.HasAnimationEffect;
|
||||
import com.nnbc123.core.share.ShareModel;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.super_admin.util.SuperAdminUtil;
|
||||
import com.nnbc123.core.user.UserModel;
|
||||
import com.nnbc123.core.user.bean.UserInfo;
|
||||
import com.nnbc123.library.utils.JavaUtil;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.sharesdk.framework.Platform;
|
||||
import io.reactivex.SingleObserver;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Action;
|
||||
|
||||
/**
|
||||
* 轰趴房
|
||||
* Created by 2016/9/22.
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
public class HomePartyFragment extends BaseFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
||||
|
||||
private Fragment roomFragment;
|
||||
|
||||
private TextView roomTitle;
|
||||
private TextView roomId;
|
||||
private ImageView ivFollowRoom;
|
||||
private AppCompatImageView mIvGoodNumber;
|
||||
|
||||
private ImageView roomMore;
|
||||
private GiftV2View giftView;
|
||||
private ViewStub mVsGift2View;
|
||||
|
||||
private SVGAImageView svgaRoomBg;
|
||||
private String[] bgPicture = new String[]{""};
|
||||
|
||||
private UserInfo mUserInfo;
|
||||
private FragmentChatroomGameMainBinding gameMainBinding;
|
||||
|
||||
private ShareDialog shareDialog;
|
||||
|
||||
//收藏房间
|
||||
private String FOLLOW_ROOM_TYPE = "";
|
||||
private SelectGameAdapter gameAdapter;
|
||||
|
||||
|
||||
public static HomePartyFragment newInstance() {
|
||||
HomePartyFragment homePartyFragment = new HomePartyFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
homePartyFragment.setArguments(bundle);
|
||||
return homePartyFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
// clear views
|
||||
roomTitle.setText("");
|
||||
setRoomId(0, 0);
|
||||
updateOnlineNumberView(0);
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((HomePartyRoomFragment) roomFragment).onNewIntent(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
private void setRoomId(long id, int onlineNumber) {
|
||||
String htmlText = "ID:" + id;
|
||||
roomId.setText(htmlText);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_chatroom_game_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
gameMainBinding = DataBindingUtil.bind(mView);
|
||||
roomTitle = mView.findViewById(R.id.room_title);
|
||||
setupRoomTitleMarquee();
|
||||
roomMore = mView.findViewById(R.id.room_more);
|
||||
roomId = mView.findViewById(R.id.room_id);
|
||||
mVsGift2View = mView.findViewById(R.id.vs_gift_view);
|
||||
mIvGoodNumber = mView.findViewById(R.id.iv_good_number);
|
||||
ivFollowRoom = mView.findViewById(R.id.iv_follow_room);
|
||||
svgaRoomBg = mView.findViewById(R.id.svga_image_view_bg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加跑马灯
|
||||
* 以及反射一些参数影响跑马灯
|
||||
*/
|
||||
private void setupRoomTitleMarquee() {
|
||||
try {
|
||||
ViewConfiguration configuration = ViewConfiguration.get(getContext());
|
||||
Class claz = configuration.getClass();
|
||||
Field field = claz.getDeclaredField("mFadingMarqueeEnabled");
|
||||
field.setAccessible(true);
|
||||
field.set(configuration, true);
|
||||
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
roomTitle.setSelected(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
roomMore.setOnClickListener(this);
|
||||
ivFollowRoom.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void initiate() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
if (!AvRoomDataManager.get().haveSelfChange) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private void initRvGame() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null || gameAdapter != null) return;
|
||||
gameMainBinding.rvGame.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
gameMainBinding.rvGame.setAdapter(gameAdapter = new SelectGameAdapter());
|
||||
gameMainBinding.llSelectGame.setOnClickListener(v -> {
|
||||
if (gameMainBinding.rvGame.getVisibility() == View.VISIBLE) {
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
} else {
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
} else {
|
||||
gameMainBinding.rvGame.setVisibility(View.VISIBLE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gameAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
}
|
||||
if (!isShowChangeGame()) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!");
|
||||
return;
|
||||
}
|
||||
|
||||
GameInfo gameInfo = gameAdapter.getItem(position);
|
||||
if (gameInfo != null) {
|
||||
int type;
|
||||
long mgId = 0;
|
||||
if (Objects.equals("扩列交友", gameInfo.getName())) {
|
||||
type = RoomInfo.ROOMTYPE_HOME_PARTY;
|
||||
} else {
|
||||
type = RoomInfo.ROOMTYPE_GAME;
|
||||
mgId = JavaUtil.str2long(gameInfo.getMgId());
|
||||
}
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
getBaseActivity(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
mgId,
|
||||
false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//这里的2和4是服务端定义的错误状态 关闭排麦模式和关闭PK模式!
|
||||
private boolean isShowChangeGame() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
return currentRoomInfo != null &&
|
||||
AvRoomDataManager.get().isRoomOwner() &&
|
||||
currentRoomInfo.getIsPermitRoom() != 1 &&
|
||||
currentRoomInfo.getType() != RoomInfo.ROOM_TYPE_SINGLE &&
|
||||
(currentRoomInfo.getRoomModeType() == RoomModeType.NORMAL_MODE ||
|
||||
currentRoomInfo.getRoomModeType() == 2 ||
|
||||
currentRoomInfo.getRoomModeType() == 4);
|
||||
}
|
||||
|
||||
public void setRoomBg(RoomInfo roomInfo) {
|
||||
if (svgaRoomBg == null) return;
|
||||
updateView(roomInfo);
|
||||
AVRoomActivity.setBackBg(mContext, roomInfo, svgaRoomBg, bgPicture);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
updateView(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(roomEvent -> {
|
||||
if (roomEvent == null) return;
|
||||
int event = roomEvent.getEvent();
|
||||
switch (event) {
|
||||
case RoomEvent.ENTER_ROOM:
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
updateOnlineNumberView(AvRoomDataManager.get().mCurrentRoomInfo.onlineNum);
|
||||
}
|
||||
addTipMsg();
|
||||
case RoomEvent.ROOM_INFO_UPDATE:
|
||||
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||
break;
|
||||
case RoomEvent.RECEIVE_NORMALE_GIFT:
|
||||
onReceiveGiftMsg(roomEvent.getGiftReceiveInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_MUTLT_NORMALEI_GIFT://普通多人
|
||||
onReceiveMultiGiftMsg(roomEvent.getGiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_ALL_MIC__NORMALEI_GIFT://普通全麦
|
||||
onReceiveAllMicGiftMsg(roomEvent.getMultiGiftReceiveInfo());
|
||||
break;
|
||||
//福袋礼物
|
||||
case RoomEvent.RECEIVE_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_MULTI_LUCKY_GIFT:
|
||||
case RoomEvent.RECEIVE_ALL_MIC_LUCKY_GIFT:
|
||||
onReceiveLuckyGiftToMultiMsg(roomEvent.getLuckygiftMultiReceiverInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_SINGLE_MAGIC:
|
||||
onReceiveMagicMsg(roomEvent.getMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVED_ALL_MIC_MAGIC:
|
||||
onReceiveMultiMagicMsg(roomEvent.getMultiMagicReceivedInfo());
|
||||
break;
|
||||
case RoomEvent.FANS_TEAM_JOIN:
|
||||
onReceiveFansTeamJoinMsg(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveLuckyGiftToMultiMsg(LuckyBagGifts giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveLuckyGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入房间时的提示信息
|
||||
*/
|
||||
private void addTipMsg() {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().mCurrentRoomInfo.isCloseScreen()) {
|
||||
MsgAttachment attachment = new RoomInfoAttachment(CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
|
||||
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN);
|
||||
ChatRoomMessage closeMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
|
||||
closeMsg.setContent("管理员已关闭聊天公屏");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(closeMsg);
|
||||
} else if (AvRoomDataManager.get().mCurrentRoomInfo != null && !AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect()) {
|
||||
ChatRoomMessage tipMessage = ChatRoomMessageBuilder.createTipMessage("");
|
||||
tipMessage.setContent("礼物特效");
|
||||
IMNetEaseManager.get().addCloseScreenMessages(tipMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIdOnlineData() {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
|
||||
UserModel.get().getUserInfo(roomInfo.getUid()).subscribe(new SingleObserver<UserInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mCompositeDisposable.add(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(UserInfo userInfo) {
|
||||
mUserInfo = userInfo;
|
||||
setRoomId(mUserInfo.getErbanNo(), roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(mUserInfo.isHasPrettyErbanNo() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
setRoomId(0, roomInfo.onlineNum);
|
||||
mIvGoodNumber.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
gameMainBinding.setRoomInfo(roomInfo);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void updateView(RoomInfo currentRoomInfo) {
|
||||
if (currentRoomInfo != null) {
|
||||
|
||||
Fragment tempFragment = roomFragment;
|
||||
switch (currentRoomInfo.getType()) {
|
||||
case RoomInfo.ROOMTYPE_GAME:
|
||||
if (!(tempFragment instanceof GameRoomFragment)) {
|
||||
tempFragment = GameRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
case RoomInfo.ROOM_TYPE_SINGLE:
|
||||
if (!(tempFragment instanceof SingleRoomFragment)) {
|
||||
tempFragment = SingleRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!(tempFragment instanceof HomePartyRoomFragment)) {
|
||||
tempFragment = HomePartyRoomFragment.newInstance();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tempFragment != roomFragment) {
|
||||
roomFragment = tempFragment;
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.container, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
gameMainBinding.setRoomInfo(currentRoomInfo);
|
||||
updateHasAnimationEffect();
|
||||
roomTitle.setText(RegexUtil.getPrintableString(currentRoomInfo.getTitle()));
|
||||
if (!StringUtil.isEmpty(currentRoomInfo.getRoomPwd())) {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null,
|
||||
getResources().getDrawable(R.drawable.icon_room_lock), null);
|
||||
} else {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||
}
|
||||
|
||||
|
||||
ivFollowRoom.setVisibility(AvRoomDataManager.get().isRoomOwner() ? View.GONE : View.VISIBLE);
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
|
||||
setIdOnlineData();
|
||||
if (isShowChangeGame()) {
|
||||
initRvGame();
|
||||
gameMainBinding.llChangeGame.setVisibility(View.VISIBLE);
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
gameMainBinding.tvCurrGame.setText(currentRoomInfo.getMgName());
|
||||
} else {
|
||||
gameMainBinding.tvCurrGame.setText("扩列交友");
|
||||
}
|
||||
GameModel.INSTANCE.getGameList()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(gameInfos -> {
|
||||
if (AvRoomDataManager.get().isOpenGame()) {
|
||||
for (int i = 0; i < gameInfos.size(); i++) {
|
||||
GameInfo gameInfo = gameInfos.get(i);
|
||||
if (JavaUtil.str2long(gameInfo.getMgId()) == currentRoomInfo.getMgId()) {
|
||||
gameInfos.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
GameInfo gameInfo = new GameInfo();
|
||||
gameInfo.setName("扩列交友");
|
||||
gameInfos.add(gameInfo);
|
||||
}
|
||||
gameAdapter.setNewData(gameInfos);
|
||||
});
|
||||
} else {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateHasAnimationEffect() {
|
||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect = AvRoomDataManager.get().mCurrentRoomInfo.isHasAnimationEffect();
|
||||
}
|
||||
gameMainBinding.setHasAnimationEffect(AvRoomDataManager.get().mIsNeedGiftEffect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特效开关提示
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void updateHasAnimation(HasAnimationEffect event) {
|
||||
updateHasAnimationEffect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.room_more:
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity())
|
||||
.showAtLocation(gameMainBinding.getRoot(), Gravity.END, 0, 0);
|
||||
break;
|
||||
case R.id.ll_room_info:
|
||||
RoomOnlineUserActivity.start(getActivity());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_ONLINE_LIST_CLICK, "房间在线列表点击");
|
||||
break;
|
||||
case R.id.iv_follow_room:
|
||||
followRoom();
|
||||
break;
|
||||
case R.id.iv_back:
|
||||
if (getActivity() instanceof AVRoomActivity) {
|
||||
((AVRoomActivity) getActivity()).onBackPressed();
|
||||
}
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_RETURN_CLICK, "房间返回按钮点击");
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public void dismissSendRedPackageDialog() {
|
||||
if (roomFragment instanceof BaseRoomFragment) {
|
||||
((BaseRoomFragment) roomFragment).clearDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏房间
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void followRoom() {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, String> arguments = new HashMap<>();
|
||||
arguments.put("room_id", String.valueOf(mUserInfo == null ? currentRoomInfo.getUid() : mUserInfo.getErbanNo()));
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_COLLECT_ICON_CLICK, "语音房_收藏顶部按钮", arguments);
|
||||
|
||||
CollectionRoomModel.get().followRoom(FOLLOW_ROOM_TYPE, currentRoomInfo.getUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError(throwable -> {
|
||||
toast(throwable.getMessage());
|
||||
})
|
||||
.subscribe(s -> {
|
||||
AvRoomDataManager.get().isRoomFans = !AvRoomDataManager.get().isRoomFans;
|
||||
FOLLOW_ROOM_TYPE = AvRoomDataManager.get().isRoomFans ? "2" : "1";
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
if (AvRoomDataManager.get().isRoomFans) {
|
||||
SingleToastUtil.showToast("收藏成功!");
|
||||
PraiseModel.get().setFollowRoomSuccessRoomTip(currentRoomInfo.getUid());
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_FOLLOW_BUTTON_CLICK, "语音房_收藏顶部按钮");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFollowRoomEvent(FollowRoomEvent event) {
|
||||
ivFollowRoom.setImageResource(AvRoomDataManager.get().isRoomFans ? R.drawable.icon_room_liked : R.drawable.icon_room_like);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onShareRoomEvent(ShareRoomEvent event) {
|
||||
shareRoom();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享房间
|
||||
*/
|
||||
public void shareRoom() {
|
||||
if (shareDialog != null && shareDialog.isShowing()) {
|
||||
shareDialog.dismiss();
|
||||
}
|
||||
shareDialog = new ShareDialog(getActivity());
|
||||
shareDialog.setOnShareDialogItemClick(this);
|
||||
shareDialog.show();
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SHARE_CLICK, "语音房_分享");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInAppSharingItemClick() {
|
||||
shareDialog.dismiss();
|
||||
SelectFriendActivity.startForSharingRoom(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharePlatformClick(Platform platform) {
|
||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (currentRoomInfo != null) {
|
||||
UserModel.get().getUserInfo(currentRoomInfo.getUid())
|
||||
.flatMap(userInfo -> ShareModel.get().shareRoom(
|
||||
platform,
|
||||
currentRoomInfo.getUid(),
|
||||
userInfo.getErbanNo(),
|
||||
currentRoomInfo.getTitle(),
|
||||
currentRoomInfo.getAvatar()
|
||||
))
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doAfterTerminate(new Action() {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
getDialogManager().dismissDialog();
|
||||
}
|
||||
})
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
toast(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
toast(e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (giftView != null) {
|
||||
giftView.release();
|
||||
}
|
||||
EventBus.getDefault().unregister(this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
roomFragment.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public void onRoomOnlineNumberSuccess(int onlineNumber) {
|
||||
updateOnlineNumberView(onlineNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通多人
|
||||
*
|
||||
* @param giftMultiReceiverInfo
|
||||
*/
|
||||
private void onReceiveMultiGiftMsg(GiftMultiReceiverInfo giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftToMultiMsg(giftMultiReceiverInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通全麦
|
||||
*
|
||||
* @param multiGiftReceiveInfo
|
||||
*/
|
||||
private void onReceiveAllMicGiftMsg(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
if (multiGiftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiGiftMsg(multiGiftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveGiftMsg(GiftReceiveInfo giftReceiveInfo) {
|
||||
if (giftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftMsg(giftReceiveInfo);
|
||||
}
|
||||
|
||||
private void onReceiveMagicMsg(MagicReceivedInfo magicReceivedInfo) {
|
||||
if (magicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMagicMsg(magicReceivedInfo);
|
||||
}
|
||||
|
||||
|
||||
private void onReceiveMultiMagicMsg(MultiMagicReceivedInfo multiMagicReceivedInfo) {
|
||||
if (multiMagicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo);
|
||||
}
|
||||
|
||||
private void onReceiveFansTeamJoinMsg(ChatRoomMessage message) {
|
||||
if (message == null || !isResumed())
|
||||
return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveFansTeamOpenMsg(message);
|
||||
}
|
||||
|
||||
private void updateOnlineNumberView(int onlineNumber) {
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
if (onlineNumber < 1) {
|
||||
onlineNumber = 1;
|
||||
}
|
||||
}
|
||||
gameMainBinding.roomNums.setText("在线" + onlineNumber);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,635 @@
|
||||
package com.nnbc123.app.avroom.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewConfiguration
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import cn.sharesdk.framework.Platform
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
|
||||
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment
|
||||
import com.nnbc123.app.R
|
||||
import com.nnbc123.app.avroom.activity.AVRoomActivity
|
||||
import com.nnbc123.app.avroom.activity.RoomOnlineUserActivity
|
||||
import com.nnbc123.app.avroom.adapter.SelectGameAdapter
|
||||
import com.nnbc123.app.avroom.dialog.ExitRoomPopupWindow.Companion.newInstance
|
||||
import com.nnbc123.app.base.BaseFragment
|
||||
import com.nnbc123.app.databinding.FragmentChatroomGameMainBinding
|
||||
import com.nnbc123.app.friend.view.SelectFriendActivity
|
||||
import com.nnbc123.app.home.helper.OpenRoomHelper
|
||||
import com.nnbc123.app.ui.utils.loadAvatar
|
||||
import com.nnbc123.app.ui.webview.DialogWebViewActivity
|
||||
import com.nnbc123.app.ui.widget.ShareDialog
|
||||
import com.nnbc123.app.ui.widget.ShareDialog.OnShareDialogItemClick
|
||||
import com.nnbc123.app.utils.RegexUtil
|
||||
import com.nnbc123.app.vip.VipMainActivity
|
||||
import com.nnbc123.core.UriProvider
|
||||
import com.nnbc123.core.gift.bean.GiftMultiReceiverInfo
|
||||
import com.nnbc123.core.gift.bean.GiftReceiveInfo
|
||||
import com.nnbc123.core.gift.bean.LuckyBagGifts
|
||||
import com.nnbc123.core.gift.bean.MultiGiftReceiveInfo
|
||||
import com.nnbc123.core.home.event.FollowRoomEvent
|
||||
import com.nnbc123.core.home.event.ShareRoomEvent
|
||||
import com.nnbc123.core.home.model.CollectionRoomModel
|
||||
import com.nnbc123.core.im.custom.bean.CustomAttachment
|
||||
import com.nnbc123.core.im.custom.bean.RoomInfoAttachment
|
||||
import com.nnbc123.core.magic.bean.MagicReceivedInfo
|
||||
import com.nnbc123.core.magic.bean.MultiMagicReceivedInfo
|
||||
import com.nnbc123.core.manager.AvRoomDataManager
|
||||
import com.nnbc123.core.manager.IMNetEaseManager
|
||||
import com.nnbc123.core.manager.RoomEvent
|
||||
import com.nnbc123.core.praise.PraiseModel
|
||||
import com.nnbc123.core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
import com.nnbc123.core.room.bean.RoomContributeDataInfo
|
||||
import com.nnbc123.core.room.bean.RoomContributeUserInfo
|
||||
import com.nnbc123.core.room.bean.RoomInfo
|
||||
import com.nnbc123.core.room.game.GameInfo
|
||||
import com.nnbc123.core.room.game.GameModel.getGameList
|
||||
import com.nnbc123.core.room.model.RoomContributeListModel
|
||||
import com.nnbc123.core.room.queuing_mic.event.HasAnimationEffect
|
||||
import com.nnbc123.core.share.ShareModel
|
||||
import com.nnbc123.core.statistic.StatisticManager
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol
|
||||
import com.nnbc123.core.super_admin.util.SuperAdminUtil
|
||||
import com.nnbc123.core.user.UserModel
|
||||
import com.nnbc123.core.user.bean.UserInfo
|
||||
import com.nnbc123.core.utils.net.RxHelper
|
||||
import com.nnbc123.library.rxbus.RxBus
|
||||
import com.nnbc123.library.utils.FormatUtils
|
||||
import com.nnbc123.library.utils.JavaUtil
|
||||
import com.nnbc123.library.utils.SingleToastUtil
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||
import io.reactivex.SingleObserver
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
/**
|
||||
* 轰趴房
|
||||
* Created by 2016/9/22.
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
class HomePartyFragment : BaseFragment(), View.OnClickListener, OnShareDialogItemClick {
|
||||
private var roomFragment: Fragment? = null
|
||||
private val bgPicture = arrayOf("")
|
||||
private var mUserInfo: UserInfo? = null
|
||||
private var _binding: FragmentChatroomGameMainBinding? = null
|
||||
val binding get() = _binding!!
|
||||
private var shareDialog: ShareDialog? = null
|
||||
|
||||
|
||||
//收藏房间
|
||||
private var FOLLOW_ROOM_TYPE = ""
|
||||
private var gameAdapter: SelectGameAdapter? = null
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
// clear views
|
||||
binding.roomTitle.text = ""
|
||||
setRoomId(0, 0)
|
||||
updateOnlineNumberView(0)
|
||||
if (roomFragment is HomePartyRoomFragment) {
|
||||
(roomFragment as HomePartyRoomFragment).onNewIntent(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
|
||||
private fun setRoomId(id: Long, onlineNumber: Int) {
|
||||
val htmlText = "ID:$id"
|
||||
binding.roomId.text = htmlText
|
||||
}
|
||||
|
||||
override fun getRootLayoutId(): Int {
|
||||
return R.layout.fragment_chatroom_game_main
|
||||
}
|
||||
|
||||
override fun onFindViews() {
|
||||
_binding = DataBindingUtil.bind(mView)
|
||||
setupRoomTitleMarquee()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加跑马灯
|
||||
* 以及反射一些参数影响跑马灯
|
||||
*/
|
||||
private fun setupRoomTitleMarquee() {
|
||||
try {
|
||||
val configuration = ViewConfiguration.get(context)
|
||||
val claz: Class<*> = configuration.javaClass
|
||||
val field = claz.getDeclaredField("mFadingMarqueeEnabled")
|
||||
field.isAccessible = true
|
||||
field[configuration] = true
|
||||
} catch (e: NoSuchFieldException) {
|
||||
e.printStackTrace()
|
||||
} catch (e: IllegalArgumentException) {
|
||||
e.printStackTrace()
|
||||
} catch (e: IllegalAccessException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
binding.roomTitle.isSelected = true
|
||||
}
|
||||
|
||||
override fun onSetListener() {
|
||||
binding.roomMore.setOnClickListener(this)
|
||||
binding.tvFollowRoom.setOnClickListener(this)
|
||||
binding.llRoomInfo.setOnClickListener(this)
|
||||
binding.llRank.setOnClickListener(this)
|
||||
binding.iconRoomVip.setOnClickListener {
|
||||
VipMainActivity.start(mContext)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ROOM_CLICK, "贵族房间入口点击事件")
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
AvRoomDataManager.get().mCurrentRoomInfo ?: return
|
||||
if (!AvRoomDataManager.get().haveSelfChange) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect =
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.isHasAnimationEffect ?: false
|
||||
}
|
||||
}
|
||||
|
||||
private fun initRvGame() {
|
||||
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (roomInfo == null || gameAdapter != null) return
|
||||
binding.rvGame.layoutManager = LinearLayoutManager(mContext)
|
||||
binding.rvGame.adapter = SelectGameAdapter().also { gameAdapter = it }
|
||||
binding.llSelectGame.setOnClickListener { v: View? ->
|
||||
if (binding.rvGame.visibility == View.VISIBLE) {
|
||||
binding.rvGame.visibility = View.GONE
|
||||
binding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below)
|
||||
} else {
|
||||
if (!isShowChangeGame) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (AvRoomDataManager.get().isGamePlaying) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!")
|
||||
} else {
|
||||
binding.rvGame.visibility = View.VISIBLE
|
||||
binding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type)
|
||||
}
|
||||
}
|
||||
}
|
||||
gameAdapter?.setOnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, position: Int ->
|
||||
if (AvRoomDataManager.get().isGamePlaying) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!")
|
||||
}
|
||||
if (!isShowChangeGame) {
|
||||
SingleToastUtil.showToast("请关闭其他模式再切换游戏!")
|
||||
return@setOnItemClickListener
|
||||
}
|
||||
val gameInfo = gameAdapter?.getItem(position)
|
||||
if (gameInfo != null) {
|
||||
val type: Int
|
||||
var mgId: Long = 0
|
||||
if ("扩列交友" == gameInfo.name) {
|
||||
type = RoomInfo.ROOMTYPE_HOME_PARTY
|
||||
} else {
|
||||
type = RoomInfo.ROOMTYPE_GAME
|
||||
mgId = JavaUtil.str2long(gameInfo.mgId)
|
||||
}
|
||||
binding.rvGame.visibility = View.GONE
|
||||
binding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below)
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
baseActivity,
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
mgId,
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//这里的2和4是服务端定义的错误状态 关闭排麦模式和关闭PK模式!
|
||||
private val isShowChangeGame: Boolean
|
||||
get() = false
|
||||
/* RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
return currentRoomInfo != null &&
|
||||
AvRoomDataManager.get().isRoomOwner() &&
|
||||
currentRoomInfo.getIsPermitRoom() != 1 &&
|
||||
currentRoomInfo.getType() != RoomInfo.ROOM_TYPE_SINGLE &&
|
||||
(currentRoomInfo.getRoomModeType() == RoomModeType.NORMAL_MODE ||
|
||||
currentRoomInfo.getRoomModeType() == 2 ||
|
||||
currentRoomInfo.getRoomModeType() == 4);*/
|
||||
|
||||
fun setRoomBg(roomInfo: RoomInfo?) {
|
||||
if (_binding == null) return
|
||||
updateView(roomInfo)
|
||||
AVRoomActivity.setBackBg(mContext, roomInfo, binding.svgaImageViewBg, bgPicture)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
updateView(AvRoomDataManager.get().mCurrentRoomInfo)
|
||||
loadRoomRank()
|
||||
IMNetEaseManager.get().chatRoomEventObservable
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe { roomEvent: RoomEvent? ->
|
||||
if (roomEvent == null) return@subscribe
|
||||
when (roomEvent.event) {
|
||||
RoomEvent.ENTER_ROOM -> {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
updateOnlineNumberView(
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.onlineNum ?: 0
|
||||
)
|
||||
}
|
||||
addTipMsg()
|
||||
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo)
|
||||
}
|
||||
RoomEvent.ROOM_INFO_UPDATE -> setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo)
|
||||
RoomEvent.RECEIVE_NORMALE_GIFT -> onReceiveGiftMsg(roomEvent.giftReceiveInfo)
|
||||
RoomEvent.RECEIVE_MUTLT_NORMALEI_GIFT -> onReceiveMultiGiftMsg(roomEvent.giftMultiReceiverInfo)
|
||||
RoomEvent.RECEIVE_ALL_MIC__NORMALEI_GIFT -> onReceiveAllMicGiftMsg(roomEvent.multiGiftReceiveInfo)
|
||||
RoomEvent.RECEIVE_LUCKY_GIFT, RoomEvent.RECEIVE_MULTI_LUCKY_GIFT, RoomEvent.RECEIVE_ALL_MIC_LUCKY_GIFT -> onReceiveLuckyGiftToMultiMsg(
|
||||
roomEvent.luckygiftMultiReceiverInfo
|
||||
)
|
||||
RoomEvent.RECEIVED_SINGLE_MAGIC -> onReceiveMagicMsg(roomEvent.magicReceivedInfo)
|
||||
RoomEvent.RECEIVED_ALL_MIC_MAGIC -> onReceiveMultiMagicMsg(roomEvent.multiMagicReceivedInfo)
|
||||
RoomEvent.FANS_TEAM_JOIN -> onReceiveFansTeamJoinMsg(roomEvent.chatRoomMessage)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onReceiveLuckyGiftToMultiMsg(giftMultiReceiverInfo: LuckyBagGifts?) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveLuckyGiftToMultiMsg(giftMultiReceiverInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入房间时的提示信息
|
||||
*/
|
||||
private fun addTipMsg() {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().mCurrentRoomInfo?.isCloseScreen == true) {
|
||||
val attachment: MsgAttachment = RoomInfoAttachment(
|
||||
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO,
|
||||
CustomAttachment.CUSTOM_MSG_UPDATE_ROOM_INFO_CLOSE_SCREEN
|
||||
)
|
||||
val closeMsg = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
AvRoomDataManager.get().roomId.toString(),
|
||||
attachment
|
||||
)
|
||||
closeMsg.content = "管理员已关闭聊天公屏"
|
||||
IMNetEaseManager.get().addCloseScreenMessages(closeMsg)
|
||||
} else if (AvRoomDataManager.get().mCurrentRoomInfo != null && AvRoomDataManager.get().mCurrentRoomInfo?.isHasAnimationEffect != true) {
|
||||
val tipMessage = ChatRoomMessageBuilder.createTipMessage("")
|
||||
tipMessage.content = "礼物特效"
|
||||
IMNetEaseManager.get().addCloseScreenMessages(tipMessage)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setIdOnlineData() {
|
||||
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return
|
||||
UserModel.get().getUserInfo(roomInfo.uid).subscribe(object : SingleObserver<UserInfo> {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
mCompositeDisposable.add(d)
|
||||
}
|
||||
|
||||
override fun onSuccess(userInfo: UserInfo) {
|
||||
mUserInfo = userInfo
|
||||
setRoomId(userInfo.erbanNo, roomInfo.onlineNum)
|
||||
binding.ivGoodNumber.visibility =
|
||||
if (userInfo.isHasPrettyErbanNo) View.VISIBLE else View.GONE
|
||||
binding.ivRoomAvatar.loadAvatar(userInfo.avatar)
|
||||
binding.ivRoomAvatar.setOnClickListener {
|
||||
RxBus.get().post(ShowUserInfoDialogEvent(userInfo.uid.toString()))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
setRoomId(0, roomInfo.onlineNum)
|
||||
binding.ivGoodNumber.visibility = View.GONE
|
||||
}
|
||||
})
|
||||
binding.roomInfo = roomInfo
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun updateView(currentRoomInfo: RoomInfo?) {
|
||||
if (currentRoomInfo != null) {
|
||||
var tempFragment = roomFragment
|
||||
when (currentRoomInfo.type) {
|
||||
RoomInfo.ROOMTYPE_GAME -> if (tempFragment !is GameRoomFragment) {
|
||||
tempFragment = GameRoomFragment.newInstance()
|
||||
}
|
||||
RoomInfo.ROOM_TYPE_SINGLE -> if (tempFragment !is SingleRoomFragment) {
|
||||
tempFragment = SingleRoomFragment.newInstance()
|
||||
}
|
||||
else -> if (tempFragment !is HomePartyRoomFragment) {
|
||||
tempFragment = HomePartyRoomFragment.newInstance()
|
||||
}
|
||||
}
|
||||
if (tempFragment !== roomFragment) {
|
||||
roomFragment = tempFragment
|
||||
childFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(R.id.container, roomFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
binding.roomInfo = currentRoomInfo
|
||||
updateHasAnimationEffect()
|
||||
binding.roomTitle.text = RegexUtil.getPrintableString(currentRoomInfo.getTitle())
|
||||
if (!StringUtil.isEmpty(currentRoomInfo.getRoomPwd())) {
|
||||
binding.roomTitle.setCompoundDrawablesWithIntrinsicBounds(
|
||||
null, null,
|
||||
resources.getDrawable(R.drawable.icon_room_lock), null
|
||||
)
|
||||
} else {
|
||||
binding.roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
|
||||
}
|
||||
setupFollowRoom()
|
||||
FOLLOW_ROOM_TYPE = if (AvRoomDataManager.get().isRoomFans) "2" else "1"
|
||||
setIdOnlineData()
|
||||
if (isShowChangeGame) {
|
||||
initRvGame()
|
||||
binding.llChangeGame.visibility = View.VISIBLE
|
||||
if (AvRoomDataManager.get().isOpenGame) {
|
||||
binding.tvCurrGame.text = currentRoomInfo.mgName
|
||||
} else {
|
||||
binding.tvCurrGame.text = "扩列交友"
|
||||
}
|
||||
getGameList()
|
||||
.compose(bindToLifecycle())
|
||||
.map { it.toMutableList() }
|
||||
.subscribe { gameInfos: MutableList<GameInfo> ->
|
||||
if (AvRoomDataManager.get().isOpenGame) {
|
||||
for (i in gameInfos.indices) {
|
||||
val (_, mgId) = gameInfos[i]
|
||||
if (JavaUtil.str2long(mgId) == currentRoomInfo.mgId) {
|
||||
gameInfos.removeAt(i)
|
||||
break
|
||||
}
|
||||
}
|
||||
val gameInfo = GameInfo()
|
||||
gameInfo.name = "扩列交友"
|
||||
gameInfos.add(gameInfo)
|
||||
}
|
||||
gameAdapter?.setNewData(gameInfos)
|
||||
}
|
||||
} else {
|
||||
binding.llChangeGame.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateHasAnimationEffect() {
|
||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
AvRoomDataManager.get().mIsNeedGiftEffect =
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.isHasAnimationEffect ?: false
|
||||
}
|
||||
binding.hasAnimationEffect = AvRoomDataManager.get().mIsNeedGiftEffect
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新特效开关提示
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun updateHasAnimation(event: HasAnimationEffect?) {
|
||||
updateHasAnimationEffect()
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.room_more -> newInstance((requireActivity() as AVRoomActivity))
|
||||
.showAtLocation(binding.root, Gravity.END, 0, 0)
|
||||
R.id.ll_room_info -> {
|
||||
RoomOnlineUserActivity.start(activity)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_ONLINE_LIST_CLICK, "房间在线列表点击")
|
||||
}
|
||||
R.id.tv_follow_room -> followRoom()
|
||||
R.id.iv_back -> {
|
||||
if (activity is AVRoomActivity) {
|
||||
requireActivity().onBackPressed()
|
||||
}
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_RETURN_CLICK, "房间返回按钮点击")
|
||||
}
|
||||
R.id.ll_rank -> {
|
||||
DialogWebViewActivity.start(mContext, UriProvider.getRoomRanking())
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_MP_ROOM_RANKING_LIST_CLICK, "房间榜")
|
||||
loadRoomRank()
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun dismissSendRedPackageDialog() {
|
||||
if (roomFragment is BaseRoomFragment<*, *>) {
|
||||
(roomFragment as BaseRoomFragment<*, *>).clearDialog()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏房间
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private fun followRoom() {
|
||||
val currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return
|
||||
val arguments: MutableMap<String, String> = HashMap()
|
||||
arguments["room_id"] = (mUserInfo?.erbanNo ?: currentRoomInfo.uid).toString()
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_COLLECT_ICON_CLICK, "语音房_收藏顶部按钮", arguments)
|
||||
CollectionRoomModel.get().followRoom(FOLLOW_ROOM_TYPE, currentRoomInfo.uid)
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doOnError { throwable: Throwable -> toast(throwable.message) }
|
||||
.subscribe { s: String? ->
|
||||
AvRoomDataManager.get().isRoomFans = !AvRoomDataManager.get().isRoomFans
|
||||
FOLLOW_ROOM_TYPE = if (AvRoomDataManager.get().isRoomFans) "2" else "1"
|
||||
setupFollowRoom()
|
||||
if (AvRoomDataManager.get().isRoomFans) {
|
||||
SingleToastUtil.showToast("收藏成功!")
|
||||
PraiseModel.get().setFollowRoomSuccessRoomTip(currentRoomInfo.uid)
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_FOLLOW_BUTTON_CLICK, "语音房_收藏顶部按钮")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun loadRoomRank() {
|
||||
val type =
|
||||
if (AvRoomDataManager.get().isSingleRoom) {
|
||||
RoomContributeDataInfo.TYPE_ROOM_WEEK_RANKING
|
||||
} else {
|
||||
RoomContributeDataInfo.TYPE_ROOM_DAY_RANKING
|
||||
}
|
||||
RoomContributeListModel.get().getSingleRoomRanking(1, type)
|
||||
.compose(bindToLifecycle())
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.subscribe { roomContributeDataInfo: RoomContributeDataInfo ->
|
||||
updateRoomRanks(roomContributeDataInfo.rankings)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateRoomRanks(data: List<RoomContributeUserInfo>) {
|
||||
val avatarList = arrayListOf(
|
||||
binding.ivRank0,
|
||||
binding.ivRank1,
|
||||
binding.ivRank2
|
||||
)
|
||||
val stvList = arrayListOf(
|
||||
binding.stvRank0,
|
||||
binding.stvRank1,
|
||||
binding.stvRank2
|
||||
)
|
||||
for (i in 0 until avatarList.size) {
|
||||
avatarList[i].loadAvatar(data.getOrNull(i)?.avatar)
|
||||
stvList[i].text = FormatUtils.formatRankValue(data.getOrNull(i)?.goldAmount ?: 0)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFollowRoomEvent(event: FollowRoomEvent?) {
|
||||
setupFollowRoom()
|
||||
}
|
||||
|
||||
private fun setupFollowRoom() {
|
||||
binding.tvFollowRoom.visibility =
|
||||
if (AvRoomDataManager.get().isRoomFans || AvRoomDataManager.get().isRoomOwner) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onShareRoomEvent(event: ShareRoomEvent?) {
|
||||
shareRoom()
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享房间
|
||||
*/
|
||||
private fun shareRoom() {
|
||||
if (shareDialog?.isShowing == true) {
|
||||
shareDialog?.dismiss()
|
||||
}
|
||||
shareDialog = ShareDialog(activity)
|
||||
shareDialog?.setOnShareDialogItemClick(this)
|
||||
shareDialog?.show()
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_SHARE_CLICK, "语音房_分享")
|
||||
}
|
||||
|
||||
override fun onInAppSharingItemClick() {
|
||||
shareDialog?.dismiss()
|
||||
SelectFriendActivity.startForSharingRoom(activity)
|
||||
}
|
||||
|
||||
override fun onSharePlatformClick(platform: Platform) {
|
||||
val currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (currentRoomInfo != null) {
|
||||
UserModel.get().getUserInfo(currentRoomInfo.uid)
|
||||
.flatMap { userInfo: UserInfo ->
|
||||
ShareModel.get().shareRoom(
|
||||
platform,
|
||||
currentRoomInfo.uid,
|
||||
userInfo.erbanNo,
|
||||
currentRoomInfo.getTitle(),
|
||||
currentRoomInfo.avatar
|
||||
)
|
||||
}
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY))
|
||||
.doAfterTerminate { dialogManager.dismissDialog() }
|
||||
.subscribe(object : SingleObserver<String> {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onSuccess(s: String) {
|
||||
toast(s)
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
toast(e.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
EventBus.getDefault().unregister(this)
|
||||
binding.vsGiftView.release()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
roomFragment?.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
||||
fun onRoomOnlineNumberSuccess(onlineNumber: Int) {
|
||||
updateOnlineNumberView(onlineNumber)
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通多人
|
||||
*
|
||||
* @param giftMultiReceiverInfo
|
||||
*/
|
||||
private fun onReceiveMultiGiftMsg(giftMultiReceiverInfo: GiftMultiReceiverInfo?) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveGiftToMultiMsg(giftMultiReceiverInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通全麦
|
||||
*
|
||||
* @param multiGiftReceiveInfo
|
||||
*/
|
||||
private fun onReceiveAllMicGiftMsg(multiGiftReceiveInfo: MultiGiftReceiveInfo?) {
|
||||
if (multiGiftReceiveInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveMultiGiftMsg(multiGiftReceiveInfo)
|
||||
}
|
||||
|
||||
private fun onReceiveGiftMsg(giftReceiveInfo: GiftReceiveInfo?) {
|
||||
if (giftReceiveInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveGiftMsg(giftReceiveInfo)
|
||||
}
|
||||
|
||||
private fun onReceiveMagicMsg(magicReceivedInfo: MagicReceivedInfo?) {
|
||||
if (magicReceivedInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveMagicMsg(magicReceivedInfo)
|
||||
}
|
||||
|
||||
private fun onReceiveMultiMagicMsg(multiMagicReceivedInfo: MultiMagicReceivedInfo?) {
|
||||
if (multiMagicReceivedInfo == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo)
|
||||
}
|
||||
|
||||
private fun onReceiveFansTeamJoinMsg(message: ChatRoomMessage?) {
|
||||
if (message == null || !isResumed) return
|
||||
binding.vsGiftView.onReceiveFansTeamOpenMsg(message)
|
||||
}
|
||||
|
||||
private fun updateOnlineNumberView(onlineNumber: Int) {
|
||||
var onlineNumber = onlineNumber
|
||||
if (!SuperAdminUtil.isSuperAdmin()) {
|
||||
if (onlineNumber < 1) {
|
||||
onlineNumber = 1
|
||||
}
|
||||
}
|
||||
binding.roomNums.text = "在线$onlineNumber"
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun newInstance(): HomePartyFragment {
|
||||
val homePartyFragment = HomePartyFragment()
|
||||
val bundle = Bundle()
|
||||
homePartyFragment.arguments = bundle
|
||||
return homePartyFragment
|
||||
}
|
||||
}
|
||||
}
|
@@ -611,6 +611,9 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_RANKLIST_CLICK, "房间小时榜点击");
|
||||
break;
|
||||
case R.id.tv_notice_board:
|
||||
onRoomSettingsClick();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -789,7 +792,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
|
||||
private void hideKtvRelaView() {
|
||||
gameBinding.setKtvModel(false);
|
||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||
changeModelShowView();
|
||||
gameBinding.bottomView.showKtvBottom(false);
|
||||
}
|
||||
|
@@ -21,18 +21,18 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.nnbc123.core.DemoCache;
|
||||
import com.nnbc123.app.avroom.dialog.RoomPlayDialog;
|
||||
import com.nnbc123.app.treasure_box.widget.GoldBoxHelper;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.netease.nimlib.sdk.msg.model.RecentContact;
|
||||
import com.netease.nimlib.sdk.uinfo.model.UserInfo;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.avroom.BottomViewListenerWrapper;
|
||||
import com.nnbc123.app.avroom.dialog.RoomPlayDialog;
|
||||
import com.nnbc123.app.room_chat.activity.RoomMsgActivity;
|
||||
import com.nnbc123.app.treasure_box.widget.GoldBoxHelper;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.vip.VipMainActivity;
|
||||
import com.nnbc123.app.room_chat.activity.RoomMsgActivity;
|
||||
import com.nnbc123.core.DemoCache;
|
||||
import com.nnbc123.core.helper.ImHelperUtils;
|
||||
import com.nnbc123.core.manager.AvRoomDataManager;
|
||||
import com.nnbc123.core.manager.IMMessageManager;
|
||||
@@ -69,15 +69,12 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
|
||||
private BottomViewListenerWrapper wrapper;
|
||||
private ImageView openMic;
|
||||
private ImageView sendMsg;
|
||||
private TextView sendMsgInput;
|
||||
private LinearLayout llSendMsg;
|
||||
private ImageView sendGift;
|
||||
private ImageView sendMagic;
|
||||
private ImageView sendFace;
|
||||
|
||||
private ImageView remoteMute;
|
||||
private LinearLayout faceLayout;
|
||||
private LinearLayout micLayout;
|
||||
private ImageView iconMicQueue;
|
||||
private ImageView iconRoomMsg;
|
||||
@@ -113,14 +110,11 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
private void init() {
|
||||
inflate(getContext(), R.layout.layout_bottom_view, this);
|
||||
openMic = findViewById(R.id.icon_room_open_mic);
|
||||
sendMsg = findViewById(R.id.icon_room_send_msg);
|
||||
sendMsgInput = findViewById(R.id.tv_room_send_msg_input);
|
||||
llSendMsg = findViewById(R.id.ll_send_msg);
|
||||
sendFace = findViewById(R.id.icon_room_face);
|
||||
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);
|
||||
faceLayout = findViewById(R.id.room_face_layout);
|
||||
micLayout = findViewById(R.id.room_mic_layout);
|
||||
|
||||
iconMicQueue = findViewById(R.id.icon_mic_queue);
|
||||
@@ -129,7 +123,6 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
iconVip = findViewById(R.id.icon_room_vip);
|
||||
iconPlay = findViewById(R.id.icon_room_play);
|
||||
openMic.setOnClickListener(this);
|
||||
sendMsg.setOnClickListener(this);
|
||||
sendMsgInput.setOnClickListener(this);
|
||||
sendFace.setOnClickListener(this);
|
||||
sendGift.setOnClickListener(this);
|
||||
@@ -149,7 +142,6 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
sendGift.setVisibility(GONE);
|
||||
sendMsgInput.setVisibility(GONE);
|
||||
llSendMsg.setVisibility(GONE);
|
||||
}
|
||||
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
@@ -248,22 +240,22 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
}
|
||||
|
||||
public void showHomePartyUpMicBottom() {
|
||||
faceLayout.setVisibility(VISIBLE);
|
||||
sendFace.setVisibility(VISIBLE);
|
||||
micLayout.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
public void showHomePartyDownMicBottom() {
|
||||
faceLayout.setVisibility(GONE);
|
||||
sendFace.setVisibility(GONE);
|
||||
micLayout.setVisibility(GONE);
|
||||
}
|
||||
|
||||
public void showLightChatUpMicBottom() {
|
||||
faceLayout.setVisibility(GONE);
|
||||
sendFace.setVisibility(GONE);
|
||||
micLayout.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
public void showLightChatDownMicBottom() {
|
||||
faceLayout.setVisibility(GONE);
|
||||
sendFace.setVisibility(GONE);
|
||||
micLayout.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@@ -306,7 +298,6 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
break;
|
||||
|
||||
case R.id.tv_room_send_msg_input:
|
||||
case R.id.icon_room_send_msg:
|
||||
if (wrapper != null) {
|
||||
wrapper.onSendMsgBtnClick();
|
||||
}
|
||||
@@ -364,14 +355,6 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void showInputOrIcon(boolean isIcon) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
return;
|
||||
}
|
||||
sendMsgInput.setVisibility(isIcon ? GONE : VISIBLE);
|
||||
llSendMsg.setVisibility(isIcon ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
private void dismissMsgPopupWindow() {
|
||||
if (msgTipPopupWindow != null) {
|
||||
try {
|
||||
|
@@ -275,8 +275,8 @@ public class MessageView extends FrameLayout {
|
||||
greyColor = ContextCompat.getColor(context, R.color.white_transparent_50);
|
||||
roomTipNickColor = ContextCompat.getColor(context, R.color.color_ffbc51);
|
||||
roomTipColor = ContextCompat.getColor(context, R.color.color_ffbc51);
|
||||
paddingWidth = Utils.dip2px(context, 11);
|
||||
paddingHeight = Utils.dip2px(context, 6);
|
||||
paddingWidth = Utils.dip2px(context, 10);
|
||||
paddingHeight = Utils.dip2px(context, 8);
|
||||
badgeWidth = Utils.dip2px(context, 15);
|
||||
badgeHeight = Utils.dip2px(context, 15);
|
||||
sysIconHeight = Utils.dip2px(context, 14);
|
||||
@@ -766,8 +766,9 @@ public class MessageView extends FrameLayout {
|
||||
tvContent.setTextColor(ContextCompat.getColor(mContext, R.color.color_fe5d7f));
|
||||
tvContent.setText(contentText);
|
||||
} else {
|
||||
tvContent.setTextColor(roomTipNickColor);
|
||||
tvContent.setTextColor(Color.parseColor("#05FFE3"));
|
||||
tvContent.setText(chatRoomMessage.getContent());
|
||||
tvContent.setBackgroundResource(R.drawable.shape_room_message_bg_tips);
|
||||
}
|
||||
} else if (chatRoomMessage.getMsgType() == MsgTypeEnum.text) {
|
||||
setMsgText(chatRoomMessage, tvContent);
|
||||
|
Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 586 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_notice_board.png
Normal file
After Width: | Height: | Size: 910 B |
BIN
app/src/main/res/drawable-xhdpi/ic_room_rank0.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_room_rank1.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_room_rank2.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 338 B |
5
app/src/main/res/drawable/shape_67d7d7_corner.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="100dp" />
|
||||
<solid android:color="#67D7D7" />
|
||||
</shape>
|
10
app/src/main/res/drawable/shape_room_message_bg_tips.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#4d9dfcef" />
|
||||
<corners
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="8dp"
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="8dp" />
|
||||
</shape>
|
@@ -37,106 +37,126 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:scaleType="center"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@drawable/arrow_left_white" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_room_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/shape_white_alpha_10_radius_100"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="7dp">
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/iv_room_avatar"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_title"
|
||||
android:id="@+id/ll_room_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
android:layout_marginStart="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.nnbc123.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_title"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:drawablePadding="5dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:maxWidth="150dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
tools:text="和你一起分享" />
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_high_audio"
|
||||
<com.nnbc123.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:drawablePadding="5dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:maxWidth="80dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
tools:text="和你和你一起分享和你一起分享和你一起分享一起分享" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_high_audio"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:src="@drawable/ic_high_audio"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_close_gift"
|
||||
android:visibility="@{hasAnimationEffect?View.GONE:View.VISIBLE}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:src="@drawable/ic_high_audio"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_close_gift"
|
||||
android:visibility="@{hasAnimationEffect?View.GONE:View.VISIBLE}" />
|
||||
<com.nnbc123.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="10sp"
|
||||
tools:text="ID:8888" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@drawable/icon_room_good_number"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="3dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/shape_circle_3efed7" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_nums"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="在线:8888" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_good_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:src="@drawable/icon_room_good_number"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="3dp"
|
||||
android:layout_height="3dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/shape_circle_3efed7" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_nums"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="在线:8888" />
|
||||
|
||||
<com.nnbc123.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="10sp"
|
||||
tools:text="ID:8888" />
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_follow_room"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="20dp"
|
||||
android:background="@drawable/shape_67d7d7_corner"
|
||||
android:gravity="center"
|
||||
android:text="收藏"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -145,6 +165,123 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_vip"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_vip_room_bottom" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="35dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_0"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<View
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="33dp"
|
||||
android:background="@drawable/ic_room_rank0" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_rank0"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="#8E461A"
|
||||
android:textSize="7dp"
|
||||
app:corner="10dp"
|
||||
app:solid="#F5CD57" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="35dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_1"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<View
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="33dp"
|
||||
android:background="@drawable/ic_room_rank1" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_rank1"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="#2E527A"
|
||||
android:textSize="7dp"
|
||||
app:corner="10dp"
|
||||
app:solid="#91C8FA" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_2"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<View
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="33dp"
|
||||
android:background="@drawable/ic_room_rank2" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/stv_rank2"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="#824B2C"
|
||||
android:textSize="7dp"
|
||||
app:corner="10dp"
|
||||
app:solid="#F0A47B" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_change_game"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -158,7 +295,7 @@
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
tools:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_select_game"
|
||||
@@ -195,31 +332,22 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_follow_room"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/icon_room_like" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/room_more"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="13dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/icon_room_more" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ViewStub
|
||||
<com.nnbc123.app.avroom.widget.GiftV2View
|
||||
android:id="@+id/vs_gift_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout="@layout/common_gift2_view_layout"
|
||||
tools:visibility="gone" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.nnbc123.app.avroom.widget.RoomEffectView
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -220,6 +220,7 @@
|
||||
android:gravity="center"
|
||||
android:maxLength="15"
|
||||
android:maxLines="1"
|
||||
android:visibility="gone"
|
||||
android:text="@string/room_manager_edit_desc"
|
||||
android:textColor="#7FFFFFFF"
|
||||
android:textSize="@dimen/sp_11"
|
||||
@@ -230,6 +231,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="4.5dp"
|
||||
android:src="@drawable/icon_room_desc_edit" />
|
||||
|
||||
|
@@ -326,6 +326,7 @@
|
||||
android:gravity="center"
|
||||
android:maxLength="15"
|
||||
android:maxLines="1"
|
||||
android:visibility="gone"
|
||||
android:text="@string/room_manager_edit_desc"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/sp_11"
|
||||
|
@@ -1,145 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal"
|
||||
tools:background="@color/blue">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="65dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="102dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:background="@drawable/bg_room_msg_input"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_send_msg_input"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:background="@color/blue">
|
||||
android:paddingStart="12dp"
|
||||
android:text="聊一聊~"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="0dp" />
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_face"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_face_btn" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_send_msg_input"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_room_msg_input"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="13dp"
|
||||
android:text="说点什么..."
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14dp"
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_send_msg"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center">
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_send_msg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_send_msg" />
|
||||
<LinearLayout
|
||||
android:id="@+id/room_mic_layout"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:gravity="center">
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_open_mic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_open_mic" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/room_mic_layout"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:gravity="center">
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_open_mic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_open_mic" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_open_remote_mic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_remote_mute_close" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_open_remote_mic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_remote_mute_close" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/icon_mic_queue"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_mic_queue" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/room_face_layout"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:gravity="center">
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_message"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_room_message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_face"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_face_btn" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_send_magic"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_send_magic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_mic_queue"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_mic_queue" />
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_play"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_room_bottom_play"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_room_message"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_room_message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_send_magic"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_send_magic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_play"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_room_bottom_play"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_vip"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_vip_room_bottom" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_vip"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_vip_room_bottom"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_send_gift"
|
||||
@@ -147,8 +121,11 @@
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="15dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_room_send_gift" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:orientation="horizontal"
|
||||
tools:background="#ff0">
|
||||
|
||||
@@ -10,14 +11,13 @@
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_userinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="7dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@@ -19,12 +19,13 @@
|
||||
type="Boolean" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginTop="95dp"
|
||||
android:clipChildren="false">
|
||||
|
||||
<com.nnbc123.app.avroom.widget.MicroView
|
||||
@@ -33,58 +34,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contribute_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignTop="@id/micro_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="@drawable/bg_contribute_entrance"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_0"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_1"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_2"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="-12dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:includeFontPadding="false"
|
||||
android:text="房间榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_right_white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/pager_view_wish_list"
|
||||
android:layout_width="80dp"
|
||||
@@ -95,18 +44,37 @@
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/tv_notice_board"
|
||||
android:layout_width="57dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_alignTop="@id/contribute_list"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/bg_single_room_rank_entrance"
|
||||
android:background="@drawable/shape_white_alpha_10_radius_100"
|
||||
android:drawableStart="@drawable/ic_notice_board"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:text="公告"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10dp"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hour_rank"
|
||||
android:layout_width="57dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_below="@id/tv_notice_board"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/shape_white_alpha_10_radius_100"
|
||||
android:drawableStart="@drawable/ic_single_room_rank"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:onClick="@{click}"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:text="小时榜"
|
||||
android:textColor="@color/white"
|
||||
@@ -366,6 +334,7 @@
|
||||
tools:contentDescription="PK记分板" />
|
||||
|
||||
<com.nnbc123.app.avroom.anotherroompk.RoomPKBoardView
|
||||
android:id="@+id/layout_single_room_pk_board"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/micro_view"
|
||||
@@ -430,4 +399,5 @@
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
@@ -30,51 +30,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/contribute_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:background="@drawable/bg_contribute_entrance"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_0"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_1"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_rank_2"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="房间榜"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_right_white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -276,7 +276,7 @@ public class PullRadishActivity extends BaseBindingActivity<ActivityPullRadishBi
|
||||
*/
|
||||
private void changeKeyNum(int num) {
|
||||
keyNum = num;
|
||||
mBinding.tvKeyNum.setText(keyNum + "");
|
||||
mBinding.tvKeyNum.setText("持有燃料:" + keyNum);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -47,10 +47,10 @@
|
||||
android:onClick="@{click}"
|
||||
app:autoPlay="false"
|
||||
app:fillMode="Clear"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="750:1030"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_ship"
|
||||
app:layout_constraintDimensionRatio="750:725"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_ship"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_ship"
|
||||
app:loopCount="1"
|
||||
app:source="svga/pull_radish_bg.svga" />
|
||||
|
||||
@@ -100,14 +100,12 @@
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_get_key"
|
||||
android:id="@+id/iv_history"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/pull_radish_get_meteor"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_rank"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_rank" />
|
||||
android:src="@drawable/pull_radish_history" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -124,14 +122,12 @@
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_history"
|
||||
android:id="@+id/iv_get_key"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/pull_radish_history"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_rank"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_get_key" />
|
||||
android:src="@drawable/pull_radish_get_meteor" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -154,9 +150,7 @@
|
||||
android:layout_marginTop="7dp"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/pull_radish_more"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_rank"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_history" />
|
||||
android:src="@drawable/pull_radish_more" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.nnbc123.library.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
@@ -112,5 +113,17 @@ public class FormatUtils {
|
||||
// if (value >= 1000000) return (value / 100) / 100f + "万";
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static String formatRankValue(int goldAmount){
|
||||
String strGoldAmount;
|
||||
if (goldAmount >= 10000) {
|
||||
BigDecimal b = BigDecimal.valueOf(goldAmount / 10000.0);
|
||||
double df = b.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
strGoldAmount = df + "万";
|
||||
} else {
|
||||
strGoldAmount = String.valueOf(goldAmount);
|
||||
}
|
||||
return strGoldAmount;
|
||||
}
|
||||
|
||||
}
|
||||
|