1:修改排行榜页面,
2:修改拍卖房刷新数据 3:修改交友房刷新数据
This commit is contained in:
@@ -2,15 +2,21 @@ package com.xscm.moduleutil.base;
|
||||
|
||||
import static android.app.PendingIntent.getActivity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.callback.NavCallback;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnlineBean;
|
||||
@@ -254,41 +260,41 @@ public class RoomManager {
|
||||
// 获取房间数据
|
||||
|
||||
// 等待一段时间确保退出完成
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
navigateToRoom(context, roomId, password, null, false);
|
||||
// try {
|
||||
// Thread.sleep(50);
|
||||
// } catch (InterruptedException e) {
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
// navigateToRoom(context, roomId, password, null, false);
|
||||
LogUtils.dTag("RoomActivity", "fetchAndJoinRoom:"+roomId.toString());
|
||||
RetrofitClient.getInstance().roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
|
||||
|
||||
// RetrofitClient.getInstance().roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
|
||||
//
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(RoomInfoResp resp) {
|
||||
// String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
|
||||
// String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
|
||||
// String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
|
||||
// String rtm_token=resp.getUser_info().getAgora_rtm_token();
|
||||
// SpUtil.setRtmToken(rtm_token);
|
||||
// int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
|
||||
// boolean enableMic = false; // 是否开启麦克风
|
||||
// boolean enableJs=false; // 是否开启角色
|
||||
// if (resp.getUser_info().getPit_number()!=0){
|
||||
// enableJs=true;
|
||||
// }
|
||||
// LogUtils.e("token",token);
|
||||
// LogUtils.e("roomId:",roomId);
|
||||
//// 初始化 Agora 并加入房间
|
||||
// AgoraManager.getInstance(context)
|
||||
// .joinRoom(token, roomId, uid, enableMic,enableJs);
|
||||
// cacheRoomData(roomId, resp);
|
||||
// navigateToRoom(context, roomId, password, resp);
|
||||
// }
|
||||
// });
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(RoomInfoResp resp) {
|
||||
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
|
||||
String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
|
||||
String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
|
||||
String rtm_token = resp.getUser_info().getAgora_rtm_token();
|
||||
SpUtil.setRtmToken(rtm_token);
|
||||
int uid = SpUtil.getUserId(); // 0 表示由 Agora 自动生成 UID
|
||||
boolean enableMic = false; // 是否开启麦克风
|
||||
boolean enableJs = false; // 是否开启角色
|
||||
if (resp.getUser_info().getPit_number() != 0) {
|
||||
enableJs = true;
|
||||
}
|
||||
LogUtils.e("token", token);
|
||||
LogUtils.e("roomId:", roomId);
|
||||
// 初始化 Agora 并加入房间
|
||||
AgoraManager.getInstance(context)
|
||||
.joinRoom(token, roomId, uid, enableMic, enableJs);
|
||||
cacheRoomData(roomId, resp);
|
||||
navigateToRoom(context, roomId, password, resp, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,18 +329,21 @@ public class RoomManager {
|
||||
* @param roomInfo 房间信息
|
||||
*/
|
||||
private void navigateToRoom(Context context, String roomId, String password, RoomInfoResp roomInfo, boolean isOnline) {
|
||||
LogUtils.dTag("RoomActivity", "navigateToRoom"+roomInfo.toString());
|
||||
|
||||
try {
|
||||
// 构建跳转参数
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("roomId", roomId);
|
||||
bundle.putBoolean("isOnline", isOnline);
|
||||
|
||||
bundle.putSerializable("roomInfo", roomInfo);
|
||||
if (!TextUtils.isEmpty(password)) {
|
||||
bundle.putString("password", password);
|
||||
}
|
||||
|
||||
if (roomInfo != null) {
|
||||
// bundle.putSerializable("roomInfo", roomInfo);
|
||||
if (roomInfo == null){
|
||||
LogUtils.dTag("RoomActivity", "navigateToRoom:房间信息获取存在问题");
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用ARouter跳转到房间页面
|
||||
|
||||
Reference in New Issue
Block a user