Merge branch 'branch_new_dev' into branch_new

This commit is contained in:
2025-11-27 16:06:17 +08:00
5 changed files with 52 additions and 34 deletions

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.util.Log; import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ActivityUtils;
import com.xscm.moduleutil.base.CommonAppContext; import com.xscm.moduleutil.base.CommonAppContext;
public class CrashHandler implements Thread.UncaughtExceptionHandler { public class CrashHandler implements Thread.UncaughtExceptionHandler {
@@ -38,6 +39,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
private void restartApp() { private void restartApp() {
// 实现应用重启逻辑 // 实现应用重启逻辑
ARouter.getInstance().build(ARouteConstants.ME).navigation(); ARouter.getInstance().build(ARouteConstants.ME).navigation();
ActivityUtils.finishAllActivities();
CommonAppContext.getInstance().initialization(); CommonAppContext.getInstance().initialization();
} }
} }

View File

@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_40">
android:paddingVertical="@dimen/dp_5"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.xscm.moduleutil.widget.GifAvatarOvalView <com.xscm.moduleutil.widget.CircularImage
android:id="@+id/user_icon" android:id="@+id/user_icon"
android:layout_width="@dimen/dp_18" android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18" android:layout_height="match_parent"
android:layout_marginVertical="@dimen/dp_10"
android:src="@mipmap/default_avatar" android:src="@mipmap/default_avatar"
android:layout_marginStart="-5dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:riv_oval="true" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toEndOf="parent"/> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -525,7 +525,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
supportFragmentManager supportFragmentManager
) )
LogUtils.e("fragment: ${(fragment != null)}") LogUtils.e("fragment_onItemClickListener: ${(fragment != null)}")
if (fragment != null) { if (fragment != null) {
addActiveDialogFragment(fragment) // 添加到管理列表 addActiveDialogFragment(fragment) // 添加到管理列表
} }

View File

