|
@@ -35,6 +35,7 @@ import com.cooleshow.base.utils.NumberUtils;
|
|
|
import com.cooleshow.base.utils.SizeUtils;
|
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
|
import com.cooleshow.base.utils.ToastUtil;
|
|
|
+import com.cooleshow.base.utils.UrlUtils;
|
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
|
import com.cooleshow.base.utils.helper.upload.UploadHelper;
|
|
|
import com.cooleshow.base.widgets.dialog.CommonConfirmDialog;
|
|
@@ -425,7 +426,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
MixHelper.getInstance().startMixForMp4(accompanimentMp3Path, recordFilePath, offsetValue, recordFileVolume, accompanyFileVolume, new ResultCallback<String>() {
|
|
|
@Override
|
|
|
public void onSuccess(String s) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -449,7 +450,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onProgress(int progressPercent) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -463,7 +464,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int errorCode, String errorStr) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -484,7 +485,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
MixHelper.getInstance().startMix(accompanimentMp3Path, recordFilePath, offsetValue, recordFileVolume, accompanyFileVolume, new ResultCallback<String>() {
|
|
|
@Override
|
|
|
public void onSuccess(String s) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -508,7 +509,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onProgress(int progressPercent) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -522,7 +523,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int errorCode, String errorStr) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -712,13 +713,18 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
if (file.exists()) {
|
|
|
return true;
|
|
|
}
|
|
|
+ boolean validDownloadUrl = UrlUtils.isValidDownloadUrl(recordUrl);
|
|
|
+ if (!validDownloadUrl) {
|
|
|
+ ToastUtil.getInstance().showShort("未找到演奏文件,请退出重试");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
Log.i("pq", "下载草稿");
|
|
|
setLoadingCancelable(false);
|
|
|
showLoading("草稿下载中");
|
|
|
MixHelper.getInstance().download(recordUrl, fileEndSuffix, new ResultCallback<String>() {
|
|
|
@Override
|
|
|
public void onSuccess(String s) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -732,7 +738,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onProgress(int progressPercent) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -745,7 +751,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int errorCode, String errorStr) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -770,12 +776,17 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
if (file.exists()) {
|
|
|
return true;
|
|
|
}
|
|
|
+ boolean validDownloadUrl = UrlUtils.isValidDownloadUrl(accompanyUrl);
|
|
|
+ if (!validDownloadUrl) {
|
|
|
+ ToastUtil.getInstance().showShort("未找到伴奏文件,请退出重试");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
setLoadingCancelable(false);
|
|
|
showLoading("伴奏下载中");
|
|
|
MixHelper.getInstance().download(accompanyUrl, MyFileUtils.MP3_FILE_SUFFIX, new ResultCallback<String>() {
|
|
|
@Override
|
|
|
public void onSuccess(String s) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -789,7 +800,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onProgress(int progressPercent) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -802,7 +813,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
|
|
|
@Override
|
|
|
public void onFail(int errorCode, String errorStr) {
|
|
|
- if(!checkActivityExist()){
|
|
|
+ if (!checkActivityExist()) {
|
|
|
return;
|
|
|
}
|
|
|
runOnUiThread(new Runnable() {
|
|
@@ -1018,7 +1029,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
return;
|
|
|
}
|
|
|
currentStep = 2;
|
|
|
- showToastViewAndFinish("发布成功",true);
|
|
|
+ showToastViewAndFinish("发布成功", true);
|
|
|
}
|
|
|
|
|
|
private void toFinish(boolean isReCallBack) {
|
|
@@ -1065,7 +1076,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
|
|
|
currentStep = 1;
|
|
|
mViewModel.getUpdateEvent().setValue(false);
|
|
|
if (isNeedFinishPage) {
|
|
|
- showToastViewAndFinish("保存成功",false);
|
|
|
+ showToastViewAndFinish("保存成功", false);
|
|
|
} else {
|
|
|
toUpdateLoadingText(getCurrentProgress(100), "保存成功");
|
|
|
mHandler.postDelayed(new Runnable() {
|