合并 new_dev

This commit is contained in:
2025-11-26 17:27:56 +08:00
19 changed files with 343 additions and 179 deletions

View File

@@ -106,6 +106,7 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
if (MvpPre == null) {
MvpPre = bindPresenter();
}
<<<<<<< HEAD
int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
@@ -117,6 +118,17 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
LogUtils.e("点击了~" + viewName);
if (id == R.id.ll_youth) {
=======
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(view.getId());
} catch (Exception e) {
viewName = "未知View ID: " + view.getId();
}
LogUtils.e("roomUserInfoFragment","点击了" + viewName );
if (view.getId() == R.id.ll_youth) {
>>>>>>> branch_new_dev
// startActivity(new Intent(this, UnderageActivity.class));
showYouthModelDialog();
} else if (id == R.id.ll_notification) {

View File

@@ -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();
}
}
});