@@ -81,8 +81,18 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
@Override @Override
public void applyPit() { public void applyPit() {
}
public FriendshipRoomFragment() {
} }
public FriendshipRoomFragment(RoomInfoResp roomInfoResp) {
this.roomInfoResp = roomInfoResp;
}
public static FriendshipRoomFragment newInstance(RoomInfoResp roomInfoResp) {
FriendshipRoomFragment fragment = new FriendshipRoomFragment(roomInfoResp);
return fragment;
}
@Override @Override
public void endFriend(FriendUserBean friendUserBean) { public void endFriend(FriendUserBean friendUserBean) {
if (friendUserBean != null) { if (friendUserBean != null) {
@@ -152,17 +162,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
} }
public FriendshipRoomFragment(){}
public FriendshipRoomFragment(RoomInfoResp roomInfoResp){
this.roomInfoResp = roomInfoResp;
}
// TODO: Rename and change types and number of parameters
public static FriendshipRoomFragment newInstance(RoomInfoResp roomInfoResp) {
FriendshipRoomFragment fragment = new FriendshipRoomFragment(roomInfoResp);
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override @Override
@@ -239,6 +239,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
initPopupWindow(); initPopupWindow();
roomId = roomInfoResp.getRoom_info().getRoom_id(); roomId = roomInfoResp.getRoom_info().getRoom_id();
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) { for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i); RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
if (i == 6 || i == 7) { if (i == 6 || i == 7) {
@@ -358,13 +359,13 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
if (checkWeather(pitBean.getPit_number())) { if (checkWeather(pitBean.getPit_number())) {
showPopupMenu(wheatView); // v 是点击的按钮视图 showPopupMenu(wheatView); // v 是点击的按钮视图
} else if (pitBean.getPit_number().equals("10")) { } else if (pitBean.getPit_number().equals("10")) {
if (ActivityUtils.getTopActivity() instanceof RoomActivity){ if (ActivityUtils.getTopActivity() instanceof RoomActivity) {
if (((RoomActivity) ActivityUtils.getTopActivity()).getHostUser() < 4){ if (((RoomActivity) ActivityUtils.getTopActivity()).getHostUser() < 4) {
if (((RoomActivity) ActivityUtils.getTopActivity()).isFastDoubleClick(roomInfoResp.getUser_info().getUser_id()+"", pitBean.getPit_number())) { if (((RoomActivity) ActivityUtils.getTopActivity()).isFastDoubleClick(roomInfoResp.getUser_info().getUser_id() + "", pitBean.getPit_number())) {
return; return;
} }
RoomOnlineDialogFragment.show(roomId, "10", roomInfoResp.getUser_info(), roomInfoResp, getChildFragmentManager()); RoomOnlineDialogFragment.show(roomId, "10", roomInfoResp.getUser_info(), roomInfoResp, getChildFragmentManager());
}else { } else {
com.hjq.toast.ToastUtils.show("请等待主持抱麦"); com.hjq.toast.ToastUtils.show("请等待主持抱麦");
} }
} }
@@ -447,6 +448,11 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
if (fromUserInfo == null) return; if (fromUserInfo == null) return;
String pitNumber = messageEvent.getText().getPit_number(); String pitNumber = messageEvent.getText().getPit_number();
if (Integer.parseInt(pitNumber) == 7 || Integer.parseInt(pitNumber) == 8 || Integer.parseInt(pitNumber) > 10) {
return;
}
int userId = fromUserInfo.getUser_id(); int userId = fromUserInfo.getUser_id();
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean; RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
pitBean.setUser_id(userId + ""); pitBean.setUser_id(userId + "");
@@ -457,9 +463,9 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
pitBean.setDress(fromUserInfo.getDress()); pitBean.setDress(fromUserInfo.getDress());
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean); mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
if (userId == SpUtil.getUserId() ) { if (userId == SpUtil.getUserId()) {
myPitNumber=Integer.parseInt(pitNumber); myPitNumber = Integer.parseInt(pitNumber);
if (pitNumber.equals("9")){ if (pitNumber.equals("9")) {
configGameOptionBtn(); configGameOptionBtn();
} }
} }
@@ -469,6 +475,9 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
public void event1004(RoomMessageEvent messageEvent) { public void event1004(RoomMessageEvent messageEvent) {
String pitNumber = messageEvent.getText().getPit_number(); String pitNumber = messageEvent.getText().getPit_number();
if (Integer.parseInt(pitNumber) == 7 || Integer.parseInt(pitNumber) == 8 || Integer.parseInt(pitNumber) > 10) {
return;
}
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean; RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
pitBean.setUser_id(""); pitBean.setUser_id("");
pitBean.setAvatar(""); pitBean.setAvatar("");
@@ -477,10 +486,10 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
pitBean.setCharm(""); pitBean.setCharm("");
pitBean.setDress(""); pitBean.setDress("");
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean); mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
if (messageEvent.getText().getFromUserInfo()==null){ if (messageEvent.getText().getFromUserInfo() == null) {
return; return;
} }
if (SpUtil.getUserId()==messageEvent.getText().getFromUserInfo().getUser_id()){ if (SpUtil.getUserId() == messageEvent.getText().getFromUserInfo().getUser_id()) {
myPitNumber = -1; myPitNumber = -1;
if (pitNumber.equals("9")) { if (pitNumber.equals("9")) {
configGameOptionBtn(); configGameOptionBtn();
@@ -495,7 +504,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
if (i == 6 || i == 7) if (i == 6 || i == 7)
continue; continue;
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i); RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
if (Integer.parseInt(roomPitBean.getUser_id()) == message.getText().getFromUserInfo().getUser_id()){ if (Integer.parseInt(roomPitBean.getUser_id()) == message.getText().getFromUserInfo().getUser_id()) {
RoomFriendshipWheatView object = mWheatViews.get(i); RoomFriendshipWheatView object = mWheatViews.get(i);
if (object != null) { if (object != null) {
object.setData(roomPitBean); object.setData(roomPitBean);
@@ -511,6 +520,11 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
if (fromPit.equals("") || toPitNumber.equals("")) { if (fromPit.equals("") || toPitNumber.equals("")) {
return; return;
} }
if (Integer.parseInt(toPitNumber) == 7 || Integer.parseInt(toPitNumber) == 8 ||
Integer.parseInt(toPitNumber) > 10 ||
(Integer.parseInt(toPitNumber) == 0 || Integer.parseInt(fromPit) == 0)) {
return;
}
RoomFriendshipWheatView fromWheatView = mWheatViews.get(Integer.parseInt(fromPit) - 1); RoomFriendshipWheatView fromWheatView = mWheatViews.get(Integer.parseInt(fromPit) - 1);
RoomFriendshipWheatView toWheatView = mWheatViews.get(Integer.parseInt(toPitNumber) - 1); RoomFriendshipWheatView toWheatView = mWheatViews.get(Integer.parseInt(toPitNumber) - 1);
RoomPitBean fromPitBean = fromWheatView.pitBean; RoomPitBean fromPitBean = fromWheatView.pitBean;
@@ -680,6 +694,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
// 设置弹出视图中的点击事件 // 设置弹出视图中的点击事件
setPopupMenuClickListener(popupView, null); setPopupMenuClickListener(popupView, null);
} }
@SuppressLint("UseSwitchCompatOrMaterialCode") @SuppressLint("UseSwitchCompatOrMaterialCode")
private void setPopupMenuClickListener(View popupView, View view) { private void setPopupMenuClickListener(View popupView, View view) {
@@ -862,6 +877,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
// 可以根据需要更新其他UI元素 // 可以根据需要更新其他UI元素
} }
/** /**
* 心动数值变化 * 心动数值变化
*/ */

View File

@@ -89,14 +89,16 @@
android:gravity="center_vertical|right|center" android:gravity="center_vertical|right|center"
android:orientation="horizontal"> android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_recyclerView" android:id="@+id/user_recyclerView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_40"
android:layout_gravity="center" android:layout_gravity="center"
android:overScrollMode="never" android:overScrollMode="never"
tools:listitem="@layout/item_like_user"/> tools:listitem="@layout/item_like_user"/>
<TextView <TextView
android:id="@+id/tv_num" android:id="@+id/tv_num"
android:layout_width="@dimen/dp_30" android:layout_width="@dimen/dp_30"