fix bugs 55 2
This commit is contained in:
@@ -2518,6 +2518,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||
}
|
||||
} else if (id == R.id.rl_gift) { //礼物
|
||||
LogUtils.e("RoomGiftDialogFragment_RoomActivity");
|
||||
val fragment = RoomGiftDialogFragment.show(
|
||||
mRoomInfoResp, null, roomId, 0, "",
|
||||
supportFragmentManager
|
||||
|
||||
@@ -33,10 +33,12 @@ import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class SettingPresenter extends BasePresenter<SettingConacts.View> implements SettingConacts.IMePre {
|
||||
private SettingConacts.View mView;
|
||||
|
||||
public SettingPresenter(SettingConacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearLoginInfo() {
|
||||
api.clearLoginInfo(new BaseObserver<String>() {
|
||||
@@ -47,8 +49,8 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().clearLoginInfo(s);
|
||||
}
|
||||
@@ -66,8 +68,8 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().cancel(s);
|
||||
}
|
||||
@@ -101,18 +103,18 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
try {
|
||||
File file = new File(Application.Companion.getInstance().getAppContent());
|
||||
|
||||
if (FileUtils.isFileExists(file.getParent() +"/DataInfo.zip")){
|
||||
FileUtils.delete(file.getParent() +"/DataInfo.zip");
|
||||
if (FileUtils.isFileExists(file.getParent() + "/DataInfo.zip")) {
|
||||
FileUtils.delete(file.getParent() + "/DataInfo.zip");
|
||||
}
|
||||
boolean isZip = ZipUtils.zipFile(Application.Companion.getInstance().getAppContent(),
|
||||
file.getParent() +"/DataInfo.zip");
|
||||
file.getParent() + "/DataInfo.zip");
|
||||
if (isZip) {
|
||||
emitter.onNext(file.getParent() + "/DataInfo.zip");
|
||||
}else {
|
||||
} else {
|
||||
emitter.onNext("");
|
||||
}
|
||||
}catch (Exception e){
|
||||
LogUtils.e("压缩失败",e.toString());
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("压缩失败", e.toString());
|
||||
emitter.onNext("");
|
||||
}
|
||||
}
|
||||
@@ -121,15 +123,15 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
@Override
|
||||
public void accept(String zipPath) {
|
||||
String upLogUrl = OSSOperUtils.getAppLogPath(new File(zipPath));
|
||||
if(!zipPath.isEmpty()){
|
||||
CosUploadManager.getInstance(Application.getInstance()).upParameters(upLogUrl,zipPath, new CosUploadManager.UploadCallback(){
|
||||
if (!zipPath.isEmpty()) {
|
||||
CosUploadManager.getInstance(Application.getInstance()).upParameters(upLogUrl, zipPath, new CosUploadManager.UploadCallback() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String url) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
api.sendAppLog(upLogUrl,url, new BaseObserver<String>() {
|
||||
api.sendAppLog(upLogUrl, url, new BaseObserver<String>() {
|
||||
|
||||
|
||||
@Override
|
||||
@@ -149,21 +151,27 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
ToastUtils.showLong("上传失败");
|
||||
LogUtils.e("上传失败",e.toString());
|
||||
LogUtils.e("上传失败", e.toString());
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure1(IllegalStateException e) {
|
||||
ToastUtils.showLong("上传失败");
|
||||
LogUtils.e("上传失败",e.toString());
|
||||
LogUtils.e("上传失败", e.toString());
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("上传失败");
|
||||
LogUtils.e("压缩失败");
|
||||
MvpRef.get().disLoadings();
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user