1:修改换麦逻辑
2:添加闪屏不在直接关闭
This commit is contained in:
@@ -64,22 +64,22 @@ android {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 测试版配置
|
// // 测试版配置
|
||||||
beta {
|
// beta {
|
||||||
dimension "environment"
|
// dimension "environment"
|
||||||
// 测试版包名:基础包名 + .beta(com.example.myapp.beta)
|
// // 测试版包名:基础包名 + .beta(com.example.myapp.beta)
|
||||||
applicationIdSuffix ".beta"
|
// applicationIdSuffix ".beta"
|
||||||
// 测试版版本名:1.0-beta
|
// // 测试版版本名:1.0-beta
|
||||||
versionNameSuffix "-beta"
|
// versionNameSuffix "-beta"
|
||||||
|
//
|
||||||
// 【测试版应用名称】动态生成带标识的名称
|
// // 【测试版应用名称】动态生成带标识的名称
|
||||||
resValue "string", "app_name", "秘地-测试版"
|
// resValue "string", "app_name", "秘地-测试版"
|
||||||
|
//
|
||||||
// 【测试版图标】替换为测试专用图标
|
// // 【测试版图标】替换为测试专用图标
|
||||||
manifestPlaceholders = [
|
// manifestPlaceholders = [
|
||||||
appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
|
// appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
|
||||||
]
|
// ]
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ isBuildModule=false
|
|||||||
#org.gradle.deamon=false
|
#org.gradle.deamon=false
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
|
|
||||||
APP_VERSION_NAME=1.1.3
|
APP_VERSION_NAME=1.1.6
|
||||||
APP_VERSION_CODE=165
|
APP_VERSION_CODE=168
|
||||||
|
|
||||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
|||||||
//initLocation();
|
//initLocation();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
V2TIMManager.getInstance().addIMSDKListener(imSdkListener);
|
// V2TIMManager.getInstance().addIMSDKListener(imSdkListener);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,12 +136,15 @@ public abstract class BaseMvpActivity<P extends IPresenter, VDB extends ViewData
|
|||||||
@Override
|
@Override
|
||||||
public void onConnectSuccess() {//重连成功
|
public void onConnectSuccess() {//重连成功
|
||||||
if (CommonAppContext.getInstance().playId!=null){
|
if (CommonAppContext.getInstance().playId!=null){
|
||||||
|
LogUtils.e("@@@", "重连成功");
|
||||||
RetrofitClient.getInstance().roomUserReconnect(CommonAppContext.getInstance().playId);
|
RetrofitClient.getInstance().roomUserReconnect(CommonAppContext.getInstance().playId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnectFailed(int code, String error) {
|
public void onConnectFailed(int code, String error) {
|
||||||
|
LogUtils.e("@@@", "断开连接");
|
||||||
|
CommonAppContext.getInstance().onConnectFailed=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.xscm.moduleutil.bean.UserBean;
|
|||||||
import com.xscm.moduleutil.bean.UserInfo;
|
import com.xscm.moduleutil.bean.UserInfo;
|
||||||
import com.xscm.moduleutil.event.AppLifecycleEvent;
|
import com.xscm.moduleutil.event.AppLifecycleEvent;
|
||||||
import com.xscm.moduleutil.event.UnreadCountEvent;
|
import com.xscm.moduleutil.event.UnreadCountEvent;
|
||||||
|
import com.xscm.moduleutil.http.RetrofitClient;
|
||||||
import com.xscm.moduleutil.interfaces.AppLifecycleUtil;
|
import com.xscm.moduleutil.interfaces.AppLifecycleUtil;
|
||||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||||
@@ -52,6 +53,7 @@ import com.xscm.moduleutil.utils.SpUtil;
|
|||||||
import com.xscm.moduleutil.utils.UtilConfig;
|
import com.xscm.moduleutil.utils.UtilConfig;
|
||||||
import com.xscm.moduleutil.utils.config.EnvironmentEnum;
|
import com.xscm.moduleutil.utils.config.EnvironmentEnum;
|
||||||
import com.xscm.moduleutil.utils.config.EnvironmentPrefs;
|
import com.xscm.moduleutil.utils.config.EnvironmentPrefs;
|
||||||
|
import com.xscm.moduleutil.utils.IMServiceManager;
|
||||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||||
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
|
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
|
||||||
@@ -70,7 +72,9 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -126,6 +130,17 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
|
|
||||||
private AppStateListener appStateListener;
|
private AppStateListener appStateListener;
|
||||||
private boolean isListeningUnreadCount = false;
|
private boolean isListeningUnreadCount = false;
|
||||||
|
public boolean onConnectFailed=false;//是否重连
|
||||||
|
|
||||||
|
public Map<String, Integer> onlineMap=new HashMap<>();
|
||||||
|
|
||||||
|
public void setOnlineMap(Map<String, Integer> onlineMap) {
|
||||||
|
this.onlineMap = onlineMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getOnlineMap() {
|
||||||
|
return onlineMap;
|
||||||
|
}
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
@@ -441,6 +456,9 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
// 每次启动应用时重置状态
|
// 每次启动应用时重置状态
|
||||||
SpUtil.getInstance().setBooleanValue("youth_model_shown", false);
|
SpUtil.getInstance().setBooleanValue("youth_model_shown", false);
|
||||||
startInitSdk();
|
startInitSdk();
|
||||||
|
|
||||||
|
// 启动IM连接服务
|
||||||
|
// IMServiceManager.getInstance().startIMService(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// piaoPingManager = PiaoPingManager.getInstance(this);
|
// piaoPingManager = PiaoPingManager.getInstance(this);
|
||||||
@@ -790,6 +808,10 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityStarted(@NonNull Activity activity) {
|
public void onActivityStarted(@NonNull Activity activity) {
|
||||||
AppLifecycleUtil.onAppFrontGround();
|
AppLifecycleUtil.onAppFrontGround();
|
||||||
|
|
||||||
|
// if (playId!=null && !playId.equals("")){
|
||||||
|
// RetrofitClient.getInstance().userRoomBack(playId, "1");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -803,6 +825,9 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
// AppStateManager.setRoomActivityMinimized(false);
|
// AppStateManager.setRoomActivityMinimized(false);
|
||||||
AppLifecycleUtil.onAppFrontGround();
|
AppLifecycleUtil.onAppFrontGround();
|
||||||
}
|
}
|
||||||
|
if (playId!=null && !playId.equals("")){
|
||||||
|
RetrofitClient.getInstance().userRoomBack(playId, "2");
|
||||||
|
}
|
||||||
activityCount++;
|
activityCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,6 +839,11 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
if (appStateListener != null) {
|
if (appStateListener != null) {
|
||||||
appStateListener.onAppBackground();
|
appStateListener.onAppBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (playId!=null && !playId.equals("")){
|
||||||
|
RetrofitClient.getInstance().userRoomBack(playId, "1");
|
||||||
|
}
|
||||||
|
|
||||||
AppLifecycleUtil.onAppBackGround();
|
AppLifecycleUtil.onAppBackGround();
|
||||||
// handleAppBackground(activity);
|
// handleAppBackground(activity);
|
||||||
// AppStateManager.setRoomActivityMinimized( true);
|
// AppStateManager.setRoomActivityMinimized( true);
|
||||||
@@ -888,4 +918,10 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
// appStateListener.onRoomActivityDestroyed();
|
// appStateListener.onRoomActivityDestroyed();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTerminate() {
|
||||||
|
super.onTerminate();
|
||||||
|
LogUtils.e("@@@", "onTerminate");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ public interface ApiServer {
|
|||||||
@POST(Constants.BIND_MOBILE)
|
@POST(Constants.BIND_MOBILE)
|
||||||
Call<BaseModel<String>> mobileView2(@Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
|
Call<BaseModel<String>> mobileView2(@Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(Constants.USER_ROOM_BACK)
|
||||||
|
Call<ResponseBody> userRoomBack(@Field("room_id")String room_id,@Field("type")String type);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(Constants.USER_LOGIN)
|
@POST(Constants.USER_LOGIN)
|
||||||
Call<BaseModel<List<UserBean>>> userLogin(@Field("user_login") String user_login, @Field("password") String password);
|
Call<BaseModel<List<UserBean>>> userLogin(@Field("user_login") String user_login, @Field("password") String password);
|
||||||
|
|||||||
@@ -292,6 +292,20 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void userRoomBack(String room_id,String type){//用户退出前后台保留数据操作 type:1:切后台 2:切前台
|
||||||
|
sApiServer.userRoomBack(room_id,type).enqueue(new Callback<ResponseBody>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void mobileView2(String new_mobile, String sms_code, BaseObserver<String> observer) {
|
public void mobileView2(String new_mobile, String sms_code, BaseObserver<String> observer) {
|
||||||
sApiServer.mobileView2(new_mobile, sms_code).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.mobileView2(new_mobile, sms_code).enqueue(new Callback<BaseModel<String>>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class EnvironmentPrefs {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 默认使用生产环境
|
// 默认使用生产环境
|
||||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.TEST.name());
|
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
|
||||||
try {
|
try {
|
||||||
return EnvironmentEnum.valueOf(envName);
|
return EnvironmentEnum.valueOf(envName);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
|||||||
|
|
||||||
import com.opensource.svgaplayer.SVGAImageView;
|
import com.opensource.svgaplayer.SVGAImageView;
|
||||||
import com.xscm.moduleutil.R;
|
import com.xscm.moduleutil.R;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.base.RoomRollModel;
|
import com.xscm.moduleutil.base.RoomRollModel;
|
||||||
import com.xscm.moduleutil.bean.FaceBean;
|
import com.xscm.moduleutil.bean.FaceBean;
|
||||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||||
@@ -39,6 +40,8 @@ import org.greenrobot.eventbus.EventBus;
|
|||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class BaseWheatView extends ConstraintLayout implements IBaseWheat {
|
public abstract class BaseWheatView extends ConstraintLayout implements IBaseWheat {
|
||||||
public ImageView mRiv;
|
public ImageView mRiv;
|
||||||
public ImageView mIvGift;
|
public ImageView mIvGift;
|
||||||
@@ -108,6 +111,9 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
oX = mIvGift.getX();
|
oX = mIvGift.getX();
|
||||||
oY = mIvGift.getY();
|
oY = mIvGift.getY();
|
||||||
initPit(context, attrs);
|
initPit(context, attrs);
|
||||||
|
if (!EventBus.getDefault().isRegistered( this)){
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void initPit(Context context, AttributeSet attrs);
|
protected abstract void initPit(Context context, AttributeSet attrs);
|
||||||
@@ -162,11 +168,22 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
|
|
||||||
setCardiac(pitBean.getCharm(), getTzbl());
|
setCardiac(pitBean.getCharm(), getTzbl());
|
||||||
setPitData(bean);
|
setPitData(bean);
|
||||||
if (bean.getIs_online() == 2 && bean.getUser_id()!=null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()){
|
|
||||||
iv_on_line.setVisibility(VISIBLE);
|
if (bean.getUser_id()!=null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) {
|
||||||
|
if (CommonAppContext.getInstance().getOnlineMap()!=null&&CommonAppContext.getInstance().getOnlineMap().get(bean.getUser_id())!=null) {
|
||||||
|
iv_on_line.setVisibility(CommonAppContext.getInstance().getOnlineMap().get(bean.getUser_id()) == 1 ? GONE : VISIBLE);
|
||||||
|
}else {
|
||||||
|
iv_on_line.setVisibility(GONE);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
iv_on_line.setVisibility(GONE);
|
iv_on_line.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (bean.getIs_online() == 2 && bean.getUser_id()!=null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()){
|
||||||
|
// iv_on_line.setVisibility(VISIBLE);
|
||||||
|
// }else {
|
||||||
|
// iv_on_line.setVisibility(GONE);
|
||||||
|
// }
|
||||||
// if (bean.getIs_online() == 0 &&bean.getUser_id() != null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) {
|
// if (bean.getIs_online() == 0 &&bean.getUser_id() != null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) {
|
||||||
// iv_on_line.setVisibility(VISIBLE);
|
// iv_on_line.setVisibility(VISIBLE);
|
||||||
// } else {
|
// } else {
|
||||||
@@ -241,6 +258,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
if (soundLevel == 0) {
|
if (soundLevel == 0) {
|
||||||
mIvRipple.post(() -> {
|
mIvRipple.post(() -> {
|
||||||
mIvRipple.stopAnimation(true);
|
mIvRipple.stopAnimation(true);
|
||||||
|
CommonAppContext.getInstance().onlineMap.put(pitBean.getUser_id(),1);
|
||||||
mIvRipple.setVisibility(GONE);
|
mIvRipple.setVisibility(GONE);
|
||||||
});
|
});
|
||||||
mIvRipple.setVisibility(GONE);
|
mIvRipple.setVisibility(GONE);
|
||||||
@@ -249,8 +267,9 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
mIvRipple.post(() -> {
|
mIvRipple.post(() -> {
|
||||||
if (!mIvRipple.isAnimating()) {
|
if (!mIvRipple.isAnimating()) {
|
||||||
mIvRipple.startAnimation();
|
mIvRipple.startAnimation();
|
||||||
|
CommonAppContext.getInstance().onlineMap.put(pitBean.getUser_id(),1);
|
||||||
|
iv_on_line.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
iv_on_line.setVisibility(GONE);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -269,8 +288,9 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
mIvRipple.post(() -> {
|
mIvRipple.post(() -> {
|
||||||
if (!mIvRipple.isAnimating()) {
|
if (!mIvRipple.isAnimating()) {
|
||||||
mIvRipple.startAnimation();
|
mIvRipple.startAnimation();
|
||||||
|
CommonAppContext.getInstance().onlineMap.put(pitBean.getUser_id(),1);
|
||||||
|
iv_on_line.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
iv_on_line.setVisibility(GONE);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -351,18 +371,27 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void setOnlineStatus() {
|
||||||
|
// if (pitBean!=null) {
|
||||||
|
// if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
||||||
|
// if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
|
||||||
|
// if (isOnline.getIs_online() == 1) {
|
||||||
|
// iv_on_line.setVisibility(GONE);
|
||||||
|
// } else {
|
||||||
|
// iv_on_line.setVisibility(VISIBLE);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
public void setOnlineStatus(UserOnlineStatusBean isOnline) {
|
if (pitBean.getUser_id()!=null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
||||||
if (pitBean!=null) {
|
if (CommonAppContext.getInstance().getOnlineMap()!=null&&CommonAppContext.getInstance().getOnlineMap().get(pitBean.getUser_id())!=null) {
|
||||||
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
iv_on_line.setVisibility(CommonAppContext.getInstance().getOnlineMap().get(pitBean.getUser_id()) == 1 ? GONE : VISIBLE);
|
||||||
if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
|
}else {
|
||||||
if (isOnline.getIs_online() == 1) {
|
iv_on_line.setVisibility(GONE);
|
||||||
iv_on_line.setVisibility(GONE);
|
|
||||||
} else {
|
|
||||||
iv_on_line.setVisibility(VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
iv_on_line.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -390,6 +390,7 @@ public class Constants {
|
|||||||
public static final String POST_ROOM_USER_CHARM_LIST = "/api/Room/room_user_charm_list";//房间用户当前魅力值列表
|
public static final String POST_ROOM_USER_CHARM_LIST = "/api/Room/room_user_charm_list";//房间用户当前魅力值列表
|
||||||
public static final String GET_GIFT_PACK_LIST_COUNT = "/api/UserGiftPack/get_gift_pack_list_count";//背包礼物总价值
|
public static final String GET_GIFT_PACK_LIST_COUNT = "/api/UserGiftPack/get_gift_pack_list_count";//背包礼物总价值
|
||||||
public static final String ROOM_USER_RECONNECT = "/api/Room/user_reconnect";//用户重连
|
public static final String ROOM_USER_RECONNECT = "/api/Room/user_reconnect";//用户重连
|
||||||
|
public static final String USER_ROOM_BACK = "/api/Room/user_in_room_background";//用户在房间内切后台保留数据操作
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -298,17 +298,17 @@ public class RoomFriendshipWheatView extends BaseWheatView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOnlineStatus(UserOnlineStatusBean isOnline) {
|
// public void setOnlineStatus(UserOnlineStatusBean isOnline) {
|
||||||
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
// if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
||||||
if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
|
// if (pitBean.getUser_id().equals(isOnline.getUser_id())) {
|
||||||
if (isOnline.getIs_online() == 1) {
|
// if (isOnline.getIs_online() == 1) {
|
||||||
// iv_on_line.setVisibility(GONE);
|
//// iv_on_line.setVisibility(GONE);
|
||||||
} else {
|
// } else {
|
||||||
// iv_on_line.setVisibility(VISIBLE);
|
//// iv_on_line.setVisibility(VISIBLE);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// 设置是否显示助力按钮
|
/// 设置是否显示助力按钮
|
||||||
public void setLockZl(boolean lock) {
|
public void setLockZl(boolean lock) {
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ public class WheatLayoutManager {
|
|||||||
int pitNumber = Integer.parseInt(pitBean.getPit_number());
|
int pitNumber = Integer.parseInt(pitBean.getPit_number());
|
||||||
RoomDefaultWheatView wheatView = findWheatViewByPitNumber(pitNumber);
|
RoomDefaultWheatView wheatView = findWheatViewByPitNumber(pitNumber);
|
||||||
if (wheatView != null) {
|
if (wheatView != null) {
|
||||||
wheatView.setOnlineStatus(bean);
|
wheatView.setOnlineStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.xscm.moduleutil.R;
|
import com.xscm.moduleutil.R;
|
||||||
|
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||||
|
import com.xscm.moduleutil.utils.SpUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -381,6 +383,40 @@ public class WheatLayoutSingManager {
|
|||||||
return metrics.widthPixels;
|
return metrics.widthPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUpData(RoomMessageEvent event){
|
||||||
|
String fromPit=event.getText().getFrom_pit_number()!=null?event.getText().getFrom_pit_number():"";
|
||||||
|
String toPitNumber=event.getText().getTo_pit_number()!=null?event.getText().getTo_pit_number():"";
|
||||||
|
if (fromPit.equals("") || toPitNumber.equals("")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RoomSingSongWheatView fromWheatView = findWheatViewByPitNumber(Integer.parseInt(fromPit));
|
||||||
|
RoomSingSongWheatView toWheatView = findWheatViewByPitNumber(Integer.parseInt(toPitNumber));
|
||||||
|
RoomPitBean fromPitBean=fromWheatView.pitBean;
|
||||||
|
RoomPitBean toPitBean=toWheatView.pitBean;
|
||||||
|
String tmpNumber=fromPitBean.getPit_number();
|
||||||
|
fromPitBean.setPit_number(toPitBean.getPit_number());
|
||||||
|
toPitBean.setPit_number(tmpNumber);
|
||||||
|
toWheatView.setData(fromPitBean);
|
||||||
|
fromWheatView.setData(toPitBean);
|
||||||
|
for (RoomSingSongWheatView view : multiWheatViews){
|
||||||
|
if (view.pitBean.getUser_id().equals(event.getText().getFromUserInfo().getUser_id()+"")){
|
||||||
|
if (!view.pitBean.getPit_number().equals(toPitNumber)){
|
||||||
|
RoomPitBean bean=view.pitBean;
|
||||||
|
bean.setCharm("");
|
||||||
|
bean.setUser_id("");
|
||||||
|
bean.setDress("");
|
||||||
|
bean.setAvatar("");
|
||||||
|
bean.setNickname("");
|
||||||
|
bean.setSex("");
|
||||||
|
bean.setUser_code("");
|
||||||
|
bean.setDress_picture("");
|
||||||
|
view.setData(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新指定 pitNumber 的麦位信息(用于局部刷新)
|
* 更新指定 pitNumber 的麦位信息(用于局部刷新)
|
||||||
*/
|
*/
|
||||||
@@ -478,7 +514,7 @@ public class WheatLayoutSingManager {
|
|||||||
int pitNumber = Integer.parseInt(pitBean.getPit_number());
|
int pitNumber = Integer.parseInt(pitBean.getPit_number());
|
||||||
RoomSingSongWheatView wheatView = findWheatViewByPitNumber(pitNumber);
|
RoomSingSongWheatView wheatView = findWheatViewByPitNumber(pitNumber);
|
||||||
if (wheatView != null) {
|
if (wheatView != null) {
|
||||||
wheatView.setOnlineStatus(bean); // 刷新数据
|
wheatView.setOnlineStatus(); // 刷新数据
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ import com.orhanobut.logger.Logger
|
|||||||
import com.petterp.floatingx.assist.helper.FxScopeHelper
|
import com.petterp.floatingx.assist.helper.FxScopeHelper
|
||||||
import com.petterp.floatingx.listener.control.IFxControl
|
import com.petterp.floatingx.listener.control.IFxControl
|
||||||
import com.tencent.imsdk.v2.V2TIMManager
|
import com.tencent.imsdk.v2.V2TIMManager
|
||||||
|
import com.tencent.imsdk.v2.V2TIMSDKListener
|
||||||
|
import com.tencent.imsdk.v2.V2TIMUserFullInfo
|
||||||
import com.tencent.imsdk.v2.V2TIMValueCallback
|
import com.tencent.imsdk.v2.V2TIMValueCallback
|
||||||
import com.xscm.moduleutil.activity.BaseMvpActivity
|
import com.xscm.moduleutil.activity.BaseMvpActivity
|
||||||
import com.xscm.moduleutil.adapter.CommonPageAdapter
|
import com.xscm.moduleutil.adapter.CommonPageAdapter
|
||||||
@@ -161,8 +163,7 @@ import java.util.stream.Collectors
|
|||||||
|
|
||||||
@Route(path = ARouteConstants.ROOM_DETAILS)
|
@Route(path = ARouteConstants.ROOM_DETAILS)
|
||||||
class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||||
RoomContacts.View, PermissionCallbacks, OnMessageReceivedListener
|
RoomContacts.View, PermissionCallbacks, OnMessageReceivedListener {
|
||||||
{
|
|
||||||
private var roomFragment: RoomFragment? = null
|
private var roomFragment: RoomFragment? = null
|
||||||
var commonPageAdapter: CommonPageAdapter? = null
|
var commonPageAdapter: CommonPageAdapter? = null
|
||||||
private var mRoomBean: RoomBean? = null
|
private var mRoomBean: RoomBean? = null
|
||||||
@@ -670,8 +671,45 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
// 恢复房间状态
|
// 恢复房间状态
|
||||||
resumeRoomState()
|
resumeRoomState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
V2TIMManager.getInstance().addIMSDKListener(imSdkListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private val imSdkListener = object : V2TIMSDKListener() {
|
||||||
|
override fun onConnecting() {}
|
||||||
|
|
||||||
|
override fun onConnectSuccess() { //重连成功
|
||||||
|
if (CommonAppContext.getInstance().playId != null) {
|
||||||
|
LogUtils.e("@@@", "重连成功")
|
||||||
|
RetrofitClient.getInstance().roomUserReconnect(CommonAppContext.getInstance().playId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onConnectFailed(code: Int, error: String?) {
|
||||||
|
LogUtils.e("@@@", "断开连接")
|
||||||
|
CommonAppContext.getInstance().onConnectFailed = true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onKickedOffline() {
|
||||||
|
// queren1();
|
||||||
|
if (CommonAppContext.getInstance().playId != null) {
|
||||||
|
ToastUtils.show("您的账号已被挤下线")
|
||||||
|
try {
|
||||||
|
CommonAppContext.getInstance().clearLoginInfo()
|
||||||
|
} catch (e: ClassNotFoundException) {
|
||||||
|
throw RuntimeException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onUserSigExpired() {}
|
||||||
|
|
||||||
|
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun setview(resp: RoomInfoResp) {
|
private fun setview(resp: RoomInfoResp) {
|
||||||
this.mRoomInfoResp = resp
|
this.mRoomInfoResp = resp
|
||||||
val roomBean = resp.room_info
|
val roomBean = resp.room_info
|
||||||
@@ -1501,6 +1539,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
} else if (msgType == 1028) {
|
} else if (msgType == 1028) {
|
||||||
roomFragment!!.handleMsgType1028(messageEvent)
|
roomFragment!!.handleMsgType1028(messageEvent)
|
||||||
} else if (msgType == 1058) {
|
} else if (msgType == 1058) {
|
||||||
|
var userId = messageEvent!!.text!!.user_id!!
|
||||||
|
LogUtils.e("messageEvent!!.text.type"+messageEvent!!.text.type)
|
||||||
|
CommonAppContext.getInstance().onlineMap.set(
|
||||||
|
userId?.toString() ?: "",
|
||||||
|
messageEvent!!.text.type
|
||||||
|
)
|
||||||
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
|
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
|
||||||
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" ||
|
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" ||
|
||||||
mRoomInfoResp!!.room_info.type_id == "4" || mRoomInfoResp!!.room_info.type_id == "8"
|
mRoomInfoResp!!.room_info.type_id == "4" || mRoomInfoResp!!.room_info.type_id == "8"
|
||||||
@@ -1516,6 +1560,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
roomFragment!!.friendshipRoomFragmentEvent(messageEvent)
|
roomFragment!!.friendshipRoomFragmentEvent(messageEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommonAppContext.getInstance().getOnlineMap()
|
||||||
} else if (msgType == 1059) { // 1059清除个人魅力 1058在离线
|
} else if (msgType == 1059) { // 1059清除个人魅力 1058在离线
|
||||||
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
|
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
|
||||||
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" ||
|
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" ||
|
||||||
@@ -1664,10 +1710,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
|
|
||||||
val pitList = mRoomInfoResp!!.room_info.pit_list
|
val pitList = mRoomInfoResp!!.room_info.pit_list
|
||||||
if (pitList != null && !pitList.isEmpty()) {
|
if (pitList != null && !pitList.isEmpty()) {
|
||||||
pitMap.clear() // 避免数据累积
|
// pitMap.clear() // 避免数据累积
|
||||||
for (roomPitBean in pitList) {
|
// for (roomPitBean in pitList) {
|
||||||
pitMap[roomPitBean.pit_number] = roomPitBean
|
// pitMap[roomPitBean.pit_number] = roomPitBean
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (text == null) {
|
if (text == null) {
|
||||||
return
|
return
|
||||||
@@ -1688,104 +1734,97 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
toPitNumber: String,
|
toPitNumber: String,
|
||||||
messageEvent: RoomMessageEvent
|
messageEvent: RoomMessageEvent
|
||||||
) {
|
) {
|
||||||
if (TextUtils.isEmpty(fromPitNumber) || TextUtils.isEmpty(toPitNumber)) {
|
mRoomInfoResp!!.user_info.pit_number = Integer.parseInt(toPitNumber)
|
||||||
return
|
// if (TextUtils.isEmpty(fromPitNumber) || TextUtils.isEmpty(toPitNumber)) {
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) {
|
////
|
||||||
LogUtils.e("Room info is null")
|
// if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) {
|
||||||
return
|
// LogUtils.e("Room info is null")
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
val pitList = mRoomInfoResp!!.room_info.pit_list
|
////
|
||||||
if (pitList == null || pitList.isEmpty()) {
|
// val pitList = mRoomInfoResp!!.room_info.pit_list
|
||||||
LogUtils.e("pit_list is null or empty")
|
// if (pitList == null || pitList.isEmpty()) {
|
||||||
return
|
// LogUtils.e("pit_list is null or empty")
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
var fromBean: RoomPitBean? = null
|
////
|
||||||
var toBean: RoomPitBean? = null
|
// var fromBean: RoomPitBean? = null
|
||||||
val pitListCopy: MutableList<RoomPitBean> = ArrayList()
|
// var toBean: RoomPitBean? = null
|
||||||
|
// val pitListCopy: MutableList<RoomPitBean> = ArrayList()
|
||||||
for (bean in pitList) {
|
//
|
||||||
if (bean == null) continue
|
// for (bean in pitList) {
|
||||||
if (fromPitNumber == bean.pit_number) {
|
// if (bean == null) continue
|
||||||
fromBean = bean
|
// if (fromPitNumber == bean.pit_number) {
|
||||||
pitListCopy.add(bean)
|
// fromBean = bean
|
||||||
} else if (toPitNumber == bean.pit_number) {
|
// pitListCopy.add(bean)
|
||||||
toBean = bean
|
// } else if (toPitNumber == bean.pit_number) {
|
||||||
pitListCopy.add(bean)
|
// toBean = bean
|
||||||
}
|
// pitListCopy.add(bean)
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
if (fromBean == null || toBean == null) {
|
//
|
||||||
LogUtils.e("Cannot find pit number: from=$fromPitNumber, to=$toPitNumber")
|
// if (fromBean == null || toBean == null) {
|
||||||
return
|
// LogUtils.e("Cannot find pit number: from=$fromPitNumber, to=$toPitNumber")
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
// 交换 pit_number
|
//
|
||||||
val temp = fromBean.pit_number
|
// // 交换 pit_number
|
||||||
fromBean.pit_number = toBean.pit_number
|
// val temp = fromBean.pit_number
|
||||||
toBean.pit_number = temp
|
// fromBean.pit_number = toBean.pit_number
|
||||||
|
// toBean.pit_number = temp
|
||||||
// 构造新的 pitList
|
//
|
||||||
val newPitList: MutableList<RoomPitBean> = ArrayList()
|
// // 构造新的 pitList
|
||||||
for (bean in pitList) {
|
// val newPitList: MutableList<RoomPitBean> = ArrayList()
|
||||||
if (!pitListCopy.contains(bean)) {
|
// for (bean in pitList) {
|
||||||
newPitList.add(bean)
|
// if (!pitListCopy.contains(bean)) {
|
||||||
}
|
// newPitList.add(bean)
|
||||||
}
|
// }
|
||||||
newPitList.add(fromBean)
|
// }
|
||||||
newPitList.add(toBean)
|
// newPitList.add(fromBean)
|
||||||
// 排序 - 更简洁的 Kotlin 写法
|
// newPitList.add(toBean)
|
||||||
newPitList.sortWith(compareBy {
|
//// 排序 - 更简洁的 Kotlin 写法
|
||||||
try {
|
// newPitList.sortWith(compareBy {
|
||||||
it.pit_number.toInt()
|
|
||||||
} catch (e: NumberFormatException) {
|
|
||||||
it.pit_number
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// // 排序
|
|
||||||
// newPitList.sort(java.util.Comparator<RoomPitBean> { a: RoomPitBean, b: RoomPitBean ->
|
|
||||||
// try {
|
// try {
|
||||||
// return@sort Integer.compare(a.pit_number.toInt(), b.pit_number.toInt())
|
// it.pit_number.toInt()
|
||||||
// } catch (e: NumberFormatException) {
|
// } catch (e: NumberFormatException) {
|
||||||
// return@sort a.pit_number.compareTo(b.pit_number)
|
// it.pit_number
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
|
//
|
||||||
mRoomInfoResp!!.room_info.pit_list = newPitList
|
// mRoomInfoResp!!.room_info.pit_list = newPitList
|
||||||
|
//
|
||||||
// 更新当前用户 pit_number
|
// // 更新当前用户 pit_number
|
||||||
if (mRoomInfoResp!!.user_info != null) {
|
// if (mRoomInfoResp!!.user_info != null) {
|
||||||
val currentUserId = SpUtil.getUserId().toString()
|
// val currentUserId = SpUtil.getUserId().toString()
|
||||||
val fromUserId = fromBean.user_id
|
// val fromUserId = fromBean.user_id
|
||||||
val toUserId = toBean.user_id
|
// val toUserId = toBean.user_id
|
||||||
|
//
|
||||||
if (fromUserId != null && fromUserId == currentUserId) {
|
// if (fromUserId != null && fromUserId == currentUserId) {
|
||||||
try {
|
// try {
|
||||||
mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
// mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
||||||
} catch (e: NumberFormatException) {
|
// } catch (e: NumberFormatException) {
|
||||||
LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
// LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
||||||
}
|
// }
|
||||||
} else if (toUserId != null && toUserId == currentUserId) {
|
// } else if (toUserId != null && toUserId == currentUserId) {
|
||||||
try {
|
// try {
|
||||||
mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
// mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
||||||
} catch (e: NumberFormatException) {
|
// } catch (e: NumberFormatException) {
|
||||||
LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
// LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
dispatchRoomEvent(messageEvent)
|
dispatchRoomEvent(messageEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun dispatchRoomEvent(messageEvent: RoomMessageEvent) {
|
private fun dispatchRoomEvent(messageEvent: RoomMessageEvent) {
|
||||||
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return
|
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return
|
||||||
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
val typeId = mRoomInfoResp!!.room_info.type_id
|
val typeId = mRoomInfoResp!!.room_info.type_id
|
||||||
if ("2" == typeId) {
|
if ("2" == typeId) {
|
||||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
|
||||||
roomFragment!!.handleAuctionMessageEvent(messageEvent)
|
roomFragment!!.handleAuctionMessageEvent(messageEvent)
|
||||||
} else if ("3" == typeId || "4" == typeId || "1" == typeId || "8" == typeId) {
|
} else if ("3" == typeId || "4" == typeId || "1" == typeId || "8" == typeId) {
|
||||||
val labelId = mRoomInfoResp!!.room_info.label_id
|
val labelId = mRoomInfoResp!!.room_info.label_id
|
||||||
@@ -1886,7 +1925,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CommonAppContext.getInstance().onlineMap.clear()
|
||||||
MvpPre!!.postRoomInfo(roomId)
|
MvpPre!!.postRoomInfo(roomId)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1955,6 +1994,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if ("2" == labelId) {
|
if ("2" == labelId) {
|
||||||
roomFragment!!.KtvFragmentEvent(messageEvent)
|
roomFragment!!.KtvFragmentEvent(messageEvent)
|
||||||
} else if ("1" == labelId) {
|
} else if ("1" == labelId) {
|
||||||
|
mRoomInfoResp!!.room_info.pit_list.set(pitNumber.toInt()-1, getPitBean(messageEvent))
|
||||||
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
roomFragment!!.SingSongEvent(messageEvent)
|
roomFragment!!.SingSongEvent(messageEvent)
|
||||||
}
|
}
|
||||||
} else if ("7" == typeId) {
|
} else if ("7" == typeId) {
|
||||||
@@ -2030,6 +2071,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if ("2" == labelId) {
|
if ("2" == labelId) {
|
||||||
roomFragment!!.KtvFragmentEvent(messageEvent)
|
roomFragment!!.KtvFragmentEvent(messageEvent)
|
||||||
} else if ("1" == labelId) {
|
} else if ("1" == labelId) {
|
||||||
|
mRoomInfoResp!!.room_info.pit_list.set(pitNumber.toInt()-1, getPitBean2(messageEvent,pitNumber))
|
||||||
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
roomFragment!!.SingSongEvent(messageEvent)
|
roomFragment!!.SingSongEvent(messageEvent)
|
||||||
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId().toString() + "") {
|
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId().toString() + "") {
|
||||||
ivSoundEffects(false)
|
ivSoundEffects(false)
|
||||||
@@ -2113,6 +2156,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (text == null || text.fromUserInfo == null) return
|
if (text == null || text.fromUserInfo == null) return
|
||||||
|
|
||||||
if (text.fromUserInfo.user_id == SpUtil.getUserId()) {
|
if (text.fromUserInfo.user_id == SpUtil.getUserId()) {
|
||||||
|
LogUtils.e("退出房间")
|
||||||
MvpPre!!.quitRoom(roomId, SpUtil.getUserId().toString() + "")
|
MvpPre!!.quitRoom(roomId, SpUtil.getUserId().toString() + "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3340,10 +3384,30 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding!!.xlhRk.visibility = View.INVISIBLE
|
mBinding!!.xlhRk.visibility = View.INVISIBLE
|
||||||
releaseCountDownTimer1()
|
releaseCountDownTimer1()
|
||||||
}
|
}
|
||||||
|
// tzblChanged()
|
||||||
// sharedViewModel.setDataForFragment(mRoomInfoResp);
|
// sharedViewModel.setDataForFragment(mRoomInfoResp);
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
protected fun tzblChanged() {
|
||||||
|
// mBinding.dhv9.updateTzbl(SpUtil.getTzbl(roomId));
|
||||||
|
|
||||||
|
val userIds = StringBuilder()
|
||||||
|
for (i in 0 until mRoomInfoResp!!.room_info!!.pit_list!!.size) {
|
||||||
|
val userId = mRoomInfoResp!!.room_info!!.pit_list[i]!!.user_id!!
|
||||||
|
if (userId != null && userId != "0" && userId.isNotEmpty()) {
|
||||||
|
if (userIds.isNotEmpty()) {
|
||||||
|
userIds.append(",")
|
||||||
|
}
|
||||||
|
userIds.append(userId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userIds.isNotEmpty() && roomId != null) {
|
||||||
|
MvpPre!!.userOnlineStatus(userIds.toString(), roomId)
|
||||||
|
} else {
|
||||||
|
// updateWheatData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun instView() { //隐藏视图
|
private fun instView() { //隐藏视图
|
||||||
|
|
||||||
@@ -3623,7 +3687,16 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
CommonAppContext.getInstance().isRoomJoininj = false
|
CommonAppContext.getInstance().isRoomJoininj = false
|
||||||
// 当Activity恢复时,重置标记
|
// 当Activity恢复时,重置标记
|
||||||
userLeaving = true
|
userLeaving = true
|
||||||
|
RetrofitClient.getInstance().roomUserReconnect(CommonAppContext.getInstance().playId)
|
||||||
|
if(CommonAppContext.getInstance().onConnectFailed){//判断是否有有过断开腾讯IM
|
||||||
|
CommonAppContext.getInstance().onConnectFailed=false
|
||||||
|
if (CommonAppContext.getInstance().playId!=null && !CommonAppContext.getInstance().playId.isEmpty()) { //判断是否有roomId
|
||||||
|
LogUtils.e("RoomActivity", "onResume playId:"+CommonAppContext.getInstance().playId)
|
||||||
|
MvpPre!!.postRoomInfo(CommonAppContext.getInstance().playId)//当有过断开,然后重新连接
|
||||||
|
LogUtils.e("RoomActivity", "onResume playId:"+CommonAppContext.getInstance().playId)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // 正常启动或从后台恢复
|
// // 正常启动或从后台恢复
|
||||||
// if (isInBackground) {
|
// if (isInBackground) {
|
||||||
@@ -4064,7 +4137,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
for (i in list.indices) {
|
for (i in list.indices) {
|
||||||
val userOnlineStatusBean = list[i]
|
val userOnlineStatusBean = list[i]
|
||||||
|
|
||||||
|
var userId = userOnlineStatusBean!!.user_id
|
||||||
|
CommonAppContext.getInstance().onlineMap.set(
|
||||||
|
userId?.toString() ?: "",
|
||||||
|
userOnlineStatusBean!!.is_online
|
||||||
|
)
|
||||||
EventBus.getDefault().post(userOnlineStatusBean)
|
EventBus.getDefault().post(userOnlineStatusBean)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4163,6 +4243,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
ThreadUtils.cancel()
|
ThreadUtils.cancel()
|
||||||
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
|
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
|
||||||
stopkeepLiveService() //停止service
|
stopkeepLiveService() //停止service
|
||||||
|
CommonAppContext.getInstance().onlineMap.clear()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
LogUtils.e("cleanupResources error: " + e.message)
|
LogUtils.e("cleanupResources error: " + e.message)
|
||||||
}
|
}
|
||||||
@@ -4357,7 +4438,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
* 停止保活
|
* 停止保活
|
||||||
*/
|
*/
|
||||||
private fun stopkeepLiveService() {
|
private fun stopkeepLiveService() {
|
||||||
val isStartService = isServiceExisted(this, "com.example.modulerroom.service.RoomPlayService")
|
val isStartService =
|
||||||
|
isServiceExisted(this, "com.example.moduleroom.service.RoomPlayService")
|
||||||
if (isStartService) {
|
if (isStartService) {
|
||||||
val stopIntent = Intent(
|
val stopIntent = Intent(
|
||||||
this,
|
this,
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import android.app.Activity;
|
|||||||
|
|
||||||
import com.xscm.moduleutil.activity.IPresenter;
|
import com.xscm.moduleutil.activity.IPresenter;
|
||||||
import com.xscm.moduleutil.activity.IView;
|
import com.xscm.moduleutil.activity.IView;
|
||||||
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FriendshipRoomContacts {
|
public class FriendshipRoomContacts {
|
||||||
public interface View extends IView<Activity> {
|
public interface View extends IView<Activity> {
|
||||||
void applyPit();
|
void applyPit();
|
||||||
@@ -13,6 +16,8 @@ public class FriendshipRoomContacts {
|
|||||||
void endFriend(FriendUserBean friendUserBean);
|
void endFriend(FriendUserBean friendUserBean);
|
||||||
|
|
||||||
void createRelation();
|
void createRelation();
|
||||||
|
|
||||||
|
void userOnlineStatus(List<UserOnlineStatusBean> list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IRoomPre extends IPresenter {
|
public interface IRoomPre extends IPresenter {
|
||||||
@@ -25,5 +30,7 @@ public class FriendshipRoomContacts {
|
|||||||
void endFriend(String friend_id,String room_id);
|
void endFriend(String friend_id,String room_id);
|
||||||
|
|
||||||
void createRelation(String room_id,String friend_id,String user1_id,String user2_id,String relation_id);
|
void createRelation(String room_id,String friend_id,String user1_id,String user2_id,String relation_id);
|
||||||
|
|
||||||
|
void userOnlineStatus(String userId, String roomid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,14 @@ import com.example.moduleroom.dialog.RoomGiftDialogFragment;
|
|||||||
import com.example.moduleroom.dialog.RoomOnlineDialogFragment;
|
import com.example.moduleroom.dialog.RoomOnlineDialogFragment;
|
||||||
import com.example.moduleroom.dialog.RoomUserInfoFragment;
|
import com.example.moduleroom.dialog.RoomUserInfoFragment;
|
||||||
import com.example.moduleroom.presenter.FriendshipRoomPresenter;
|
import com.example.moduleroom.presenter.FriendshipRoomPresenter;
|
||||||
|
import com.example.moduleroom.presenter.SingSongPresenter;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
import com.xscm.moduleutil.base.BaseRoomFragment;
|
import com.xscm.moduleutil.base.BaseRoomFragment;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||||
import com.xscm.moduleutil.bean.UserInfo;
|
import com.xscm.moduleutil.bean.UserInfo;
|
||||||
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||||
@@ -48,6 +51,7 @@ import com.xscm.moduleutil.utils.ClickUtils;
|
|||||||
import com.xscm.moduleutil.utils.SpUtil;
|
import com.xscm.moduleutil.utils.SpUtil;
|
||||||
import com.xscm.moduleutil.utils.StringUtil;
|
import com.xscm.moduleutil.utils.StringUtil;
|
||||||
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
import com.xscm.moduleutil.widget.RoomFriendshipWheatView;
|
||||||
|
import com.xscm.moduleutil.widget.RoomSingSongWheatView;
|
||||||
import com.xscm.moduleutil.widget.SharedViewModel;
|
import com.xscm.moduleutil.widget.SharedViewModel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -84,6 +88,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
private boolean bottomIsAnimate = false;
|
private boolean bottomIsAnimate = false;
|
||||||
RoomConcernDialogFragment dialogFragment;
|
RoomConcernDialogFragment dialogFragment;
|
||||||
private Map<String, RoomFriendshipWheatView> userViewMap = new HashMap<>();
|
private Map<String, RoomFriendshipWheatView> userViewMap = new HashMap<>();
|
||||||
|
|
||||||
/// 底部的
|
/// 底部的
|
||||||
@Override
|
@Override
|
||||||
public void applyPit() {
|
public void applyPit() {
|
||||||
@@ -109,11 +114,30 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
|
||||||
|
if (list != null) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
String userOnlineStatusBean = list.get(i).getUser_id();
|
||||||
|
CommonAppContext.getInstance().onlineMap.put(userOnlineStatusBean, list.get(i).getIs_online());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (RoomFriendshipWheatView roomFriendshipWheatView : mWheatViews) {
|
||||||
|
if (roomFriendshipWheatView != null) {
|
||||||
|
RoomPitBean pitBean = roomFriendshipWheatView.pitBean;
|
||||||
|
roomFriendshipWheatView.setOnlineStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup
|
||||||
|
container, @Nullable Bundle savedInstanceState) {
|
||||||
// sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
// sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
//
|
//
|
||||||
// // 观察专门给子Fragment的数据
|
// // 观察专门给子Fragment的数据
|
||||||
@@ -127,7 +151,8 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConcernSelected(RoomRelationBean selectedDean, FriendUserBean relationshipList) {
|
public void onConcernSelected(RoomRelationBean selectedDean, FriendUserBean
|
||||||
|
relationshipList) {
|
||||||
MvpPre.createRelation(roomId, roomInfoResp.getFriend_info().getFriend_id() + "", relationshipList.getUser1_id(), relationshipList.getUser2_id(), selectedDean.getRelation_id());
|
MvpPre.createRelation(roomId, roomInfoResp.getFriend_info().getFriend_id() + "", relationshipList.getUser1_id(), relationshipList.getUser2_id(), selectedDean.getRelation_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +220,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
mWheatViews.add(mBinding.wheatView9);
|
mWheatViews.add(mBinding.wheatView9);
|
||||||
mWheatViews.add(mBinding.wheatView10);
|
mWheatViews.add(mBinding.wheatView10);
|
||||||
|
|
||||||
|
|
||||||
// 为每个麦位视图添加点击事件
|
// 为每个麦位视图添加点击事件
|
||||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||||
final int position = i;
|
final int position = i;
|
||||||
@@ -216,7 +240,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
public void onZhulClick(RoomFriendshipWheatView view, RoomPitBean pitBean) {
|
public void onZhulClick(RoomFriendshipWheatView view, RoomPitBean pitBean) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ClickUtils.isFastDoubleClick()) {
|
if (ClickUtils.isFastDoubleClick()) {
|
||||||
return; // 快速重复点击,直接返回
|
return; // 快速重复点击,直接返回
|
||||||
}
|
}
|
||||||
@@ -251,6 +274,32 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
initPopupWindow();
|
initPopupWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void tzblChanged() {
|
||||||
|
// mBinding.dhv9.updateTzbl(SpUtil.getTzbl(roomId));
|
||||||
|
|
||||||
|
StringBuilder userIds = new StringBuilder();
|
||||||
|
if (roomInfoResp != null && roomInfoResp.getRoom_info() != null && roomInfoResp.getRoom_info().getPit_list() != null) {
|
||||||
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
|
String userId = roomInfoResp.getRoom_info().getPit_list().get(i).getUser_id();
|
||||||
|
if (userId != null && !userId.equals("0") && !userId.isEmpty()) {
|
||||||
|
if (userIds.length() > 0) {
|
||||||
|
userIds.append(",");
|
||||||
|
}
|
||||||
|
userIds.append(userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userIds.length() > 0 && roomId != null) {
|
||||||
|
if (MvpPre == null) {
|
||||||
|
MvpPre = new FriendshipRoomPresenter(this, getActivity());
|
||||||
|
}
|
||||||
|
MvpPre.userOnlineStatus(userIds.toString(), roomId);
|
||||||
|
} else {
|
||||||
|
// updateWheatData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void upRoomInfo(RoomInfoResp roomInfoResp) {
|
public void upRoomInfo(RoomInfoResp roomInfoResp) {
|
||||||
this.roomInfoResp = roomInfoResp;
|
this.roomInfoResp = roomInfoResp;
|
||||||
}
|
}
|
||||||
@@ -270,26 +319,29 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
int pitNumber = position + 1; // 麦位编号(1-10)
|
int pitNumber = position + 1; // 麦位编号(1-10)
|
||||||
|
|
||||||
// 示例处理逻辑
|
// 示例处理逻辑
|
||||||
if (roomInfoResp != null && roomInfoResp.getRoom_info() != null) {
|
// if (roomInfoResp != null && roomInfoResp.getRoom_info() != null) {
|
||||||
if (position < roomInfoResp.getRoom_info().getPit_list().size()) {
|
// if (position < roomInfoResp.getRoom_info().getPit_list().size()) {
|
||||||
RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(position);
|
if (wheatView.pitBean != null) {
|
||||||
|
RoomPitBean pitBean = wheatView.pitBean;
|
||||||
|
// RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(position);
|
||||||
|
|
||||||
// 根据麦位状态处理点击事件
|
// 根据麦位状态处理点击事件
|
||||||
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
|
||||||
// 麦位上有人,可以查看用户信息等操作
|
// 麦位上有人,可以查看用户信息等操作
|
||||||
handleUserClick(pitBean);
|
handleUserClick(pitBean);
|
||||||
} else {
|
} else {
|
||||||
if (currentPartType.value == 2 || currentPartType.value == 3) {
|
if (currentPartType.value == 2 || currentPartType.value == 3) {
|
||||||
if (pitBean.getPit_number().equals("9") || pitBean.getPit_number().equals("10")) {
|
if (pitBean.getPit_number().equals("9") || pitBean.getPit_number().equals("10")) {
|
||||||
handleEmptyPitClick(wheatView, pitBean);
|
handleEmptyPitClick(wheatView, pitBean);
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// 麦位空闲,可以申请上麦等操作
|
return;
|
||||||
handleEmptyPitClick(wheatView, pitBean);
|
|
||||||
}
|
}
|
||||||
|
// 麦位空闲,可以申请上麦等操作
|
||||||
|
handleEmptyPitClick(wheatView, pitBean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -368,129 +420,134 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 2025/9/12 清除个人魅力
|
// TODO: 2025/9/12 清除个人魅力
|
||||||
public void event1059(RoomMessageEvent messageEvent) {
|
public void event1059(RoomMessageEvent messageEvent) {
|
||||||
RoomPitBean pitBean = mBinding.wheatView9.pitBean;
|
RoomPitBean pitBean = mBinding.wheatView9.pitBean;
|
||||||
if (pitBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean.setCharm("");
|
pitBean.setCharm("");
|
||||||
mBinding.wheatView9.setCardiac(pitBean.getCharm(),1f);
|
mBinding.wheatView9.setCardiac(pitBean.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean1 = mBinding.wheatView10.pitBean;
|
RoomPitBean pitBean1 = mBinding.wheatView10.pitBean;
|
||||||
if (pitBean1.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean1.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean1.setCharm("");
|
pitBean1.setCharm("");
|
||||||
mBinding.wheatView10.setCardiac(pitBean1.getCharm(),1f);
|
mBinding.wheatView10.setCardiac(pitBean1.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean2 = mBinding.wheatView1.pitBean;
|
RoomPitBean pitBean2 = mBinding.wheatView1.pitBean;
|
||||||
if (pitBean2.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean2.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean2.setCharm("");
|
pitBean2.setCharm("");
|
||||||
mBinding.wheatView1.setCardiac(pitBean2.getCharm(),1f);
|
mBinding.wheatView1.setCardiac(pitBean2.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean3 = mBinding.wheatView2.pitBean;
|
RoomPitBean pitBean3 = mBinding.wheatView2.pitBean;
|
||||||
if (pitBean3.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean3.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean3.setCharm("");
|
pitBean3.setCharm("");
|
||||||
mBinding.wheatView2.setCardiac(pitBean3.getCharm(),1f);
|
mBinding.wheatView2.setCardiac(pitBean3.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean4 = mBinding.wheatView3.pitBean;
|
RoomPitBean pitBean4 = mBinding.wheatView3.pitBean;
|
||||||
if (pitBean4.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean4.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean4.setCharm("");
|
pitBean4.setCharm("");
|
||||||
mBinding.wheatView3.setCardiac(pitBean4.getCharm(),1f);
|
mBinding.wheatView3.setCardiac(pitBean4.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean5 = mBinding.wheatView4.pitBean;
|
RoomPitBean pitBean5 = mBinding.wheatView4.pitBean;
|
||||||
if (pitBean5.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean5.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean5.setCharm("");
|
pitBean5.setCharm("");
|
||||||
mBinding.wheatView4.setCardiac(pitBean5.getCharm(),1f);
|
mBinding.wheatView4.setCardiac(pitBean5.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean6 = mBinding.wheatView5.pitBean;
|
RoomPitBean pitBean6 = mBinding.wheatView5.pitBean;
|
||||||
if (pitBean6.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean6.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean6.setCharm("");
|
pitBean6.setCharm("");
|
||||||
mBinding.wheatView5.setCardiac(pitBean6.getCharm(),1f);
|
mBinding.wheatView5.setCardiac(pitBean6.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RoomPitBean pitBean7 = mBinding.wheatView6.pitBean;
|
RoomPitBean pitBean7 = mBinding.wheatView6.pitBean;
|
||||||
if (pitBean7.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
if (pitBean7.getUser_id().equals(messageEvent.getText().getUser_id())) {
|
||||||
pitBean7.setCharm("");
|
pitBean7.setCharm("");
|
||||||
mBinding.wheatView6.setCardiac(pitBean7.getCharm(),1f);
|
mBinding.wheatView6.setCardiac(pitBean7.getCharm(), 1f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void event1003(RoomMessageEvent messageEvent){
|
public void event1003(RoomMessageEvent messageEvent) {
|
||||||
UserInfo fromUserInfo = messageEvent.getText().getFromUserInfo();
|
UserInfo fromUserInfo = messageEvent.getText().getFromUserInfo();
|
||||||
if (fromUserInfo == null) return;
|
if (fromUserInfo == null) return;
|
||||||
|
|
||||||
String pitNumber = messageEvent.getText().getPit_number();
|
String pitNumber = messageEvent.getText().getPit_number();
|
||||||
int userId = fromUserInfo.getUser_id();
|
int userId = fromUserInfo.getUser_id();
|
||||||
List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
// List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
||||||
if (pitList != null && !pitList.isEmpty()) {
|
// if (pitList != null && !pitList.isEmpty()) {
|
||||||
try {
|
// try {
|
||||||
RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
// RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
||||||
pitBean.setUser_id(userId + "");
|
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
|
||||||
pitBean.setAvatar(fromUserInfo.getAvatar());
|
pitBean.setUser_id(userId + "");
|
||||||
pitBean.setNickname(fromUserInfo.getNickname());
|
pitBean.setAvatar(fromUserInfo.getAvatar());
|
||||||
pitBean.setSex(fromUserInfo.getSex() + "");
|
pitBean.setNickname(fromUserInfo.getNickname());
|
||||||
pitBean.setCharm(fromUserInfo.getCharm());
|
pitBean.setSex(fromUserInfo.getSex() + "");
|
||||||
pitBean.setDress(fromUserInfo.getDress());
|
pitBean.setCharm(fromUserInfo.getCharm());
|
||||||
pitList.set(Integer.parseInt(pitNumber) - 1, pitBean);
|
pitBean.setDress(fromUserInfo.getDress());
|
||||||
if (userId==SpUtil.getUserId() && pitNumber.equals("9")){
|
// pitList.set(Integer.parseInt(pitNumber) - 1, pitBean);
|
||||||
myPitNumber=9;
|
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||||
configGameOptionBtn();
|
if (userId == SpUtil.getUserId() && pitNumber.equals("9")) {
|
||||||
|
myPitNumber = 9;
|
||||||
|
configGameOptionBtn();
|
||||||
// if (getActivity() instanceof RoomActivity) {
|
// if (getActivity() instanceof RoomActivity) {
|
||||||
// ((RoomActivity) getActivity()).ivSoundEffects(true);
|
// ((RoomActivity) getActivity()).ivSoundEffects(true);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
for (int i = 0; i < mWheatViews.size(); i++){
|
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||||
if (i==Integer.parseInt(pitNumber) - 1){
|
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||||
mWheatViews.get(i).setData(pitBean);
|
mWheatViews.get(i).setData(pitBean);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// Handle exception
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// } catch (NumberFormatException e) {
|
||||||
|
// // Handle exception
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
initUserViewMap();
|
initUserViewMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void event1004(RoomMessageEvent messageEvent){
|
public void event1004(RoomMessageEvent messageEvent) {
|
||||||
String pitNumber = messageEvent.getText().getPit_number();
|
String pitNumber = messageEvent.getText().getPit_number();
|
||||||
List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
// List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
||||||
if (pitList != null && !pitList.isEmpty()) {
|
// if (pitList != null && !pitList.isEmpty()) {
|
||||||
try {
|
// try {
|
||||||
RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
// RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
||||||
pitBean.setUser_id("");
|
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
|
||||||
pitBean.setAvatar("");
|
pitBean.setUser_id("");
|
||||||
pitBean.setNickname("");
|
pitBean.setAvatar("");
|
||||||
pitBean.setSex("");
|
pitBean.setNickname("");
|
||||||
pitBean.setCharm("");
|
pitBean.setSex("");
|
||||||
pitBean.setDress("");
|
pitBean.setCharm("");
|
||||||
pitList.set(Integer.parseInt(pitNumber) - 1, pitBean);
|
pitBean.setDress("");
|
||||||
if (pitNumber.equals("9")){
|
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||||
myPitNumber=0;
|
if (pitNumber.equals("9")) {
|
||||||
configGameOptionBtn();
|
myPitNumber = 0;
|
||||||
|
configGameOptionBtn();
|
||||||
// if (getActivity() instanceof RoomActivity) {
|
// if (getActivity() instanceof RoomActivity) {
|
||||||
// ((RoomActivity) getActivity()).ivSoundEffects(false);
|
// ((RoomActivity) getActivity()).ivSoundEffects(false);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
for (int i = 0; i < mWheatViews.size(); i++){
|
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||||
if (i==Integer.parseInt(pitNumber) - 1){
|
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||||
mWheatViews.get(i).setData(pitBean);
|
mWheatViews.get(i).setData(pitBean);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// Handle exception
|
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// } catch (NumberFormatException e) {
|
||||||
|
// // Handle exception
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
initUserViewMap();
|
initUserViewMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void event1035(RoomMessageEvent message) {
|
public void event1035(RoomMessageEvent message) {
|
||||||
|
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
@@ -510,28 +567,69 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void event1039(RoomMessageEvent messageEvent){
|
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
|
||||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
|
||||||
if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
public void event1039(RoomMessageEvent messageEvent) {
|
||||||
|
|
||||||
if (object != null) {
|
String fromPit = messageEvent.getText().getFrom_pit_number();
|
||||||
object.setData(roomPitBean);
|
String toPitNumber = messageEvent.getText().getTo_pit_number();
|
||||||
} else {
|
if (fromPit.equals("") || toPitNumber.equals("")) {
|
||||||
continue;
|
return;
|
||||||
|
}
|
||||||
|
RoomFriendshipWheatView fromWheatView = mWheatViews.get(Integer.parseInt(fromPit) - 1);
|
||||||
|
RoomFriendshipWheatView toWheatView = mWheatViews.get(Integer.parseInt(toPitNumber) - 1);
|
||||||
|
RoomPitBean fromPitBean = fromWheatView.pitBean;
|
||||||
|
RoomPitBean toPitBean = toWheatView.pitBean;
|
||||||
|
String tmpNumber = fromPitBean.getPit_number();
|
||||||
|
fromPitBean.setPit_number(toPitBean.getPit_number());
|
||||||
|
// roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(fromPit) - 1, fromPitBean);
|
||||||
|
toPitBean.setPit_number(tmpNumber);
|
||||||
|
toWheatView.setData(fromPitBean);
|
||||||
|
fromWheatView.setData(toPitBean);
|
||||||
|
for (RoomFriendshipWheatView view : mWheatViews) {
|
||||||
|
if (view == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (view.pitBean != null && view.pitBean.getUser_id() != null) {
|
||||||
|
if (view.pitBean.getUser_id().equals(messageEvent.getText().getFromUserInfo().getUser_id() + "")) {
|
||||||
|
if (!view.pitBean.getPit_number().equals(toPitNumber)) {
|
||||||
|
RoomPitBean bean = view.pitBean;
|
||||||
|
bean.setCharm("");
|
||||||
|
bean.setUser_id("");
|
||||||
|
bean.setDress("");
|
||||||
|
bean.setAvatar("");
|
||||||
|
bean.setNickname("");
|
||||||
|
bean.setSex("");
|
||||||
|
bean.setUser_code("");
|
||||||
|
bean.setDress_picture("");
|
||||||
|
view.setData(bean);
|
||||||
|
// roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(view.pitBean.getPit_number()) - 1, bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
|
// RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
||||||
|
// if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
||||||
|
//
|
||||||
|
// if (object != null) {
|
||||||
|
// object.setData(roomPitBean);
|
||||||
|
// } else {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在 initData() 方法中初始化映射关系
|
// 在 initData() 方法中初始化映射关系
|
||||||
//初始化对应的map
|
//初始化对应的map
|
||||||
private void initUserViewMap() {
|
private void initUserViewMap() {
|
||||||
userViewMap.clear();
|
userViewMap.clear();
|
||||||
// 注意:这里需要确保 pitBean 和 getUser_id() 在初始化时已经设置
|
// 注意:这里需要确保 pitBean 和 getUser_id() 在初始化时已经设置
|
||||||
@@ -545,6 +643,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
addToUserViewMap(mBinding.wheatView9);
|
addToUserViewMap(mBinding.wheatView9);
|
||||||
addToUserViewMap(mBinding.wheatView10);
|
addToUserViewMap(mBinding.wheatView10);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToUserViewMap(RoomFriendshipWheatView view) {
|
private void addToUserViewMap(RoomFriendshipWheatView view) {
|
||||||
if (view != null && view.pitBean != null &&
|
if (view != null && view.pitBean != null &&
|
||||||
view.pitBean.getUser_id() != null &&
|
view.pitBean.getUser_id() != null &&
|
||||||
@@ -566,8 +665,9 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
view.setCharm(charm);
|
view.setCharm(charm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 2025/9/12 更新火热值
|
// TODO: 2025/9/12 更新火热值
|
||||||
public void event1005(RoomMessageEvent messageEvent){
|
public void event1005(RoomMessageEvent messageEvent) {
|
||||||
|
|
||||||
List<UserInfo> toUserInfos = messageEvent.getText().getToUserInfos();
|
List<UserInfo> toUserInfos = messageEvent.getText().getToUserInfos();
|
||||||
|
|
||||||
@@ -948,7 +1048,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
* 心动数值变化
|
* 心动数值变化
|
||||||
*/
|
*/
|
||||||
public void friendHeartNumberDidChanged(List<FriendInfo.HeartList> heartLists) {
|
public void friendHeartNumberDidChanged(List<FriendInfo.HeartList> heartLists) {
|
||||||
if (roomInfoResp.getFriend_info()!=null) {
|
if (roomInfoResp.getFriend_info() != null) {
|
||||||
// 更新心动数值显示
|
// 更新心动数值显示
|
||||||
roomInfoResp.getFriend_info().setHeart_list(heartLists);
|
roomInfoResp.getFriend_info().setHeart_list(heartLists);
|
||||||
}
|
}
|
||||||
@@ -962,9 +1062,9 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
* @param pitArr 麦位数组
|
* @param pitArr 麦位数组
|
||||||
*/
|
*/
|
||||||
public void friendSeatDidChanged(List<RoomPitBean> pitArr) { // 使用实际的麦位模型类
|
public void friendSeatDidChanged(List<RoomPitBean> pitArr) { // 使用实际的麦位模型类
|
||||||
boolean isHaveMe=false;
|
boolean isHaveMe = false;
|
||||||
if (myPitNumber == 9 || myPitNumber == 10) {
|
if (myPitNumber == 9 || myPitNumber == 10) {
|
||||||
isHaveMe=true;
|
isHaveMe = true;
|
||||||
} else {
|
} else {
|
||||||
myPitNumber = -1;
|
myPitNumber = -1;
|
||||||
}
|
}
|
||||||
@@ -983,16 +1083,16 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
friendshipWheatView.setData(roomPitBean);
|
friendshipWheatView.setData(roomPitBean);
|
||||||
if (pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
if (pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||||
myPitNumber = Integer.parseInt(pitBean.getPit_number());
|
myPitNumber = Integer.parseInt(pitBean.getPit_number());
|
||||||
isHaveMe=true;
|
isHaveMe = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isHaveMe){
|
if (!isHaveMe) {
|
||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
((RoomActivity) getActivity()).setrlMic(false);
|
((RoomActivity) getActivity()).setrlMic(false);
|
||||||
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding);
|
||||||
AgoraManager.getInstance(getActivity()).setLocalAudioEnabled( false,SpUtil.getUserId()+"");
|
AgoraManager.getInstance(getActivity()).setLocalAudioEnabled(false, SpUtil.getUserId() + "");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
((RoomActivity) getActivity()).setrlMic(true);
|
((RoomActivity) getActivity()).setrlMic(true);
|
||||||
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
((RoomActivity) getActivity()).ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up);
|
||||||
@@ -1032,6 +1132,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
} else {
|
} else {
|
||||||
myPitNumber = -1;
|
myPitNumber = -1;
|
||||||
}
|
}
|
||||||
|
tzblChanged();
|
||||||
updateFriendshipState(FriendshipPartType.fromValue(roomInfoResp.getFriend_info().getStep()));
|
updateFriendshipState(FriendshipPartType.fromValue(roomInfoResp.getFriend_info().getStep()));
|
||||||
configGameOptionBtn();
|
configGameOptionBtn();
|
||||||
configTime();
|
configTime();
|
||||||
@@ -1112,7 +1213,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
mBinding.imX1.setVisibility(View.VISIBLE);
|
mBinding.imX1.setVisibility(View.VISIBLE);
|
||||||
// mBinding.iv11.setVisibility(View.VISIBLE);
|
// mBinding.iv11.setVisibility(View.VISIBLE);
|
||||||
mBinding.tv1.setVisibility(View.VISIBLE);
|
mBinding.tv1.setVisibility(View.VISIBLE);
|
||||||
mBinding.tv1.setText(StringUtil.toWan2(heartList2.getHeartNum()+"", 1));
|
mBinding.tv1.setText(StringUtil.toWan2(heartList2.getHeartNum() + "", 1));
|
||||||
// mBinding.tv1.setText(heartList2.getHeartNum() + "");
|
// mBinding.tv1.setText(heartList2.getHeartNum() + "");
|
||||||
// if (!topIsAnimate) {
|
// if (!topIsAnimate) {
|
||||||
// // 强制刷新视图
|
// // 强制刷新视图
|
||||||
@@ -1134,7 +1235,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
mBinding.imX3.setVisibility(View.VISIBLE);
|
mBinding.imX3.setVisibility(View.VISIBLE);
|
||||||
// mBinding.iv33.setVisibility(View.VISIBLE);
|
// mBinding.iv33.setVisibility(View.VISIBLE);
|
||||||
mBinding.tv3.setVisibility(View.VISIBLE);
|
mBinding.tv3.setVisibility(View.VISIBLE);
|
||||||
mBinding.tv3.setText(StringUtil.toWan2(heartList3.getHeartNum() + "",2));
|
mBinding.tv3.setText(StringUtil.toWan2(heartList3.getHeartNum() + "", 2));
|
||||||
// if (!bottomIsAnimate) {
|
// if (!bottomIsAnimate) {
|
||||||
// // 强制刷新视图
|
// // 强制刷新视图
|
||||||
// mBinding.iv33.requestLayout();
|
// mBinding.iv33.requestLayout();
|
||||||
@@ -1170,7 +1271,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
mBinding.tv3.setVisibility(GONE);
|
mBinding.tv3.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}else if (currentPartType.value == 1) {
|
} else if (currentPartType.value == 1) {
|
||||||
//隐藏中间心动值 、心动背景 、隐藏连线 连线停止动画
|
//隐藏中间心动值 、心动背景 、隐藏连线 连线停止动画
|
||||||
mBinding.imX2.setVisibility(GONE);
|
mBinding.imX2.setVisibility(GONE);
|
||||||
mBinding.imX1.setVisibility(GONE);
|
mBinding.imX1.setVisibility(GONE);
|
||||||
@@ -1234,7 +1335,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void songGift(RoomPitBean pitBean){
|
private void songGift(RoomPitBean pitBean) {
|
||||||
UserInfo userInfo = new UserInfo();
|
UserInfo userInfo = new UserInfo();
|
||||||
userInfo.setAvatar(pitBean.getAvatar());
|
userInfo.setAvatar(pitBean.getAvatar());
|
||||||
userInfo.setNickname(pitBean.getNickname());
|
userInfo.setNickname(pitBean.getNickname());
|
||||||
@@ -1253,55 +1354,55 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
md2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
md2 = roomInfoResp.getFriend_info().getHeart_list().get(1);
|
||||||
md3 = roomInfoResp.getFriend_info().getHeart_list().get(2);
|
md3 = roomInfoResp.getFriend_info().getHeart_list().get(2);
|
||||||
}
|
}
|
||||||
if (pitBean != null && pitBean.getUser_id() != null && pitBean.getUser_id().equals(SpUtil.getUserId() + "")){
|
if (pitBean != null && pitBean.getUser_id() != null && pitBean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||||
ToastUtils.showShort("不能给自己助力哦");
|
ToastUtils.showShort("不能给自己助力哦");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("1")){
|
if (pitBean.getPit_number().equals("1")) {
|
||||||
if (md2 != null && md2.getHeartNum() > 0 && mBinding.wheatView6.pitBean != null) {
|
if (md2 != null && md2.getHeartNum() > 0 && mBinding.wheatView6.pitBean != null) {
|
||||||
// 弹出礼物视图
|
// 弹出礼物视图
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("2")){
|
if (pitBean.getPit_number().equals("2")) {
|
||||||
if (md1 != null && md1.getHeartNum() > 0 && mBinding.wheatView5.pitBean != null) {
|
if (md1 != null && md1.getHeartNum() > 0 && mBinding.wheatView5.pitBean != null) {
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("3")){
|
if (pitBean.getPit_number().equals("3")) {
|
||||||
if (md3 != null && md3.getHeartNum() > 0 && mBinding.wheatView4.pitBean != null) {
|
if (md3 != null && md3.getHeartNum() > 0 && mBinding.wheatView4.pitBean != null) {
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("4")){
|
if (pitBean.getPit_number().equals("4")) {
|
||||||
if (md3 != null && md3.getHeartNum() > 0 && mBinding.wheatView3.pitBean != null) {
|
if (md3 != null && md3.getHeartNum() > 0 && mBinding.wheatView3.pitBean != null) {
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("5")){
|
if (pitBean.getPit_number().equals("5")) {
|
||||||
if (md1 != null && md1.getHeartNum() > 0 && mBinding.wheatView2.pitBean != null) {
|
if (md1 != null && md1.getHeartNum() > 0 && mBinding.wheatView2.pitBean != null) {
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pitBean.getPit_number().equals("6")){
|
if (pitBean.getPit_number().equals("6")) {
|
||||||
if (md2 != null && md2.getHeartNum() > 0 && mBinding.wheatView1.pitBean != null) {
|
if (md2 != null && md2.getHeartNum() > 0 && mBinding.wheatView1.pitBean != null) {
|
||||||
songGift(pitBean);
|
songGift(pitBean);
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
ToastUtils.showShort("暂未有心动连线,快去送TA礼物");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -1309,7 +1410,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVisibilityZL(){
|
private void setVisibilityZL() {
|
||||||
FriendInfo.HeartList md1 = null; //中心的集合
|
FriendInfo.HeartList md1 = null; //中心的集合
|
||||||
FriendInfo.HeartList md2 = null; //顶部的集合
|
FriendInfo.HeartList md2 = null; //顶部的集合
|
||||||
FriendInfo.HeartList md3 = null; //底部的集合
|
FriendInfo.HeartList md3 = null; //底部的集合
|
||||||
@@ -1477,7 +1578,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
|
|
||||||
mBinding.tvJsq.setVisibility(VISIBLE);
|
mBinding.tvJsq.setVisibility(VISIBLE);
|
||||||
mBinding.tvJsq.setText(time1 + "");
|
mBinding.tvJsq.setText(time1 + "");
|
||||||
if (time1==0){
|
if (time1 == 0) {
|
||||||
mBinding.tvJsq.setVisibility(GONE);
|
mBinding.tvJsq.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1528,7 +1629,8 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 2025/8/21 交友房阶段发生变化
|
// TODO: 2025/8/21 交友房阶段发生变化
|
||||||
public void upDataFriendship(FriendshipPartType type, int friend_id, long end_time, FriendUserBean userBean) {
|
public void upDataFriendship(FriendshipPartType type, int friend_id,
|
||||||
|
long end_time, FriendUserBean userBean) {
|
||||||
|
|
||||||
// updateFriendshipState(type);
|
// updateFriendshipState(type);
|
||||||
// countDownTime(end_time);
|
// countDownTime(end_time);
|
||||||
@@ -1562,13 +1664,14 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
/// self.cpView.model=relationModel;[self.cpView showInView:KEYWINDOW];
|
/// self.cpView.model=relationModel;[self.cpView showInView:KEYWINDOW];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearDialog(){
|
public void clearDialog() {
|
||||||
dialogFragment = (RoomConcernDialogFragment) getChildFragmentManager().findFragmentByTag("RoomConcernDialogFragment");
|
dialogFragment = (RoomConcernDialogFragment) getChildFragmentManager().findFragmentByTag("RoomConcernDialogFragment");
|
||||||
if (dialogFragment != null && dialogFragment.isAdded()) {
|
if (dialogFragment != null && dialogFragment.isAdded()) {
|
||||||
dialogFragment.dismiss();
|
dialogFragment.dismiss();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerWheatViews() {
|
public void registerWheatViews() {
|
||||||
|
|
||||||
|
|||||||
@@ -872,6 +872,7 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
|||||||
break;
|
break;
|
||||||
case 1002:
|
case 1002:
|
||||||
case 1012:
|
case 1012:
|
||||||
|
case 1011:
|
||||||
case 1014:
|
case 1014:
|
||||||
case 1013:
|
case 1013:
|
||||||
case 1026:
|
case 1026:
|
||||||
|
|||||||
@@ -812,6 +812,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
wheatView2.setOnlineStatus(bean);
|
wheatView2.setOnlineStatus(bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
|||||||
@@ -1412,17 +1412,17 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
|||||||
for (UserOnlineStatusBean bean : list) {
|
for (UserOnlineStatusBean bean : list) {
|
||||||
if (pitBean != null && pitBean.getUser_id() != null && !pitBean.getUser_id().isEmpty()) {
|
if (pitBean != null && pitBean.getUser_id() != null && !pitBean.getUser_id().isEmpty()) {
|
||||||
if (bean.getUser_id().equals(pitBean.getUser_id())) {
|
if (bean.getUser_id().equals(pitBean.getUser_id())) {
|
||||||
mBinding.muZc.setOnlineStatus(bean);
|
mBinding.muZc.setOnlineStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pitBean2 != null && pitBean2.getUser_id() != null && !pitBean2.getUser_id().isEmpty()) {
|
if (pitBean2 != null && pitBean2.getUser_id() != null && !pitBean2.getUser_id().isEmpty()) {
|
||||||
if (bean.getUser_id().equals(pitBean2.getUser_id())) {
|
if (bean.getUser_id().equals(pitBean2.getUser_id())) {
|
||||||
mBinding.muJb.setOnlineStatus(bean);
|
mBinding.muJb.setOnlineStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pitBean3 != null && pitBean3.getUser_id() != null && !pitBean3.getUser_id().isEmpty()) {
|
if (pitBean3 != null && pitBean3.getUser_id() != null && !pitBean3.getUser_id().isEmpty()) {
|
||||||
if (bean.getUser_id().equals(pitBean3.getUser_id())) {
|
if (bean.getUser_id().equals(pitBean3.getUser_id())) {
|
||||||
mBinding.muYc.setOnlineStatus(bean);
|
mBinding.muYc.setOnlineStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import com.google.android.flexbox.FlexboxLayout;
|
|||||||
import com.hjq.toast.ToastUtils;
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.luck.picture.lib.utils.DoubleUtils;
|
import com.luck.picture.lib.utils.DoubleUtils;
|
||||||
import com.xscm.moduleutil.base.BaseRoomFragment;
|
import com.xscm.moduleutil.base.BaseRoomFragment;
|
||||||
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||||
import com.xscm.moduleutil.bean.UserInfo;
|
import com.xscm.moduleutil.bean.UserInfo;
|
||||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
@@ -458,7 +459,8 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
|||||||
wheatLayoutSingManager.setOnWheatClickListener(new WheatLayoutSingManager.OnWheatClickListener() {
|
wheatLayoutSingManager.setOnWheatClickListener(new WheatLayoutSingManager.OnWheatClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onWheatClick(RoomSingSongWheatView view, int pitNumber1) {
|
public void onWheatClick(RoomSingSongWheatView view, int pitNumber1) {
|
||||||
RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(pitNumber1 - 1);
|
// RoomPitBean pitBean = roomInfoResp.getRoom_info().getPit_list().get(pitNumber1 - 1);
|
||||||
|
RoomPitBean pitBean = view.pitBean;
|
||||||
|
|
||||||
// 可选:点击事件处理
|
// 可选:点击事件处理
|
||||||
Log.d("Wheat", "Clicked pit: " + pitNumber1);
|
Log.d("Wheat", "Clicked pit: " + pitNumber1);
|
||||||
@@ -804,14 +806,21 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
|
public void userOnlineStatus(List<UserOnlineStatusBean> list) {
|
||||||
|
// if (list != null) {
|
||||||
|
// for (int i = 0; i < list.size(); i++) {
|
||||||
|
// if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
||||||
|
// wheatLayoutSingManager.updateSingleOnlineWheat(list.get(i));
|
||||||
|
// } else {
|
||||||
|
// wheatLayoutManager1.updateSingleOnlineWheat(list.get(i));
|
||||||
|
// }
|
||||||
|
//// EventBus.getDefault().post(list.get(i));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
String userOnlineStatusBean = list.get(i).getUser_id();
|
||||||
wheatLayoutSingManager.updateSingleOnlineWheat(list.get(i));
|
CommonAppContext.getInstance().onlineMap.put(userOnlineStatusBean, list.get(i).getIs_online());
|
||||||
} else {
|
|
||||||
wheatLayoutManager1.updateSingleOnlineWheat(list.get(i));
|
|
||||||
}
|
|
||||||
// EventBus.getDefault().post(list.get(i));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1337,9 +1346,10 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
|||||||
|
|
||||||
public void event1039(RoomMessageEvent message) {
|
public void event1039(RoomMessageEvent message) {
|
||||||
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
if (roomInfoRespPk == null || roomInfoRespPk.getPk_info() == null) {
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
// for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
wheatLayoutSingManager.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i), i + 1);
|
// wheatLayoutSingManager.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i), i + 1);
|
||||||
}
|
// }
|
||||||
|
wheatLayoutSingManager.setUpData(message);
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
wheatLayoutManager1.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i), i + 1);
|
wheatLayoutManager1.updateSingleWheat(roomInfoResp.getRoom_info().getPit_list().get(i), i + 1);
|
||||||
|
|||||||
@@ -4,8 +4,13 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.example.moduleroom.contacts.FriendshipRoomContacts;
|
import com.example.moduleroom.contacts.FriendshipRoomContacts;
|
||||||
import com.xscm.moduleutil.base.BaseRoomPresenter;
|
import com.xscm.moduleutil.base.BaseRoomPresenter;
|
||||||
|
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||||
import com.xscm.moduleutil.http.BaseObserver;
|
import com.xscm.moduleutil.http.BaseObserver;
|
||||||
|
import com.xscm.moduleutil.http.RetrofitClient;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
|
|
||||||
@@ -96,4 +101,22 @@ public class FriendshipRoomPresenter extends BaseRoomPresenter<FriendshipRoomCon
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void userOnlineStatus(String userId, String roomid) {
|
||||||
|
RetrofitClient.getInstance().userOnlineStatus(userId, roomid, new BaseObserver<List<UserOnlineStatusBean>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
addDisposable(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(List<UserOnlineStatusBean> userOnlineStatusBean) {
|
||||||
|
if (MvpRef==null){
|
||||||
|
MvpRef=new WeakReference<>(mView);
|
||||||
|
}
|
||||||
|
MvpRef.get().userOnlineStatus(userOnlineStatusBean);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.app.Service
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import com.tencent.imsdk.v2.V2TIMManager
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
//前台服务
|
//前台服务
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32" />
|
||||||
@@ -93,7 +94,12 @@
|
|||||||
<activity android:name="com.tencent.qcloud.tuikit.tuichat.minimalistui.page.GroupNoticeMinimalistActivity"
|
<activity android:name="com.tencent.qcloud.tuikit.tuichat.minimalistui.page.GroupNoticeMinimalistActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<!-- **************** Minimalist UI End **************** -->
|
<!-- **************** Minimalist UI End **************** -->
|
||||||
|
<service
|
||||||
|
android:name=".TUIChatService"
|
||||||
|
android:authorities="${applicationId}.TUIChat.Init"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="false"
|
||||||
|
tools:ignore="Instantiatable" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
Reference in New Issue
Block a user