1、修改包的图片
2、修改房间的所有进出方式
This commit is contained in:
@@ -14,14 +14,20 @@
|
||||
|
||||
<activity
|
||||
android:name=".activity.RoomActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:theme="@style/TransparentActivityTheme"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true"
|
||||
/>
|
||||
<!-- <activity-->
|
||||
<!-- android:name=".activity.RoomActivity"-->
|
||||
<!-- android:launchMode="singleInstancePerTask"-->
|
||||
<!-- android:windowSoftInputMode="adjustPan"-->
|
||||
<!-- android:enableOnBackInvokedCallback="false"-->
|
||||
<!-- android:theme="@style/TransparentActivityTheme"-->
|
||||
<!-- android:configChanges="orientation|screenSize|keyboardHidden"-->
|
||||
<!-- android:screenOrientation="portrait"-->
|
||||
<!-- android:exported="true"-->
|
||||
<!-- />-->
|
||||
|
||||
<service
|
||||
android:name=".service.MediaProjectionService"
|
||||
|
||||
@@ -5,6 +5,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import static com.blankj.utilcode.util.SnackbarUtils.getView;
|
||||
import static com.liulishuo.okdownload.OkDownloadProvider.context;
|
||||
|
||||
import android.Manifest;
|
||||
@@ -21,6 +22,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
@@ -53,11 +55,13 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ThreadUtils;
|
||||
@@ -77,21 +81,16 @@ import com.example.moduleroom.dialog.RoomOnlineDialogFragment;
|
||||
import com.example.moduleroom.dialog.RoomPkDialogFragment;
|
||||
import com.example.moduleroom.dialog.RoomSettingFragment;
|
||||
import com.example.moduleroom.dialog.SoundEffectsDialogFragment;
|
||||
import com.example.moduleroom.fragment.FriendshipRoomFragment;
|
||||
import com.example.moduleroom.fragment.PublicScreenEaseChatFragment;
|
||||
import com.example.moduleroom.fragment.RoomAuctionFragment;
|
||||
import com.example.moduleroom.fragment.RoomCabinFragment;
|
||||
import com.example.moduleroom.fragment.RoomChartsFragment;
|
||||
import com.example.moduleroom.fragment.RoomKtvFragment;
|
||||
import com.example.moduleroom.fragment.RoomNoticeDialogFragment;
|
||||
import com.example.moduleroom.fragment.SingSongFragment;
|
||||
import com.petterp.floatingx.assist.helper.FxScopeHelper;
|
||||
import com.petterp.floatingx.listener.control.IFxControl;
|
||||
import com.tencent.imsdk.v2.V2TIMValueCallback;
|
||||
import com.tencent.qgame.animplayer.AnimConfig;
|
||||
import com.tencent.qgame.animplayer.inter.IAnimListener;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.GiftAvatarBean;
|
||||
import com.xscm.moduleutil.bean.GiftBean;
|
||||
import com.xscm.moduleutil.bean.HeadlineBean;
|
||||
import com.xscm.moduleutil.bean.RoomInputEvent;
|
||||
@@ -166,10 +165,8 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -243,11 +240,15 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
// 必须调用 setIntent 来更新 Activity 的 Intent
|
||||
setIntent(intent);
|
||||
|
||||
password = intent.getStringExtra("password");
|
||||
String mRoomId = intent.getStringExtra("roomId");
|
||||
|
||||
if (roomId.equals(mRoomId) || TextUtils.isEmpty(mRoomId)) {
|
||||
super.onNewIntent(intent);
|
||||
// super.onNewIntent(intent);
|
||||
sDestroied = false;
|
||||
// MvpPre.getRoomIn(roomId, password);
|
||||
// MvpPre.getRoomOnline(roomId, "1", "10");
|
||||
@@ -328,10 +329,19 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
ViewParent parent = mBinding.svgaGift.getParent();
|
||||
if (parent instanceof ViewGroup) {
|
||||
ViewGroup parentViewGroup = (ViewGroup) parent;
|
||||
// 检查 bgEffectView 是否已经有父视图
|
||||
ViewParent currentParent = bgEffectView.getParent();
|
||||
if (currentParent != null && currentParent instanceof ViewGroup) {
|
||||
// 如果已经有父视图,先从父视图中移除
|
||||
((ViewGroup) currentParent).removeView(bgEffectView);
|
||||
}
|
||||
|
||||
// 将 bgEffectView 添加到父容器中,位置在 mBinding.svgaGift 之后
|
||||
int index = parentViewGroup.indexOfChild(mBinding.svgaGift);
|
||||
parentViewGroup.addView(bgEffectView);
|
||||
// 确保 bgEffectView 不为 null 并且没有父视图后再添加
|
||||
if (bgEffectView != null) {
|
||||
// 将 bgEffectView 添加为 mBinding.svgaGift 的兄弟视图
|
||||
// 添加到 mBinding.svgaGift 的父容器中,位置在 mBinding.svgaGift 之前
|
||||
parentViewGroup.addView(bgEffectView, parentViewGroup.indexOfChild(mBinding.svgaGift));
|
||||
}
|
||||
|
||||
// 设置布局参数 - 填满父视图
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||
@@ -373,7 +383,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
// 拦截返回键,显示退出对话框而不是直接退出
|
||||
showExitRoomDialog();
|
||||
return true;
|
||||
@@ -455,7 +465,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
ARouter.getInstance().build(ARouteConstants.ME)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
.navigation();
|
||||
// moveTaskToBack(true);
|
||||
|
||||
@@ -469,7 +478,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
|
||||
// 真正退出房间
|
||||
performExitRoom();
|
||||
performExitRoom(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -549,9 +558,11 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// EMqttService.cleanSubscribeRoom(roomId);
|
||||
CommonAppContext.getInstance().isPlaying = false;
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
// cleanupResources();
|
||||
cleanupResources();
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
// 在super.onCreate之前设置主题以避免闪白屏
|
||||
@@ -561,6 +572,15 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
sDestroied = false;
|
||||
// // 进入房间10s后检查是否显示提示上麦对话框
|
||||
|
||||
// if (SpUtil.getMyRoomId() != null && !SpUtil.getMyRoomId().equals(roomId)) {
|
||||
//
|
||||
// MvpPre.quitRoom(SpUtil.getMyRoomId(), SpUtil.getUserId() + "");
|
||||
// QXGiftPlayerManager.getInstance(this).destroyEffectSvga();
|
||||
// }
|
||||
|
||||
|
||||
// 初始化数据库
|
||||
|
||||
isSave = false;
|
||||
sDestroied = false;
|
||||
isMinimized = false;
|
||||
@@ -585,10 +605,34 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
|
||||
// 使用新的 OnBackPressedDispatcher API 来处理返回事件
|
||||
if (getOnBackPressedDispatcher() != null) {
|
||||
getOnBackPressedDispatcher().addCallback(this, new androidx.activity.OnBackPressedCallback(true) {
|
||||
@Override
|
||||
public void handleOnBackPressed() {
|
||||
// 拦截返回键,显示退出对话框而不是直接退出
|
||||
showExitRoomDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
// private void registerGiftPlaybackListener() {
|
||||
// // 获取 GiftAnimView 单例实例
|
||||
// GiftAnimView giftAnimView = QXGiftPlayerManager.getInstance(this).getDefaultFullEffectView();
|
||||
// if (giftAnimView != null) {
|
||||
// giftAnimView.addOnPlaybackCompleteListener(giftPlaybackListener);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// private void unregisterGiftPlaybackListener() {
|
||||
// // 获取 GiftAnimView 单例实例
|
||||
// GiftAnimView giftAnimView = QXGiftPlayerManager.getInstance(this).getDefaultChatEffectView();
|
||||
// if (giftAnimView != null) {
|
||||
// giftAnimView.removeOnPlaybackCompleteListener(giftPlaybackListener);
|
||||
// }
|
||||
// }
|
||||
private void checkAndRestoreMinimizeState() {
|
||||
SharedPreferences prefs = getSharedPreferences("room_minimize_state", Context.MODE_PRIVATE);
|
||||
boolean isMinimized = prefs.getBoolean("is_minimized", false);
|
||||
@@ -861,42 +905,55 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
// 设置横屏
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
// 找到 fl_screenshare 并移到全屏容器中
|
||||
FrameLayout fl_screenshare = findViewById(R.id.fl_screenshare);
|
||||
if (fl_screenshare != null) {
|
||||
// // 先从当前父容器中移除
|
||||
// ViewParent parent = fl_screenshare.getParent();
|
||||
// if (parent != null && parent instanceof ViewGroup) {
|
||||
// ((ViewGroup) parent).removeView(fl_screenshare);
|
||||
// }
|
||||
//
|
||||
// // 添加到全屏容器
|
||||
// fullScreenContainer.addView(fl_screenshare);
|
||||
|
||||
// 将原来的 fl_screenshare 移动到全屏容器中
|
||||
FrameLayout container = floatingMagnetView.findViewById(R.id.fl_screenshare);
|
||||
if (container.getParent() != null) {
|
||||
((ViewGroup) container.getParent()).removeView(container);
|
||||
}
|
||||
fullScreenContainer.addView(container);
|
||||
|
||||
// 显示全屏容器
|
||||
fullScreenContainer.setVisibility(View.VISIBLE);
|
||||
safelyMoveViewToParent(fl_screenshare, floatingMagnetView);
|
||||
// 显示全屏容器
|
||||
fullScreenContainer.setVisibility(View.VISIBLE);
|
||||
// floatingMagnetView.setVisibility(View.GONE);
|
||||
ivExitFullscreen.setVisibility(View.VISIBLE); // 显示退出按钮
|
||||
ivExitFullscreen.setVisibility(View.VISIBLE); // 显示退出按钮
|
||||
}
|
||||
}
|
||||
|
||||
private void exitFullScreen() {
|
||||
isFullScreen = false;
|
||||
// 恢复系统UI
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||
// decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
);
|
||||
// 设置回竖屏
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
|
||||
// 找到 fl_screenshare 并移回原父容器
|
||||
FrameLayout fl_screenshare = findViewById(R.id.fl_screenshare);
|
||||
if (fl_screenshare != null) {
|
||||
ViewParent parent = fl_screenshare.getParent();
|
||||
if (parent != null && parent instanceof ViewGroup) {
|
||||
((ViewGroup) parent).removeView(fl_screenshare);
|
||||
}
|
||||
|
||||
safelyMoveViewToParent(fl_screenshare, fullScreenContainer);
|
||||
// ViewParent parent = fl_screenshare.getParent();
|
||||
// if (parent instanceof ViewGroup) {
|
||||
// ((ViewGroup) parent).removeView(fl_screenshare);
|
||||
// }
|
||||
// // 添加到全屏容器
|
||||
// fullScreenContainer.addView(fl_screenshare);
|
||||
// 找到原始父容器并重新添加
|
||||
FrameLayout originalParent = findViewById(R.id.fullscreen_container); // 或者你实际的容器
|
||||
if (originalParent != null) {
|
||||
originalParent.removeView(fl_screenshare); // 防止重复添加
|
||||
}
|
||||
// FrameLayout originalParent = findViewById(R.id.fullscreen_container); // 或者你实际的容器
|
||||
// if (originalParent != null) {
|
||||
// originalParent.removeView(fl_screenshare); // 防止重复添加
|
||||
// }
|
||||
|
||||
floatingMagnetView.addView(fl_screenshare);
|
||||
// floatingMagnetView.addView(fl_screenshare);
|
||||
}
|
||||
// 恢复界面
|
||||
fullScreenContainer.setVisibility(View.GONE);
|
||||
@@ -972,13 +1029,18 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
});
|
||||
|
||||
// customMusicFloatingView.initView();
|
||||
// 使用 OnViewAttachListener 确保 View 已创建
|
||||
// 设置监听器,等待 View 创建完成
|
||||
// setMusicListener();
|
||||
mBinding.roomTop.getRoot().setClickable(false);
|
||||
mBinding.roomTop.getRoot().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// ToastUtils.showShort("点击了房间,事件穿透");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initPublicScreenFragment() {
|
||||
// 检查是否已经存在 Fragment 实例(例如在配置更改后)
|
||||
publicScreenFragment = (PublicScreenEaseChatFragment) getSupportFragmentManager()
|
||||
@@ -1003,6 +1065,21 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
int i = 0;
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
// 添加队列和处理标志
|
||||
private volatile boolean isProcessingGift = false;
|
||||
private Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
// 添加播放完成监听器实例
|
||||
// private GiftAnimView.OnPlaybackCompleteListener giftPlaybackListener = new GiftAnimView.OnPlaybackCompleteListener() {
|
||||
// @Override
|
||||
// public void onPlaybackComplete() {
|
||||
// // 处理播放完成事件
|
||||
// handleGiftPlaybackComplete();
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
public void roomInfoEvent(RoomMessageEvent messageEvent) {
|
||||
if (messageEvent == null) return;
|
||||
|
||||
@@ -1012,7 +1089,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
if (msgType == 1005) {
|
||||
LogUtils.e("@@@@" + "EventBusnujm2" + "playQueue.size()====" + messageEvent.getText().getGiftInfo());
|
||||
QXGiftPlayerManager.getInstance(this).displayFullEffectView(messageEvent.getText().getGiftInfo());
|
||||
List<String> playQueue = Arrays.asList(messageEvent.getText().getGiftInfo().getPlay_image().split(","));
|
||||
QXGiftPlayerManager.getInstance(this).displayFullEffectView1(playQueue);
|
||||
|
||||
hand1005(messageEvent, text);
|
||||
} else if (msgType == 123) {
|
||||
@@ -1093,28 +1171,33 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if (msgType == 1028) {
|
||||
roomFragment.handleMsgType1028(messageEvent);
|
||||
} else if (msgType == 1059 || msgType == 1058) {// 1059清除个人魅力 1058在离线
|
||||
if (mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("4")) {
|
||||
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
|
||||
roomFragment.SingSongEvent(messageEvent);
|
||||
} else {
|
||||
roomFragment.KtvFragmentEvent(messageEvent);
|
||||
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
|
||||
if (mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("4")) {
|
||||
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1")) {
|
||||
roomFragment.SingSongEvent(messageEvent);
|
||||
} else {
|
||||
roomFragment.KtvFragmentEvent(messageEvent);
|
||||
}
|
||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
||||
roomFragment.handleAuctionMessageEvent(messageEvent);
|
||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
|
||||
roomFragment.friendshipRoomFragmentEvent(messageEvent);
|
||||
}
|
||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("2")) {
|
||||
roomFragment.handleAuctionMessageEvent(messageEvent);
|
||||
} else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")) {
|
||||
roomFragment.friendshipRoomFragmentEvent(messageEvent);
|
||||
}
|
||||
} else if (msgType == 1056) {
|
||||
GiftLotteryDialog dialog = (GiftLotteryDialog) getSupportFragmentManager()
|
||||
.findFragmentByTag("GiftLotteryDialog");
|
||||
if (dialog != null && dialog.isVisible()) {
|
||||
dialog.UpView(messageEvent.getText().getXlh_data());
|
||||
} else {
|
||||
LogUtils.e("GiftLotteryDialog", "抽奖界面未打开");
|
||||
}
|
||||
} else if (msgType == 1057) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
TourClubDialogFragment existingFragment = (TourClubDialogFragment) getSupportFragmentManager().findFragmentByTag("TourClubDialogFragment");
|
||||
if (existingFragment != null && existingFragment.isVisible()){
|
||||
if (existingFragment != null && existingFragment.isVisible()) {
|
||||
existingFragment.onMusicPlay(messageEvent);
|
||||
} else {
|
||||
LogUtils.e("TourClubDialogFragment", "巡乐会界面未打开");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1252,86 +1335,23 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
} else if ("7".equals(typeId)) {
|
||||
roomFragment.friendshipRoomFragmentEvent(messageEvent);
|
||||
}
|
||||
if (mRoomInfoResp.getUser_info().getPit_number()==9){
|
||||
if (mRoomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
mBinding.roomTop.rl.setVisibility(View.VISIBLE);
|
||||
ivSoundEffects(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static volatile MP4PlaybackCallback sInstance;
|
||||
|
||||
public static class MP4PlaybackCallback implements IAnimListener {
|
||||
private AvatarFrameView avatarFrameView;
|
||||
|
||||
private MP4PlaybackCallback() {
|
||||
// 私有构造函数
|
||||
}
|
||||
|
||||
// 获取单例实例的方法
|
||||
public static MP4PlaybackCallback getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MP4PlaybackCallback.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MP4PlaybackCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
// 设置外部引用的方法
|
||||
public void setAvatarFrameView(AvatarFrameView view) {
|
||||
this.avatarFrameView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(int i, @Nullable String s) {
|
||||
LogUtils.e("@@@", "MP4 playback failed: " + s);
|
||||
// if (avatarFrameView != null) {
|
||||
// avatarFrameView.onPlaybackComplete();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onVideoConfigReady(@NonNull AnimConfig animConfig) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoStart() {
|
||||
// 播放开始
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoRender(int i, @Nullable AnimConfig animConfig) {
|
||||
// 视频渲染中
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoComplete() {
|
||||
LogUtils.e("@@@@" + "EventBus onVideoComplete");
|
||||
|
||||
// if (avatarFrameView != null) {
|
||||
// avatarFrameView.onPlaybackComplete();
|
||||
// }
|
||||
// avatarFrameView.playNextFromQueue();
|
||||
// EventBus.getDefault().post(new GiftAvatarBean());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDestroy() {
|
||||
// 视频销毁
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void handleMsgType1005(String url) {
|
||||
|
||||
if (SpUtil.getOpenEffect() == 1) {
|
||||
// LogUtils.e("@@@@" + "handleMsgType1005"+"mBinding.svgaGift.isPlaying()===="+mBinding.svgaGift.isPlaying());
|
||||
// mBinding.svgaGift.setSource(url, 2);
|
||||
// }
|
||||
// new Thread(() -> {
|
||||
// GiftUrl giftUrl = new GiftUrl();
|
||||
// giftUrl.setPlay_image(url);
|
||||
// giftUrlViewModel.addGiftUrl(giftUrl);
|
||||
// }).start();
|
||||
}
|
||||
|
||||
|
||||
@@ -1343,7 +1363,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
GiftBean giftInfo = text.getGiftInfo();
|
||||
UserInfo toUserInfo = text.getToUserInfo();
|
||||
if (giftInfo == null || toUserInfo == null) return;
|
||||
// if (giftInfo == null || toUserInfo == null) return;
|
||||
List<RoomPitBean> pitList = mRoomInfoResp.getRoom_info().getPit_list();
|
||||
if (pitList == null) return;
|
||||
|
||||
@@ -1416,6 +1436,23 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
AgoraManager.getInstance(RoomActivity.this).desMusic();
|
||||
// stub.setVisibility(View.GONE);
|
||||
|
||||
if ((mRoomInfoResp.getRoom_info().getType_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("4") || mRoomInfoResp.getRoom_info().getType_id().equals("3")) &&
|
||||
mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
|
||||
for (RoomPitBean roomPitBean : mRoomInfoResp.getSong_pit_list()) {
|
||||
AgoraManager.getInstance(RoomActivity.this).ClientRole(false);
|
||||
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||
mBinding.rlMic.setVisibility(View.GONE);
|
||||
}
|
||||
if (mRoomInfoResp.getSong_user_info() != null && mRoomInfoResp.getSong_user_info().getUser_id() != null) {
|
||||
if (mRoomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
AgoraManager.getInstance(RoomActivity.this).ClientRole(false);
|
||||
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||
mBinding.rlMic.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MvpPre.postRoomInfo(roomId);
|
||||
}
|
||||
|
||||
@@ -1459,7 +1496,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
|
||||
|
||||
|
||||
String typeId = mRoomInfoResp.getRoom_info().getType_id();
|
||||
if ("2".equals(typeId)) {
|
||||
if ("9".equals(pitNumber)) {
|
||||
@@ -1744,7 +1780,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
|
||||
pendingRoomId = text.getRoom_id();
|
||||
if (pendingRoomId == null){
|
||||
if (pendingRoomId == null) {
|
||||
return;
|
||||
}
|
||||
LogUtils.e("需要加入的房间id:pendingRoomId: " + pendingRoomId);
|
||||
@@ -1754,7 +1790,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
MvpPre.quitRoom2(messageEvent.getRoomId(), SpUtil.getUserId() + "");
|
||||
quit();
|
||||
MessageListenerSingleton.reset(messageEvent.getRoomId());
|
||||
MessageListenerSingleton.quitGroup(messageEvent.getRoomId());
|
||||
MessageListenerSingleton.getInstance().joinGroup(pendingRoomId);
|
||||
MvpPre.getRoomIn(pendingRoomId, "");
|
||||
lastSwitchedRoomId = pendingRoomId;
|
||||
@@ -1768,6 +1804,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
public void quitRoomAll(String roomId) {
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
private void handleMsgType1053(RoomMessageEvent messageEvent, RoomMessageEvent.T text) {
|
||||
if (text == null || text.getList() == null || text.getList().isEmpty()) return;
|
||||
|
||||
@@ -1776,6 +1816,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
RoomPitBean roomPitBean = getRoomPitBean(messageEvent, j);
|
||||
pitArr.add(roomPitBean);
|
||||
}
|
||||
|
||||
roomFragment.friendSeatDidChanged(pitArr);
|
||||
pitArr.clear();
|
||||
}
|
||||
@@ -2084,7 +2125,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
GiftBean gift = new GiftBean();
|
||||
gift.setGift_id("");
|
||||
gift.setPlay_image(roomJoinMountModel.getRide_url());
|
||||
QXGiftPlayerManager.getInstance(this).displayChatEffectView(gift);
|
||||
QXGiftPlayerManager.getInstance(this).displayFullEffectView(roomJoinMountModel.getRide_url());
|
||||
// mBinding.svgaZuoji.setSource(roomJoinMountModel.getRide_url(), 2);
|
||||
}
|
||||
}
|
||||
@@ -2111,45 +2152,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
RoomChartsFragment fragment = RoomChartsFragment.newInstance(roomId, mRoomInfoResp);
|
||||
fragment.show(getSupportFragmentManager(), "RoomChartsFragment");
|
||||
addActiveDialogFragment(fragment);
|
||||
} else if (id == R.id.btn_close_live) {
|
||||
} else if (id == R.id.btn_close_live) {//退出房间
|
||||
showExitRoomDialog();
|
||||
|
||||
//最小化
|
||||
// ExitRoomBottomSheet bottomSheet = ExitRoomBottomSheet.newInstance();
|
||||
// bottomSheet.setOnOptionSelectedListener(new ExitRoomBottomSheet.OnOptionSelectedListener() {
|
||||
// @Override
|
||||
// public void onMinimize() {
|
||||
// // 处理最小化逻辑,比如不销毁 Activity,仅移至后台
|
||||
//// CommonAppContext.getInstance().isShow = false;
|
||||
//// ARouter.getInstance().build(ARouteConstants.ME).navigation();//栈顶复用
|
||||
//// moveTaskToBack(true);
|
||||
//
|
||||
// CommonAppContext.getInstance().isShow = false;
|
||||
// ARouter.getInstance().build(ARouteConstants.ME)
|
||||
// .withFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
// .navigation();
|
||||
//// moveTaskToBack(true);
|
||||
//
|
||||
// // 处理最小化逻辑
|
||||
// minimizeToBackground();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onExitRoom() {
|
||||
// // 调用退出房间方法
|
||||
// MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
//
|
||||
// // 真正退出房间
|
||||
// performExitRoom();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCancel() {
|
||||
// // 用户点击取消,不做任何事
|
||||
// }
|
||||
// });
|
||||
// bottomSheet.show(getSupportFragmentManager(), "ExitRoomBottomSheet");
|
||||
// addActiveDialogFragment(bottomSheet);
|
||||
} else if (id == R.id.tv_num) {
|
||||
// RoomOnlineDialogFragment.show(roomId, "", mRoomUserBean, mRoomInfoResp, getSupportFragmentManager());
|
||||
RoomOnlineDialogFragment fragment = RoomOnlineDialogFragment.show(roomId, "", mRoomUserBean, mRoomInfoResp, getSupportFragmentManager());
|
||||
@@ -2258,7 +2263,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
public void performExitRoom() {
|
||||
// TODO: 2025/9/18 type==1:退出房间,进入到首页 2:退出当前页,不导航到首页,是从首页点击关闭悬浮退出的
|
||||
public void performExitRoom(int type) {
|
||||
// 清理最小化状态
|
||||
clearMinimizeState();
|
||||
isMinimized = false;
|
||||
@@ -2266,20 +2272,22 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// 执行退出房间逻辑
|
||||
CommonAppContext.getInstance().isPlaying = false;
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
|
||||
QXGiftPlayerManager.getInstance(this).destroyEffectSvga();
|
||||
// 停止屏幕捕获和其他资源
|
||||
AgoraManager.getInstance(this).stopScreenCapture();
|
||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||
AgoraManager.getInstance(this).leaveRoom();
|
||||
AgoraManager.getInstance(this).cleanup();
|
||||
AgoraManager.getInstance(this).stopMusicPlayer();
|
||||
// AgoraManager.getInstance(this).cleanup();
|
||||
|
||||
MyRoomSingleton.getInstance().onExitRoom();
|
||||
MessageListenerSingleton.reset(roomId);
|
||||
MessageListenerSingleton.quitGroup(roomId);
|
||||
|
||||
// 清理资源
|
||||
cleanupResources();
|
||||
|
||||
// 导航到首页
|
||||
navigateToMainPage();
|
||||
if (type == 1) {
|
||||
// 导航到首页
|
||||
navigateToMainPage();
|
||||
}
|
||||
|
||||
finish();
|
||||
}
|
||||
@@ -2306,13 +2314,32 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
private void navigateToMainPage() {
|
||||
ARouter.getInstance()
|
||||
.build(ARouteConstants.ME)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation();
|
||||
|
||||
// 添加转场动画
|
||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||
}
|
||||
|
||||
private void quitUpRoom() {
|
||||
// 清理最小化状态
|
||||
clearMinimizeState();
|
||||
isMinimized = false;
|
||||
|
||||
// 执行退出房间逻辑
|
||||
CommonAppContext.getInstance().isPlaying = false;
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
QXGiftPlayerManager.getInstance(this).destroyEffectSvga();
|
||||
// 停止屏幕捕获和其他资源
|
||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||
AgoraManager.getInstance(this).leaveRoom();
|
||||
AgoraManager.getInstance(this).stopMusicPlayer();
|
||||
// AgoraManager.getInstance(this).cleanup();
|
||||
|
||||
MyRoomSingleton.getInstance().onExitRoom();
|
||||
MessageListenerSingleton.quitGroup(roomId);
|
||||
cleanupResources();
|
||||
}
|
||||
|
||||
|
||||
private void minimizeToBackground() {
|
||||
isMinimized = true;
|
||||
@@ -2617,8 +2644,12 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
imm.showSoftInput(etContent, InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
});
|
||||
if (inputSting != null) {
|
||||
etContent.setText(inputSting);
|
||||
}
|
||||
dialog.show();
|
||||
addActiveDialog(dialog); // 添加到管理列表
|
||||
inputSting = "";
|
||||
}
|
||||
|
||||
private void countDownTimer() {
|
||||
@@ -2644,12 +2675,16 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
}
|
||||
|
||||
String inputSting;
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomInfoEvent(UserInfo messageEvent) {
|
||||
mBinding.llInput.setVisibility(View.VISIBLE);
|
||||
mBinding.inputMenu1.bringToFront(); // 强制将该 View 置于最上层
|
||||
mBinding.inputMenu1.show();
|
||||
mBinding.inputMenu1.setText("@" + messageEvent.getNickname());
|
||||
// mBinding.llInput.setVisibility(View.VISIBLE);
|
||||
// mBinding.inputMenu1.bringToFront(); // 强制将该 View 置于最上层
|
||||
// mBinding.inputMenu1.show();
|
||||
// mBinding.inputMenu1.setText("@" + messageEvent.getNickname());
|
||||
inputSting = "@" + messageEvent.getNickname();
|
||||
dialogDismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2660,6 +2695,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomOut(RoomOutEvent roomOutEvent) {
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
performExitRoom(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2783,7 +2819,12 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
ivSoundEffects(false);
|
||||
}
|
||||
|
||||
if (resp.getRoom_info().getType_id().equals("7") || resp.getRoom_info().getType_id().equals("2")) {
|
||||
mBinding.rlMore.setVisibility(GONE);
|
||||
mBinding.rlMisc.setVisibility(GONE);
|
||||
}
|
||||
setupEffectView();
|
||||
//
|
||||
}
|
||||
|
||||
private void instView() {//隐藏视图
|
||||
@@ -3056,7 +3097,21 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
isInBackground = false;
|
||||
// 从后台回到前台时调用
|
||||
if (MvpPre != null && roomId != null) {
|
||||
// MvpPre.postRoomInfo(roomId);
|
||||
if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
|
||||
if (mRoomInfoResp.getRoom_info().getType_id().equals("1")
|
||||
|| mRoomInfoResp.getRoom_info().getType_id().equals("3") ||
|
||||
mRoomInfoResp.getRoom_info().getType_id().equals("4")) {
|
||||
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
|
||||
|
||||
} else {
|
||||
MvpPre.postRoomInfo(roomId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MvpPre.postRoomInfo(roomId);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 延迟调整布局,确保视图已经完全加载
|
||||
@@ -3212,11 +3267,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
@Override
|
||||
public void postRoomInfo(RoomInfoResp resp) {
|
||||
if (resp == null) {
|
||||
ARouter.getInstance().build(ARouteConstants.ME)
|
||||
.withFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.navigation();
|
||||
cleanupResources();
|
||||
finish();
|
||||
// ARouter.getInstance().build(ARouteConstants.ME)
|
||||
// .navigation();
|
||||
// cleanupResources();
|
||||
// finish();
|
||||
quitUpRoom();
|
||||
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
|
||||
MvpPre.getRoomIn(roomId, password);
|
||||
return;
|
||||
}
|
||||
this.mRoomInfoResp = resp;
|
||||
@@ -3250,6 +3307,8 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// .replace(R.id.vp_room_pager, roomFragment)
|
||||
// .commitAllowingStateLoss();
|
||||
// } else {
|
||||
|
||||
|
||||
resetFragment();
|
||||
// roomFragment.refreshData(resp);
|
||||
upHeight();
|
||||
@@ -3267,11 +3326,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
mBinding.roomTop.btnFollow.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.roomTop.btnFollow.setText("收藏");
|
||||
}
|
||||
if ((roomBean.getType_id().equals("3") || roomBean.getType_id().equals("1") || roomBean.getType_id().equals("4")) && roomBean.getLabel_id().equals("2")) {
|
||||
if ((resp.getRoom_info().getType_id().equals("3") || resp.getRoom_info().getType_id().equals("1") || resp.getRoom_info().getType_id().equals("4")) && resp.getRoom_info().getLabel_id().equals("2")) {
|
||||
AgoraManager.getInstance(this).setBjMusic(false);
|
||||
} else {
|
||||
AgoraManager.getInstance(this).setBjMusic(true);
|
||||
}
|
||||
|
||||
|
||||
AgoraManager.getInstance(this).stopMuisc();
|
||||
initializeAudio();
|
||||
|
||||
@@ -3282,6 +3343,11 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
mBinding.rlMore.setVisibility(GONE);
|
||||
mBinding.rlMisc.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
if (resp.getRoom_info().getType_id().equals("7") || resp.getRoom_info().getType_id().equals("2")) {
|
||||
mBinding.rlMore.setVisibility(GONE);
|
||||
mBinding.rlMisc.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3310,6 +3376,14 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
String typeId = mRoomInfoResp.getRoom_info().getType_id();
|
||||
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
|
||||
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
if ("7".equals(typeId)) {
|
||||
if (mRoomInfoResp.getRoom_info().getRoom_background() == null || mRoomInfoResp.getRoom_info().getRoom_background().equals("")) {
|
||||
changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj);
|
||||
@@ -3360,24 +3434,13 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
@Override
|
||||
public void quitRoom() {
|
||||
// CommonAppContext.getInstance().isPlaying = false;
|
||||
// CommonAppContext.getInstance().isShow = false;
|
||||
//// AgoraManager.getInstance(this).destroy();
|
||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||
// AgoraManager.getInstance(this).leaveRoom();
|
||||
// AgoraManager.getInstance(this).cleanup();
|
||||
// MyRoomSingleton.getInstance().onExitRoom();
|
||||
// MessageListenerSingleton.reset(roomId);
|
||||
// ARouter.getInstance().build(ARouteConstants.ME).navigation();//栈顶复用
|
||||
// cleanupResources();
|
||||
// finish();
|
||||
}
|
||||
|
||||
public void quit() {
|
||||
CommonAppContext.getInstance().isPlaying = false;
|
||||
CommonAppContext.getInstance().isShow = false;
|
||||
AgoraManager.getInstance(this).stopScreenCapture();
|
||||
AgoraManager.getInstance(this).leaveRoom();
|
||||
// AgoraManager.getInstance(this).stopScreenCapture();
|
||||
// AgoraManager.getInstance(this).leaveRoom();
|
||||
AgoraManager.getInstance(this).cleanup();
|
||||
MyRoomSingleton.getInstance().onExitRoom();
|
||||
}
|
||||
@@ -3433,6 +3496,11 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findRoom() {
|
||||
|
||||
}
|
||||
|
||||
private void queren1(String nickname) {
|
||||
// 创建并显示确认对话框
|
||||
new ConfirmDialog(this,
|
||||
@@ -3470,12 +3538,17 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// 只有在真正退出房间时才清理最小化状态
|
||||
if (!isMinimized) {
|
||||
clearMinimizeState();
|
||||
}
|
||||
// if (!isMinimized) {
|
||||
// clearMinimizeState();
|
||||
// }
|
||||
// 取消注册礼物播放完成监听器
|
||||
// unregisterGiftPlaybackListener();
|
||||
|
||||
// 清理队列
|
||||
// giftQueue.clear();
|
||||
// giftUrlViewModel.deleteAllGiftUrls();
|
||||
// 清理所有可能的内存泄漏点
|
||||
cleanupResources();
|
||||
// cleanupResources();
|
||||
|
||||
// 确保父类的 onDestroy 被调用
|
||||
super.onDestroy();
|
||||
@@ -3484,7 +3557,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
|
||||
}
|
||||
|
||||
private void cleanupResources() {
|
||||
public void cleanupResources() {
|
||||
sDestroied = true;
|
||||
overridePendingTransition(0, 0);
|
||||
try {
|
||||
@@ -3515,9 +3588,9 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
|
||||
// 6. 清理 Agora 资源
|
||||
if (AgoraManager.getInstance(this) != null) {
|
||||
AgoraManager.getInstance(this).cleanup();
|
||||
}
|
||||
// if (AgoraManager.getInstance(this) != null) {
|
||||
// AgoraManager.getInstance(this).cleanup();
|
||||
// }
|
||||
// 清理所有弹框
|
||||
dismissAllDialogs();
|
||||
// 7. 清理 Fragment
|
||||
@@ -3528,15 +3601,40 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
// 移除所有 OnClickListener 防止内存泄漏
|
||||
clearClickListeners();
|
||||
}
|
||||
roomMessageEventQueue.clear();
|
||||
ThreadUtils.cancel();
|
||||
QXGiftPlayerManager.getInstance(getApplicationContext()).destroyEffectSvga();
|
||||
// QXGiftPlayerManager.getInstance(getApplicationContext()).destroyEffectSvga();
|
||||
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("cleanupResources error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全地将视图从当前父容器移动到新的父容器
|
||||
*
|
||||
* @param view 要移动的视图
|
||||
* @param newParent 新的父容器
|
||||
*/
|
||||
private void safelyMoveViewToParent(View view, ViewGroup newParent) {
|
||||
if (view == null || newParent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果视图已经在目标容器中,则不需要移动
|
||||
if (view.getParent() == newParent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 先从当前父容器中移除
|
||||
ViewParent currentParent = view.getParent();
|
||||
if (currentParent != null && currentParent instanceof ViewGroup) {
|
||||
((ViewGroup) currentParent).removeView(view);
|
||||
}
|
||||
|
||||
// 添加到新的父容器
|
||||
newParent.addView(view);
|
||||
}
|
||||
|
||||
// 清理所有弹框
|
||||
private void dismissAllDialogs() {
|
||||
// 关闭 AlertDialog 实例
|
||||
|
||||
@@ -190,13 +190,18 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
// tvContent3.setPadding(ResourceUtil.getDimen(String.valueOf(paddingLeftValues3)), 0, 0, 0);
|
||||
// tvContent3.setText(spanUtils.create());
|
||||
|
||||
|
||||
ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getAvatar(), helper.getView(com.xscm.moduleutil.R.id.avatar));
|
||||
if (emMessage.getText().getFromUserInfo()!=null && emMessage.getText().getFromUserInfo().getAvatar()!=null) {
|
||||
ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getAvatar(), helper.getView(com.xscm.moduleutil.R.id.avatar));
|
||||
}
|
||||
helper.setText(com.xscm.moduleutil.R.id.tv_name, emMessage.getText().getFromUserInfo().getNickname());
|
||||
helper.setText(com.xscm.moduleutil.R.id.tv_content, emMessage.getText().getText());
|
||||
List<String> images1 = emMessage.getText().getFromUserInfo().getIcon();
|
||||
LinearLayout ll_images1 = helper.getView(com.xscm.moduleutil.R.id.line);
|
||||
ll_images1.removeAllViews();
|
||||
tv_content.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
if (images1 == null){
|
||||
return;
|
||||
}
|
||||
for (String url : images1) {
|
||||
if (url.contains("http")) {
|
||||
ImageView imageView = new ImageView(helper.itemView.getContext());
|
||||
@@ -212,7 +217,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
ll_images1.addView(imageView);
|
||||
}
|
||||
}
|
||||
tv_content.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
break;
|
||||
// case 4:
|
||||
// TextView tvContent7 = helper.getView(R.id.tv_content);
|
||||
|
||||
@@ -47,6 +47,8 @@ public class RoomContacts {
|
||||
void clearUserCharm();
|
||||
|
||||
void userOnlineStatus(List<UserOnlineStatusBean> list);
|
||||
|
||||
void findRoom();
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftNumBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackEvent;
|
||||
import com.xscm.moduleutil.bean.GiftPackListCount;
|
||||
import com.xscm.moduleutil.bean.RewardUserBean;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
@@ -605,9 +606,29 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
roomGiftGiveEvent = new RoomGiftGiveEvent(userId, roomId, pit, num, 0, null, roonGiftModel, heart_id, "");
|
||||
}
|
||||
} else if (currentItem == 0) {
|
||||
giftNumber = num;
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
if (userInfo==null){
|
||||
giftNumber = num;
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
return;
|
||||
}
|
||||
if ( userInfo.getPit_number()!=null&& userInfo.getPit_number().equals("888") || userInfo.getPit_number().equals("")) {
|
||||
if (userInfo.getPit_number().isEmpty() || jingp != 1) {
|
||||
giftNumber = num;
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
}else {
|
||||
roomGiftGiveEvent = new RoomGiftGiveEvent(userId, roomId, pit, num, 0, null, roonGiftModel, heart_id, userInfo.getAuction_id());
|
||||
EventBus.getDefault().post(roomGiftGiveEvent);
|
||||
roomGiftGiveEvent = null;
|
||||
MvpPre.roomAuctionJoin(userInfo.getAuction_id(), userInfo.getUser_id() + "", roonGiftModel.getGift_id(), num, "1");
|
||||
dismiss();
|
||||
}
|
||||
} else{
|
||||
giftNumber = num;
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
}
|
||||
|
||||
} else {
|
||||
//背包礼物打赏
|
||||
@@ -680,15 +701,6 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
}
|
||||
// 调用示例
|
||||
private void refreshCurrentGiftFragment(String id,int type,String roomId) {
|
||||
// int currentPosition = mBinding.viewPager.getCurrentItem();
|
||||
// if (currentPosition >= 0 && currentPosition < fragmentList.size()) {
|
||||
// Fragment fragment = fragmentList.get(currentPosition);
|
||||
// if (fragment instanceof GiftTwoDetailsFragment && fragment.isAdded()) {
|
||||
// GiftTwoDetailsFragment giftFragment = (GiftTwoDetailsFragment) fragment;
|
||||
// // 调用 fragment 的公共方法
|
||||
// giftFragment.loadDataIfNeeded(id,type,roomId); // 假设 GiftTwoDetailsFragment 有这个方法
|
||||
// }
|
||||
// }
|
||||
if (getCurrentGiftFragment()!=null){
|
||||
getCurrentGiftFragment().loadDataIfNeeded(id,type,roomId);
|
||||
}
|
||||
@@ -739,7 +751,9 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
|
||||
if (mBinding.viewPager.getCurrentItem() == 0) {
|
||||
MvpPre.getGiftPackListCount();
|
||||
EventBus.getDefault().post(beibaoId);
|
||||
GiftPackEvent giftPackEvent = new GiftPackEvent();
|
||||
giftPackEvent.setBdid(beibaoId);
|
||||
EventBus.getDefault().post(giftPackEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
|
||||
@Override
|
||||
public void getRoomOnline(RoomOnline onlineBean) {
|
||||
List<RoomOnlineBean> roomOnlineBeanList=new ArrayList<>();
|
||||
roomOnlineAdapter.setNewData(roomOnlineBeanList);
|
||||
int type_pit;
|
||||
if (pit_number.isEmpty()) {
|
||||
type_pit = 1;
|
||||
@@ -334,4 +335,10 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
|
||||
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findRoom() {
|
||||
mBinding.srl.finishRefresh();
|
||||
mBinding.srl.finishLoadMore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,9 @@ import com.xscm.moduleutil.widget.floatingView.IFloatingView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EventListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
@@ -83,7 +85,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
/// 中间的
|
||||
private boolean bottomIsAnimate = false;
|
||||
RoomConcernDialogFragment dialogFragment;
|
||||
|
||||
private Map<String, RoomFriendshipWheatView> userViewMap = new HashMap<>();
|
||||
/// 底部的
|
||||
@Override
|
||||
public void applyPit() {
|
||||
@@ -178,6 +180,8 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
mWheatViews.add(null);
|
||||
mWheatViews.add(mBinding.wheatView9);
|
||||
mWheatViews.add(mBinding.wheatView10);
|
||||
|
||||
|
||||
// 为每个麦位视图添加点击事件
|
||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||
final int position = i;
|
||||
@@ -339,7 +343,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/9/12 清除个人魅力
|
||||
// TODO: 2025/9/12 清除个人魅力
|
||||
public void event1059(RoomMessageEvent messageEvent) {
|
||||
RoomPitBean pitBean = mBinding.wheatView9.pitBean;
|
||||
if (pitBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
@@ -427,7 +431,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
// Handle exception
|
||||
}
|
||||
}
|
||||
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
public void event1004(RoomMessageEvent messageEvent){
|
||||
@@ -460,6 +464,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
// Handle exception
|
||||
}
|
||||
}
|
||||
initUserViewMap();
|
||||
}
|
||||
public void event1035(RoomMessageEvent message) {
|
||||
|
||||
@@ -500,63 +505,123 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
}
|
||||
}
|
||||
|
||||
// 在 initData() 方法中初始化映射关系
|
||||
//初始化对应的map
|
||||
private void initUserViewMap() {
|
||||
userViewMap.clear();
|
||||
// 注意:这里需要确保 pitBean 和 getUser_id() 在初始化时已经设置
|
||||
// 可以在 roomInfoUpdate 方法中调用此方法
|
||||
addToUserViewMap(mBinding.wheatView1);
|
||||
addToUserViewMap(mBinding.wheatView2);
|
||||
addToUserViewMap(mBinding.wheatView3);
|
||||
addToUserViewMap(mBinding.wheatView4);
|
||||
addToUserViewMap(mBinding.wheatView5);
|
||||
addToUserViewMap(mBinding.wheatView6);
|
||||
addToUserViewMap(mBinding.wheatView9);
|
||||
addToUserViewMap(mBinding.wheatView10);
|
||||
}
|
||||
private void addToUserViewMap(RoomFriendshipWheatView view) {
|
||||
if (view != null && view.pitBean != null &&
|
||||
view.pitBean.getUser_id() != null &&
|
||||
!view.pitBean.getUser_id().isEmpty() &&
|
||||
!view.pitBean.getUser_id().equals("0")) {
|
||||
userViewMap.put(view.pitBean.getUser_id(), view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void updateCharmForUserOptimized(UserInfo toUserInfo) {
|
||||
String userId = String.valueOf(toUserInfo.getUser_id());
|
||||
String charm = toUserInfo.getCharm();
|
||||
|
||||
// O(1) 时间复杂度查找
|
||||
RoomFriendshipWheatView view = userViewMap.get(userId);
|
||||
if (view != null) {
|
||||
view.pitBean.setCharm(charm);
|
||||
view.setCharm(charm);
|
||||
}
|
||||
}
|
||||
// TODO: 2025/9/12 更新火热值
|
||||
public void event1005(RoomMessageEvent messageEvent){
|
||||
RoomPitBean pitBean = mBinding.wheatView9.pitBean;
|
||||
if (pitBean.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
mBinding.wheatView9.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean1 = mBinding.wheatView10.pitBean;
|
||||
if (pitBean1.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
mBinding.wheatView10.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView10.setData(pitBean1);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean2 = mBinding.wheatView1.pitBean;
|
||||
if (pitBean2.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView1.setData(pitBean2);
|
||||
mBinding.wheatView1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean3 = mBinding.wheatView2.pitBean;
|
||||
if (pitBean3.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView2.setData(pitBean3);
|
||||
mBinding.wheatView2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean4 = mBinding.wheatView3.pitBean;
|
||||
if (pitBean4.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView3.setData(pitBean4);
|
||||
mBinding.wheatView3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean5 = mBinding.wheatView4.pitBean;
|
||||
if (pitBean5.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView4.setData(pitBean5);
|
||||
mBinding.wheatView4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean6 = mBinding.wheatView5.pitBean;
|
||||
if (pitBean6.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView5.setData(pitBean6);
|
||||
mBinding.wheatView5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean7 = mBinding.wheatView6.pitBean;
|
||||
if (pitBean7.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
|
||||
pitBean7.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView6.setData(pitBean7);
|
||||
mBinding.wheatView6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
return;
|
||||
|
||||
List<UserInfo> toUserInfos = messageEvent.getText().getToUserInfos();
|
||||
|
||||
if (toUserInfos != null && !toUserInfos.isEmpty()) {
|
||||
// 批量处理
|
||||
for (UserInfo toUserInfo : toUserInfos) {
|
||||
updateCharmForUserOptimized(toUserInfo);
|
||||
}
|
||||
} else {
|
||||
UserInfo toUserInfo = messageEvent.getText().getToUserInfo();
|
||||
if (toUserInfo != null) {
|
||||
updateCharmForUserOptimized(toUserInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// if (messageEvent.getText().getToUserInfos()!=null && messageEvent.getText().getToUserInfos().size()>0){
|
||||
// for (int i = 0; i < messageEvent.getText().getToUserInfos().size(); i++) {
|
||||
// UserInfo toUserInfo = messageEvent.getText().getToUserInfos().get(i);
|
||||
//
|
||||
// }
|
||||
// }else {
|
||||
//
|
||||
//
|
||||
// RoomPitBean pitBean = mBinding.wheatView9.pitBean;
|
||||
// if (pitBean.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView9.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean1 = mBinding.wheatView10.pitBean;
|
||||
// if (pitBean1.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.wheatView10.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView10.setData(pitBean1);
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean2 = mBinding.wheatView1.pitBean;
|
||||
// if (pitBean2.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView1.setData(pitBean2);
|
||||
// mBinding.wheatView1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean3 = mBinding.wheatView2.pitBean;
|
||||
// if (pitBean3.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView2.setData(pitBean3);
|
||||
// mBinding.wheatView2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean4 = mBinding.wheatView3.pitBean;
|
||||
// if (pitBean4.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView3.setData(pitBean4);
|
||||
// mBinding.wheatView3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean5 = mBinding.wheatView4.pitBean;
|
||||
// if (pitBean5.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView4.setData(pitBean5);
|
||||
// mBinding.wheatView4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean6 = mBinding.wheatView5.pitBean;
|
||||
// if (pitBean6.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView5.setData(pitBean6);
|
||||
// mBinding.wheatView5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// RoomPitBean pitBean7 = mBinding.wheatView6.pitBean;
|
||||
// if (pitBean7.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean7.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
//// mBinding.wheatView6.setData(pitBean7);
|
||||
// mBinding.wheatView6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public void event1058(RoomMessageEvent messageEvent) {
|
||||
@@ -863,7 +928,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
roomInfoResp.getFriend_info().setHeart_list(heartLists);
|
||||
}
|
||||
configHeart();
|
||||
configPowerBtn();
|
||||
// configPowerBtn();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -878,7 +943,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
myPitNumber = -1;
|
||||
}
|
||||
|
||||
// 更新麦位显示
|
||||
// 更新麦位显示
|
||||
for (RoomPitBean pitBean : pitArr) {
|
||||
|
||||
RoomFriendshipWheatView friendshipWheatView = mWheatViews.get(Integer.parseInt(pitBean.getPit_number()) - 1);
|
||||
@@ -894,6 +959,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
myPitNumber = Integer.parseInt(pitBean.getPit_number());
|
||||
}
|
||||
}
|
||||
configPowerBtn();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -931,30 +997,12 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
configTime();
|
||||
configHeart();
|
||||
configPowerBtn();
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
/// 设置心动连线
|
||||
private void configHeart() {
|
||||
if (currentPartType.value == 1) {
|
||||
//隐藏中间心动值 、心动背景 、隐藏连线 连线停止动画
|
||||
mBinding.imX2.setVisibility(GONE);
|
||||
mBinding.imX1.setVisibility(GONE);
|
||||
mBinding.imX3.setVisibility(GONE);
|
||||
|
||||
// mBinding.iv22.setVisibility(GONE);
|
||||
// mBinding.iv11.setVisibility(GONE);
|
||||
// mBinding.iv33.setVisibility(GONE);
|
||||
// mBinding.iv22.stopAnimation();
|
||||
// mBinding.iv11.stopAnimation();
|
||||
// mBinding.iv33.stopAnimation();
|
||||
topIsAnimate = false;
|
||||
centerIsAnimate = false;
|
||||
bottomIsAnimate = false;
|
||||
mBinding.tv1.setVisibility(GONE);
|
||||
mBinding.tv2.setVisibility(GONE);
|
||||
mBinding.tv3.setVisibility(GONE);
|
||||
|
||||
} else if (currentPartType.value == 2 || currentPartType.value == 3) {
|
||||
if (currentPartType.value == 2 || currentPartType.value == 3) {
|
||||
FriendInfo.HeartList heartList1 = null;//中心的集合
|
||||
FriendInfo.HeartList heartList2 = null;//顶部的1-6集合
|
||||
FriendInfo.HeartList heartList3 = null;//底部的3-4集合
|
||||
@@ -964,13 +1012,13 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
heartList2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
heartList3 = roomInfoResp.getFriend_info().getHeart_list().get(2);
|
||||
}
|
||||
if (roomInfoResp.getFriend_info().getHeart_list().size() == 2) {
|
||||
heartList1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
heartList2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
}
|
||||
if (roomInfoResp.getFriend_info().getHeart_list().size() == 1) {
|
||||
heartList1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
}
|
||||
// if (roomInfoResp.getFriend_info().getHeart_list().size() == 2) {
|
||||
// heartList1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
// heartList2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
// }
|
||||
// if (roomInfoResp.getFriend_info().getHeart_list().size() == 1) {
|
||||
// heartList1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
// }
|
||||
if (heartList1 != null && heartList1.getHeartNum() > 0) {
|
||||
Logger.d("显示 iv_22 动画 - 心动值: " + heartList1.getHeartNum());
|
||||
// mBinding.iv22.setVisibility(View.VISIBLE);
|
||||
@@ -1080,6 +1128,26 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
mBinding.tv2.setVisibility(GONE);
|
||||
mBinding.tv3.setVisibility(GONE);
|
||||
}
|
||||
return;
|
||||
}else if (currentPartType.value == 1) {
|
||||
//隐藏中间心动值 、心动背景 、隐藏连线 连线停止动画
|
||||
mBinding.imX2.setVisibility(GONE);
|
||||
mBinding.imX1.setVisibility(GONE);
|
||||
mBinding.imX3.setVisibility(GONE);
|
||||
|
||||
// mBinding.iv22.setVisibility(GONE);
|
||||
// mBinding.iv11.setVisibility(GONE);
|
||||
// mBinding.iv33.setVisibility(GONE);
|
||||
// mBinding.iv22.stopAnimation();
|
||||
// mBinding.iv11.stopAnimation();
|
||||
// mBinding.iv33.stopAnimation();
|
||||
topIsAnimate = false;
|
||||
centerIsAnimate = false;
|
||||
bottomIsAnimate = false;
|
||||
mBinding.tv1.setVisibility(GONE);
|
||||
mBinding.tv2.setVisibility(GONE);
|
||||
mBinding.tv3.setVisibility(GONE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1135,14 +1203,15 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
md1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
md2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
md3 = roomInfoResp.getFriend_info().getHeart_list().get(2);
|
||||
|
||||
}
|
||||
if (roomInfoResp.getFriend_info().getHeart_list().size() == 2) {
|
||||
md1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
md2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
}
|
||||
if (roomInfoResp.getFriend_info().getHeart_list().size() == 1) {
|
||||
md1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
}
|
||||
// if (roomInfoResp.getFriend_info().getHeart_list().size() == 2) {
|
||||
// md1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
// md2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||
// }
|
||||
// if (roomInfoResp.getFriend_info().getHeart_list().size() == 1) {
|
||||
// md1 = roomInfoResp.getFriend_info().getHeart_list().get(0);
|
||||
// }
|
||||
// assert md1 != null;
|
||||
if (md1 != null && md1.getHeartNum() > 0) {
|
||||
if (mBinding.wheatView2.pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
@@ -1224,6 +1293,8 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
mBinding.wheatView5.setLockZl(false);
|
||||
mBinding.wheatView6.setLockZl(false);
|
||||
}
|
||||
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
// TODO: 2025/3/12 倒计时
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.xscm.moduleutil.utils.ClickUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.StringUtil;
|
||||
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||
import com.xscm.moduleutil.widget.RoomMakeWheatView;
|
||||
|
||||
@@ -80,7 +81,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
private String auctionId = "";
|
||||
private RoomAuction.AuctionUserBean auctionUserBean;
|
||||
private List<RoomAuction.AuctionListBean> auctionList;
|
||||
// private ImageView imActionJs, imActionYs;
|
||||
// private ImageView imActionJs, imActionYs;
|
||||
// private LinearLayout stub;
|
||||
private boolean isButtonsInflated = false;
|
||||
private int type;
|
||||
@@ -176,7 +177,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
roomPitBean1.setPit_number("888");
|
||||
roomPitBean1.setIs_pm(1);
|
||||
wheatView2.setData(roomPitBean1);
|
||||
mBinding.tvPB.setText(auctionUserBean.getCharm());
|
||||
mBinding.tvPB.setText(StringUtil.toWan2(auctionUserBean.getCharm(),1));
|
||||
countDownTime(auctionUserBean.getDuration());
|
||||
|
||||
if (auctionUserBean.getAuction_id() != null) {
|
||||
@@ -214,16 +215,15 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
// if (imActionJs != null && imActionYs != null) {
|
||||
// imActionJs.setVisibility(INVISIBLE);
|
||||
// imActionYs.setVisibility(INVISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upVisibility(false);
|
||||
}
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upVisibility(false);
|
||||
}
|
||||
// }
|
||||
}
|
||||
mBinding.ivJp.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if (roomAuction.getAuction_list() != null && roomAuction.getAuction_list().size() > 0) {
|
||||
auctionList = roomAuction.getAuction_list();
|
||||
@@ -317,17 +317,17 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
// initOverlayButtons();
|
||||
// }
|
||||
// if (imActionJs != null) {
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1 || roomInfoResp.getUser_info().getIs_management() == 1 || roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1 || roomInfoResp.getUser_info().getIs_management() == 1 || roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||
// imActionJs.setVisibility(VISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upJs( true);
|
||||
}
|
||||
} else {
|
||||
// imActionJs.setVisibility(INVISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upJs( false);
|
||||
}
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upJs(true);
|
||||
}
|
||||
} else {
|
||||
// imActionJs.setVisibility(INVISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upJs(false);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1027,52 +1027,56 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
|
||||
public void event1058(RoomMessageEvent messageEvent) {
|
||||
int type = messageEvent.getText().getType();
|
||||
RoomPitBean pitBean = wheatView.pitBean;
|
||||
if (pitBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean.setIs_online(type == 1 ? 1 : 2);
|
||||
wheatView.setData(pitBean);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean2 = wheatView2.pitBean;
|
||||
if (pitBean2.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean2.setIs_online(type == 1 ? 1 : 2);
|
||||
wheatView2.setData(pitBean2);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean3 = mBinding.ivAuction1.pitBean;
|
||||
if (pitBean3.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean3.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction1.setData(pitBean3);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean4 = mBinding.ivAuction2.pitBean;
|
||||
if (pitBean4.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean4.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction2.setData(pitBean4);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean5 = mBinding.ivAuction3.pitBean;
|
||||
if (pitBean5.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean5.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction3.setData(pitBean5);
|
||||
return;
|
||||
}
|
||||
if (auctionList != null && auctionList.size() > 0) {
|
||||
for (int i = 0; i < auctionList.size(); i++) {
|
||||
RoomAuction.AuctionListBean auctionListBean = auctionList.get(i);
|
||||
int j = i;
|
||||
j++;
|
||||
if (j == 4) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline4.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
}
|
||||
} else if (j == 5) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline5.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
}
|
||||
} else if (j == 6) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline6.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
if (messageEvent.getText().getUser_id() != null) {
|
||||
|
||||
|
||||
RoomPitBean pitBean = wheatView.pitBean;
|
||||
if (pitBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean.setIs_online(type == 1 ? 1 : 2);
|
||||
wheatView.setData(pitBean);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean2 = wheatView2.pitBean;
|
||||
if (pitBean2.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean2.setIs_online(type == 1 ? 1 : 2);
|
||||
wheatView2.setData(pitBean2);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean3 = mBinding.ivAuction1.pitBean;
|
||||
if (pitBean3.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean3.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction1.setData(pitBean3);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean4 = mBinding.ivAuction2.pitBean;
|
||||
if (pitBean4.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean4.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction2.setData(pitBean4);
|
||||
return;
|
||||
}
|
||||
RoomPitBean pitBean5 = mBinding.ivAuction3.pitBean;
|
||||
if (pitBean5.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
pitBean5.setIs_online(type == 1 ? 1 : 2);
|
||||
mBinding.ivAuction3.setData(pitBean5);
|
||||
return;
|
||||
}
|
||||
if (auctionList != null && auctionList.size() > 0) {
|
||||
for (int i = 0; i < auctionList.size(); i++) {
|
||||
RoomAuction.AuctionListBean auctionListBean = auctionList.get(i);
|
||||
int j = i;
|
||||
j++;
|
||||
if (j == 4) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline4.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
}
|
||||
} else if (j == 5) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline5.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
}
|
||||
} else if (j == 6) {
|
||||
if (auctionListBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||
mBinding.ivOnline6.setVisibility(type == 1 ? GONE : VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1087,14 +1091,14 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
// imActionYs.setVisibility(View.VISIBLE);
|
||||
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upVisibility( true);
|
||||
((RoomActivity) getActivity()).upVisibility(true);
|
||||
}
|
||||
// 用户上麦,根据权限显示按钮
|
||||
} else {
|
||||
getvjs();
|
||||
// imActionYs.setVisibility(INVISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upYs( false);
|
||||
((RoomActivity) getActivity()).upYs(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1107,7 +1111,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
getvjs();
|
||||
// imActionYs.setVisibility(GONE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upYs( false);
|
||||
((RoomActivity) getActivity()).upYs(false);
|
||||
}
|
||||
} else if (messageEvent.getText().getPit_number().equals("888")) {
|
||||
wheatView2.setData(getPitBean2(messageEvent, "888"));
|
||||
@@ -1122,7 +1126,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
getvjs();
|
||||
// imActionYs.setVisibility(GONE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upYs( false);
|
||||
((RoomActivity) getActivity()).upYs(false);
|
||||
}
|
||||
}
|
||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||
@@ -1184,14 +1188,14 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
// imActionYs.setVisibility(VISIBLE);
|
||||
// imActionJs.setVisibility(VISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upVisibility( true);
|
||||
((RoomActivity) getActivity()).upVisibility(true);
|
||||
}
|
||||
|
||||
} else {
|
||||
getvjs();
|
||||
// imActionYs.setVisibility(GONE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upJs( false);
|
||||
((RoomActivity) getActivity()).upJs(false);
|
||||
}
|
||||
}
|
||||
if (messageEvent.getText().getAuction_user().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
@@ -1242,24 +1246,74 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
}
|
||||
|
||||
public void event1005(RoomMessageEvent messageEvent) {
|
||||
if (mBinding.roomMakeWheat2.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
mBinding.tvPB.setText(messageEvent.getText().getToUserInfo().getCharm() + "");
|
||||
} else {
|
||||
if (mBinding.ivAuction1 != null && mBinding.ivAuction1.getUserId() != null) {
|
||||
if (mBinding.ivAuction1.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
RoomMakeWheatView wheatView = mBinding.ivAuction1;
|
||||
wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
wheatView.setData(wheatView.pitBean);
|
||||
} else if (mBinding.ivAuction2.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
RoomMakeWheatView wheatView = mBinding.ivAuction2;
|
||||
wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
wheatView.setData(wheatView.pitBean);
|
||||
} else if (mBinding.ivAuction3.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
RoomMakeWheatView wheatView = mBinding.ivAuction3;
|
||||
wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
wheatView.setData(wheatView.pitBean);
|
||||
}
|
||||
// 批量处理用户魅力值更新
|
||||
List<UserInfo> toUserInfos = messageEvent.getText().getToUserInfos();
|
||||
if (toUserInfos != null && !toUserInfos.isEmpty()) {
|
||||
for (UserInfo userInfo : toUserInfos) {
|
||||
updateCharmForUser(userInfo);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 单个用户处理
|
||||
UserInfo toUserInfo = messageEvent.getText().getToUserInfo();
|
||||
if (toUserInfo != null) {
|
||||
updateCharmForUser(toUserInfo);
|
||||
}
|
||||
|
||||
|
||||
// if (mBinding.roomMakeWheat2.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// mBinding.tvPB.setText(messageEvent.getText().getToUserInfo().getCharm() + "");
|
||||
// } else {
|
||||
// if (mBinding.ivAuction1 != null && mBinding.ivAuction1.getUserId() != null) {
|
||||
// if (mBinding.ivAuction1.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// RoomMakeWheatView wheatView = mBinding.ivAuction1;
|
||||
// wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// wheatView.setData(wheatView.pitBean);
|
||||
// } else if (mBinding.ivAuction2.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// RoomMakeWheatView wheatView = mBinding.ivAuction2;
|
||||
// wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// wheatView.setData(wheatView.pitBean);
|
||||
// } else if (mBinding.ivAuction3.getUserId().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// RoomMakeWheatView wheatView = mBinding.ivAuction3;
|
||||
// wheatView.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// wheatView.setData(wheatView.pitBean);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 优化后的用户魅力值更新方法
|
||||
* 通过映射表提高查找效率,避免重复的if-else判断
|
||||
*/
|
||||
private void updateCharmForUser(UserInfo userInfo) {
|
||||
if (userInfo == null) return;
|
||||
|
||||
String userId = String.valueOf(userInfo.getUser_id());
|
||||
String charm = userInfo.getCharm();
|
||||
|
||||
// 特殊处理拍卖主持人(888号麦位)
|
||||
if (wheatView2.getUserId().equals(userId)) {
|
||||
mBinding.tvPB.setText(StringUtil.toWan2(charm,1));
|
||||
wheatView2.pitBean.setCharm(charm);
|
||||
wheatView2.setData(wheatView2.pitBean);
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理拍卖麦位用户(111, 222, 333号麦位)
|
||||
RoomMakeWheatView targetWheatView = null;
|
||||
if (mBinding.ivAuction1.getUserId().equals(userId)) {
|
||||
targetWheatView = mBinding.ivAuction1;
|
||||
} else if (mBinding.ivAuction2.getUserId().equals(userId)) {
|
||||
targetWheatView = mBinding.ivAuction2;
|
||||
} else if (mBinding.ivAuction3.getUserId().equals(userId)) {
|
||||
targetWheatView = mBinding.ivAuction3;
|
||||
}
|
||||
|
||||
if (targetWheatView != null) {
|
||||
targetWheatView.pitBean.setCharm(charm);
|
||||
targetWheatView.setData(targetWheatView.pitBean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1278,7 +1332,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
mBinding.ivJp.setVisibility(INVISIBLE);
|
||||
// imActionYs.setVisibility(INVISIBLE);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upYs( false);
|
||||
((RoomActivity) getActivity()).upYs(false);
|
||||
}
|
||||
mBinding.tvDjTime.setVisibility(INVISIBLE);
|
||||
mBinding.tvRelation.setText("关系");
|
||||
|
||||
@@ -627,7 +627,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
public void quitRoom() {
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
LogUtils.e("lxj", "退出房间时间:" + TimeUtils.date2String(new Date())+":退出的roomId"+roomId);
|
||||
MessageListenerSingleton.reset(roomId);
|
||||
MessageListenerSingleton.quitGroup(roomId);
|
||||
((RoomActivity) getActivity()).quit();
|
||||
((RoomActivity) getActivity()).quitRoom2(roomId);
|
||||
if (label_id!=null && label_id.equals(LABEL_ID_MOVIE)){
|
||||
@@ -635,7 +635,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", AgoraManager.getInstance(getActivity()).getLastRoomId()).navigation();
|
||||
return;
|
||||
}else {
|
||||
((RoomActivity) getActivity()).performExitRoom();
|
||||
((RoomActivity) getActivity()).performExitRoom(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1057,6 +1057,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findRoom() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getVoiceStatus(RoomAuction.AuctionUserBean auctionUserBean, List<RoomAuction.AuctionListBean> auctionListBeans, String user_id) {
|
||||
boolean haveMe = false;
|
||||
@@ -1289,7 +1294,6 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
friendshipRoomFragment.event1004(messageEvent);
|
||||
break;
|
||||
case 1039:
|
||||
|
||||
friendshipRoomFragment.event1039(messageEvent);
|
||||
break;
|
||||
case 1035:
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.rtc.AgoraIsOPen;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
import com.xscm.moduleutil.rtc.MusicFileBean;
|
||||
import com.xscm.moduleutil.rtc.MusicPlayBean;
|
||||
@@ -158,12 +159,15 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
((RoomActivity) getActivity()).setRoleType(0, 0);
|
||||
}
|
||||
}
|
||||
AgoraManager.getInstance(getActivity()).stopMuisc();
|
||||
// AgoraManager.getInstance(getActivity()).stopMuisc()
|
||||
if (roomInfoResp.getSong_user_info().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
did = roomInfoResp.getSong_user_info().getDid();
|
||||
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()), 1);
|
||||
} else {
|
||||
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()), 2);
|
||||
if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
|
||||
AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
|
||||
}
|
||||
// AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()), 2);
|
||||
}
|
||||
musicSongBean = roomInfoResp.getSong_user_info();
|
||||
duration = roomInfoResp.getSong_user_info().getDuration();
|
||||
@@ -232,6 +236,14 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
}
|
||||
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void roomAgoraIsOPen(AgoraIsOPen isOPen) {
|
||||
// if (isOPen.isOpen()) {
|
||||
//
|
||||
// AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
@@ -680,13 +692,16 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
roomInfoResp.setSong_user_info(musicSongBean);
|
||||
|
||||
if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
AgoraManager.getInstance(getActivity()).stopMuisc();
|
||||
// AgoraManager.getInstance(getActivity()).stopMuisc();
|
||||
LogUtils.e("推送过来的code", messageEvent.getText().getSongInfo().getSong_code());
|
||||
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 1);
|
||||
|
||||
} else {
|
||||
AgoraManager.getInstance(getActivity()).stopMuisc();
|
||||
AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 2);
|
||||
// AgoraManager.getInstance(getActivity()).stopMuisc();
|
||||
if (AgoraManager.getInstance(getActivity()).isOnJoin()) {
|
||||
AgoraManager.getInstance(getActivity()).loadLrc(Long.parseLong(roomInfoResp.getSong_user_info().getSong_code()));
|
||||
}
|
||||
// AgoraManager.getInstance(getActivity()).isPreload(Long.parseLong(messageEvent.getText().getSongInfo().getSong_code()), 2);
|
||||
}
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
if (messageEvent.getText().getSongInfo().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
@@ -842,28 +857,89 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
}
|
||||
|
||||
public void event1005(RoomMessageEvent messageEvent) {
|
||||
RoomPitBean pitBean = mBinding.muYc.pitBean;
|
||||
if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(pitBean.getUser_id())) {
|
||||
pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
mBinding.muYc.setCharm(pitBean.getCharm());
|
||||
}
|
||||
|
||||
if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muZc.pitBean.getUser_id())) {
|
||||
mBinding.muZc.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
mBinding.muZc.setCharm(mBinding.muZc.pitBean.getCharm());
|
||||
return;
|
||||
}
|
||||
if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muJb.pitBean.getUser_id())) {
|
||||
mBinding.muJb.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
mBinding.muJb.setCharm(mBinding.muJb.pitBean.getCharm());
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
|
||||
if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// 处理批量用户魅力值更新
|
||||
List<UserInfo> toUserInfos = messageEvent.getText().getToUserInfos();
|
||||
|
||||
if (toUserInfos != null && !toUserInfos.isEmpty()) {
|
||||
// 批量更新处理
|
||||
for (UserInfo userInfo : toUserInfos) {
|
||||
updateCharmForUser(userInfo);
|
||||
}
|
||||
} else {
|
||||
// 单个用户更新处理
|
||||
UserInfo toUserInfo = messageEvent.getText().getToUserInfo();
|
||||
if (toUserInfo != null) {
|
||||
updateCharmForUser(toUserInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新麦位列表数据
|
||||
adapter.setNewData(roomInfoResp.getSong_pit_list());
|
||||
|
||||
|
||||
// RoomPitBean pitBean = mBinding.muYc.pitBean;
|
||||
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(pitBean.getUser_id())) {
|
||||
// pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.muYc.setCharm(pitBean.getCharm());
|
||||
// }
|
||||
//
|
||||
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muZc.pitBean.getUser_id())) {
|
||||
// mBinding.muZc.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.muZc.setCharm(mBinding.muZc.pitBean.getCharm());
|
||||
// return;
|
||||
// }
|
||||
// if ((messageEvent.getText().getToUserInfo().getUser_id() + "").equals(mBinding.muJb.pitBean.getUser_id())) {
|
||||
// mBinding.muJb.pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// mBinding.muJb.setCharm(mBinding.muJb.pitBean.getCharm());
|
||||
// return;
|
||||
// }
|
||||
// for (int i = 0; i < roomInfoResp.getSong_pit_list().size(); i++) {
|
||||
// if (roomInfoResp.getSong_pit_list().get(i).getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// roomInfoResp.getSong_pit_list().get(i).setCharm(messageEvent.getText().getToUserInfo().getCharm());
|
||||
// }
|
||||
// }
|
||||
// adapter.setNewData(roomInfoResp.getSong_pit_list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 优化后的用户魅力值更新方法
|
||||
* 统一处理单个用户的魅力值更新逻辑
|
||||
*/
|
||||
private void updateCharmForUser(UserInfo userInfo) {
|
||||
if (userInfo == null) return;
|
||||
|
||||
String userId = String.valueOf(userInfo.getUser_id());
|
||||
String charm = userInfo.getCharm();
|
||||
|
||||
// 更新主唱麦位
|
||||
if (userId.equals(mBinding.muYc.getUserId())) {
|
||||
RoomPitBean pitBean = mBinding.muYc.pitBean;
|
||||
pitBean.setCharm(charm);
|
||||
mBinding.muYc.setCharm(charm);
|
||||
}
|
||||
|
||||
// 更新主持麦位
|
||||
if (userId.equals(mBinding.muZc.getUserId())) {
|
||||
RoomPitBean pitBean = mBinding.muZc.pitBean;
|
||||
pitBean.setCharm(charm);
|
||||
mBinding.muZc.setCharm(charm);
|
||||
}
|
||||
|
||||
// 更新嘉宾麦位
|
||||
if (userId.equals(mBinding.muJb.getUserId())) {
|
||||
RoomPitBean pitBean = mBinding.muJb.pitBean;
|
||||
pitBean.setCharm(charm);
|
||||
mBinding.muJb.setCharm(charm);
|
||||
}
|
||||
|
||||
// 更新点唱列表中的用户
|
||||
for (RoomPitBean pitBean : roomInfoResp.getSong_pit_list()) {
|
||||
if (userId.equals(pitBean.getUser_id())) {
|
||||
pitBean.setCharm(charm);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: 2025/9/12 清除个人魅力
|
||||
@@ -1332,4 +1408,9 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findRoom() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@ import com.hjq.toast.ToastUtils;
|
||||
import com.luck.picture.lib.utils.DoubleUtils;
|
||||
import com.xscm.moduleutil.base.BaseRoomFragment;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomUpPitBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomUserJoinModel;
|
||||
@@ -1309,7 +1310,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
}
|
||||
}
|
||||
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
||||
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()!=null ? roomPitBean.getPit_number() : "0"));
|
||||
} else {
|
||||
wheatLayoutManager1.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
}
|
||||
@@ -1407,25 +1408,77 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
|
||||
/// 1005
|
||||
public void event1005(RoomMessageEvent message) {
|
||||
// 检查是否有多个用户信息
|
||||
if (message.getText().getToUserInfos() != null && !message.getText().getToUserInfos().isEmpty()) {
|
||||
// 处理多个用户的情况
|
||||
for (UserInfo userOnlineStatusBean : message.getText().getToUserInfos()) {
|
||||
updateCharmForUser(userOnlineStatusBean);
|
||||
}
|
||||
} else {
|
||||
// 处理单个用户的情况
|
||||
UserInfo toUserInfo = message.getText().getToUserInfo();
|
||||
if (toUserInfo != null) {
|
||||
updateCharmForUser(toUserInfo);
|
||||
}
|
||||
}
|
||||
// if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
||||
// for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
// if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
// wheatLayoutSingManager.upDataCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// for (RoomPitBean pitBean : roomInfoRespPk.getRoom_info().getPit_list()) {
|
||||
// if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
// wheatLayoutManager2.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
// if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
// pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
// wheatLayoutManager1.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新单个用户的魅力值
|
||||
* @param userInfo 用户信息
|
||||
*/
|
||||
private void updateCharmForUser(UserInfo userInfo) {
|
||||
String userId = String.valueOf(userInfo.getUser_id());
|
||||
String charm = userInfo.getCharm();
|
||||
|
||||
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
||||
// 非PK房间情况
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
if (pitBean.getUser_id().equals(userId)) {
|
||||
pitBean.setCharm(charm);
|
||||
wheatLayoutSingManager.upDataCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
break; // 找到后直接退出循环
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// PK房间情况
|
||||
// 更新PK房间的魅力值
|
||||
for (RoomPitBean pitBean : roomInfoRespPk.getRoom_info().getPit_list()) {
|
||||
if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
if (pitBean.getUser_id().equals(userId)) {
|
||||
pitBean.setCharm(charm);
|
||||
wheatLayoutManager2.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 更新主房间的魅力值
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
if (pitBean.getUser_id().equals(message.getText().getToUserInfo().getUser_id() + "")) {
|
||||
pitBean.setCharm(message.getText().getToUserInfo().getCharm());
|
||||
if (pitBean.getUser_id().equals(userId)) {
|
||||
pitBean.setCharm(charm);
|
||||
wheatLayoutManager1.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().getRoomOnline(roomOnlineBeans);
|
||||
MvpRef.get().findRoom();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -226,15 +227,6 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
if (roomInfoResp==null){
|
||||
MvpRef.get().postRoomInfo(null);
|
||||
}else {
|
||||
|
||||
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
|
||||
String token = roomInfoResp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
|
||||
String roomId = roomInfoResp.getRoom_info().getRoom_id(); // 房间 ID
|
||||
String rtm_token = roomInfoResp.getUser_info().getAgora_rtm_token();
|
||||
SpUtil.setRtmToken(rtm_token);
|
||||
int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
|
||||
boolean enableMic = false; // 是否开启麦克风
|
||||
|
||||
MvpRef.get().postRoomInfo(roomInfoResp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
tools:context=".activity.RoomActivity">
|
||||
|
||||
<data>
|
||||
@@ -38,7 +37,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<include
|
||||
@@ -46,7 +46,7 @@
|
||||
layout="@layout/room_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:elevation="2dp"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/l"
|
||||
android:layout_width="match_parent"
|
||||
@@ -49,35 +50,27 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <androidx.core.widget.NestedScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent">-->
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/l"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/dp_40"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
<!-- </androidx.core.widget.NestedScrollView>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -38,7 +38,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="false"
|
||||
app:srlEnableRefresh="true"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
Reference in New Issue
Block a user