82 fix bugs,网络请求timeout=30。隐藏init chat failed 弹窗。

This commit is contained in:
2025-12-29 22:29:01 +08:00
parent 67c56b2d4f
commit e6892d533c
10 changed files with 88 additions and 66 deletions

View File

@@ -63,7 +63,7 @@ public class RetrofitClient {
private static RetrofitClient INSTANCE;
private static ApiServer sApiServer;
public static final int DEFAULT_TIME_OUT = 10;
public static final int DEFAULT_TIME_OUT = 30;
private static OkHttpClient client;
private final Retrofit mRetrofit;

View File

@@ -846,6 +846,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
@Override
public void getThemeData(ThemeBean themeBean) {
if (themeBean != null) {
// 首页 tab 图标
selectedMediaUrl = themeBean.getHome_sel();
unselectedMediaUrl = themeBean.getHome_nor();

View File

@@ -3488,7 +3488,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onNext() {
// ToastUtils.showShort("下一首");
// 切换歌曲
// List<Music> musicSongBeans = AgoraManager.getInstance(RoomActivity.this).getMusicList();
// List<Music> musicSongBeans = AgoraManager.getInstance(RoomActivity.this).getMusicList();
AgoraManager.getInstance().nextSong()
}
})

View File

@@ -7,22 +7,27 @@ import com.xscm.modulemain.activity.room.contacts.RoomBackgroundContacts;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.bean.RoomBgBean;
import com.xscm.moduleutil.http.BaseObserver;
import com.xscm.moduleutil.http.RetrofitClient;
import com.xscm.moduleutil.presenter.BasePresenter;
import com.xscm.moduleutil.utils.cos.CosUploadManager;
import com.xscm.moduleutil.utils.oss.OSSOperUtils;
import java.io.File;
import java.lang.ref.WeakReference;
import io.reactivex.disposables.Disposable;
public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContacts.View> implements RoomBackgroundContacts.RoomBackgroudPre {
private RoomBackgroundContacts.View mView;
public RoomBackgroundPresenter(RoomBackgroundContacts.View view, Context context) {
super(view, context);
mView = view;
}
@Override
public void getBackgroundList() {
api.getBackgroundList(new BaseObserver<RoomBgBean>() {
RetrofitClient.getInstance().getBackgroundList(new BaseObserver<RoomBgBean>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
@@ -30,6 +35,9 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
@Override
public void onNext(RoomBgBean roomBgBeans) {
if (MvpRef == null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().getBackgroundList(roomBgBeans);
}
});
@@ -42,6 +50,9 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
@Override
public void onSuccess(String url) {
if (isViewAttach()) {
if (MvpRef == null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().upLoadSuccess(url, type, index, size);
}
@@ -58,26 +69,11 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
MvpRef.get().disLoadings();
}
});
// OSSOperUtils.newInstance().putObjectMethod(url, file.getPath(), new OSSOperUtils.OssCallback() {
// @Override
// public void onSuccess() {
// if (isViewAttach()) {
// MvpRef.get().upLoadSuccess(OSSOperUtils.AliYunOSSURLFile + url, type, index, size);
// }
// }
//
// @Override
// public void onFail() {
// if (isViewAttach()) {
// MvpRef.get().disLoadings();
// }
// }
// });
}
@Override
public void uploadBgImage(String id, String image_url) {
api.uploadBgImage(id, image_url, new BaseObserver<String>() {
RetrofitClient.getInstance().uploadBgImage(id, image_url, new BaseObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
@@ -85,6 +81,9 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
@Override
public void onNext(String string) {
if (MvpRef == null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().uploadBgImage();
}
});
@@ -92,7 +91,7 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
@Override
public void editRoom(String room_id, String room_name, String room_cover, String room_intro, String room_background) {
api.editRoom(room_id, room_name, room_cover, room_intro, room_background, new BaseObserver<String>() {
RetrofitClient.getInstance().editRoom(room_id, room_name, room_cover, room_intro, room_background, new BaseObserver<String>() {
@Override
public void onSubscribe(Disposable d) {
addDisposable(d);
@@ -100,6 +99,9 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
@Override
public void onNext(String string) {
if (MvpRef == null){
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().editRoom();
}
});

View File

@@ -332,9 +332,13 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
new Handler().postDelayed(() -> {
// 再次检查视图状态
if (uniqueId.equals(emojiImageView.getTag())) {
Glide.with(mContext)
.load(emMessage.getText().getEmoji().getImage())
.into(emojiImageView);
try {
Glide.with(mContext)
.load(emMessage.getText().getEmoji().getImage())
.into(emojiImageView);
}catch (Exception e){
LogUtils.e("e:"+e);
}
}
}, 1500);
}

View File

@@ -1,5 +1,6 @@
package com.xscm.modulemain.dialog
import android.app.Activity
import android.content.Context
import android.graphics.drawable.Drawable
import android.view.Gravity
@@ -20,7 +21,7 @@ import com.xscm.modulemain.databinding.DialogSignTypeBinding
import com.xscm.moduleutil.utils.ImageUtils
import com.xscm.moduleutil.widget.dialog.BaseDialog
class DialogSignType(context:Context) : BaseDialog<DialogSignTypeBinding>(context){
class DialogSignType(context:Activity) : BaseDialog<DialogSignTypeBinding>(context){
init {
window?.apply {
setGravity(Gravity.TOP)
@@ -58,7 +59,13 @@ class DialogSignType(context:Context) : BaseDialog<DialogSignTypeBinding>(contex
}
fun show(type:Int){
super.show()
if (context is Activity) {
val activity = context as Activity
if (!activity.isFinishing && !activity.isDestroyed) {
super.show()
}
}
//0:开始 1成功 2:失败
when(type){
0 ->{
@@ -85,9 +92,6 @@ class DialogSignType(context:Context) : BaseDialog<DialogSignTypeBinding>(contex
}, 1500)
}
}
}
var webpDrawable:WebpDrawable? = null
fun loadWebpOneStart(webp_anim: Int, mAnimView: ImageView?) {

View File

@@ -830,19 +830,24 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
private void upTitle(int boxPrice) {
if (type == 10) {
mBinding.mirroeSky.oneTitle.setText(boxPrice + "币一次");
mBinding.mirroeSky.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.mirroeSky.hundredTitle.setText((boxPrice * 9) + "");
} else if (type == 11) {
mBinding.cityTime.oneTitle.setText(boxPrice + "");
mBinding.cityTime.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.cityTime.hundredTitle.setText((boxPrice * 9) + "");
try {
//不知道什么原因会出现mBinding.pinnacleTime.oneTitle为空的情况
if (type == 10) {
mBinding.mirroeSky.oneTitle.setText(boxPrice + "");
mBinding.mirroeSky.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.mirroeSky.hundredTitle.setText((boxPrice * 9) + "");
} else if (type == 11) {
mBinding.cityTime.oneTitle.setText(boxPrice + "");
mBinding.cityTime.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.cityTime.hundredTitle.setText((boxPrice * 9) + "币九次");
} else if (type == 12) {
mBinding.pinnacleTime.oneTitle.setText(boxPrice + "币一次");
mBinding.pinnacleTime.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.pinnacleTime.hundredTitle.setText((boxPrice * 9) + "币九次");
} else if (type == 12) {
mBinding.pinnacleTime.oneTitle.setText(boxPrice + "币一次");
mBinding.pinnacleTime.tenTitle.setText((boxPrice * 6) + "币六次");
mBinding.pinnacleTime.hundredTitle.setText((boxPrice * 9) + "币九次");
}
}catch (Exception e){
e.printStackTrace();
}
}

View File

@@ -432,33 +432,39 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
}
private String getValue(int type, String key) {
Map<String, String> textMap = new HashMap<>();
textMap.put("is_manager", userInfo.getIs_manager().equals("1") ? "取消管理" : "设为管理");
textMap.put("is_host", userInfo.getIs_host().equals("1") ? "取消主持" : "设为主持");
textMap.put("is_mute", userInfo.getIs_mute_pit().equals("1") ? "开麦" : "禁麦");
textMap.put("is_mute_pit", userInfo.getIs_mute().equals("1") ? "解除禁言" : "");
try {
Map<String, String> textMap = new HashMap<>();
textMap.put("is_manager", userInfo.getIs_manager().equals("1") ? "取消管理" : "设为管理");
textMap.put("is_host", userInfo.getIs_host().equals("1") ? "取消主持" : "设为主持");
textMap.put("is_mute", userInfo.getIs_mute_pit().equals("1") ? "开麦" : "");
textMap.put("is_mute_pit", userInfo.getIs_mute().equals("1") ? "解除禁言" : "禁言");
switch (type) {
case 1://房主
if ("is_manager".equals(key)) return textMap.get("is_manager");
if ("is_host".equals(key)) return textMap.get("is_host");
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
case 2:
if ("is_host".equals(key)) return textMap.get("is_host");
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
case 3:
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
default:
break;
switch (type) {
case 1://房主
if ("is_manager".equals(key)) return textMap.get("is_manager");
if ("is_host".equals(key)) return textMap.get("is_host");
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
case 2:
if ("is_host".equals(key)) return textMap.get("is_host");
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
case 3:
if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break;
default:
break;
}
return "";
}catch (Exception e){
e.printStackTrace();
return "";
}
return "";
}
@Override

View File

@@ -54,7 +54,7 @@ public abstract class TUIBaseChatActivity extends BaseLightActivity {
if (chatInfo != null) {
initChat(chatInfo);
} else {
ToastUtil.toastShortMessage("init chat failed , chatInfo is empty.");
// ToastUtil.toastShortMessage("init chat failed , chatInfo is empty.");
TUIChatLog.e(TAG, "init chat failed , chatInfo is empty.");
finish();
}

View File

@@ -54,7 +54,7 @@ public abstract class TUIBaseChatMinimalistActivity extends BaseMinimalistLightA
if (chatInfo != null) {
initChat(chatInfo);
} else {
ToastUtil.toastShortMessage("init chat failed , chatInfo is empty.");
// ToastUtil.toastShortMessage("init chat failed , chatInfo is empty.");
TUIChatLog.e(TAG, "init chat failed , chatInfo is empty.");
finish();
}