|
@@ -70,6 +70,7 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
|
|
|
|
|
|
List<String> urlList = new ArrayList<>();
|
|
|
private int preUploadSize = 0;
|
|
|
+ private int uploadCompletedCount = 0;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -141,6 +142,7 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
|
|
|
private void uploadImg(int enableSelectSize) {
|
|
|
urlList.clear();
|
|
|
this.preUploadSize = enableSelectSize;
|
|
|
+ uploadCompletedCount = 0;
|
|
|
for (int i = 0; i < mPhotoListAdapter.getData().size(); i++) {
|
|
|
String compressPath = mPhotoListAdapter.getData().get(i).getCompressPath();
|
|
|
if (!TextUtils.isEmpty(compressPath)) {
|
|
@@ -288,11 +290,14 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
|
|
|
}
|
|
|
|
|
|
private double countUploadProgress(double currentProgress) {
|
|
|
- int size = urlList.size();
|
|
|
+ int size = uploadCompletedCount;
|
|
|
double cPercent = currentProgress / 100.0;
|
|
|
double singleMaxProgress = 100d / preUploadSize;
|
|
|
double result = size * singleMaxProgress + cPercent * singleMaxProgress;
|
|
|
- LOG.i("result:"+result+"-size:" + size + "-cPercent" + cPercent + "-singleMaxProgress:" + singleMaxProgress);
|
|
|
+ LOG.i("result:" + result + "-size:" + size + "-cPercent" + cPercent + "-singleMaxProgress:" + singleMaxProgress);
|
|
|
+ if (currentProgress == 100) {
|
|
|
+ uploadCompletedCount++;
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|