n); 112 115
         if(position < 0 || position>=sessionList.size()){
113 116
             return;
114 117
         }
@@ -120,11 +123,38 @@ public class UploadPresenter implements UploadContract.Presenter,BaseInteractor.
120 123
         }else{
121 124
             for(PhotoBean photoBean : photoList){
122 125
                 if(photoBean.photoId == bean.photoId){
126
+                    LogHelper.d("czy","onPhotoUploaded and found data change "+position);
123 127
                     photoBean.uploadStatus = PhotoBean.UploadStatus.STATUS_SUCCESS;
124 128
                     break;
125 129
                 }
126 130
             }
127 131
         }
132
+        sessionBean.sessionPhotos = photoList;
133
+        uploadView.updateSessionUploadViewAt(position);
134
+    }
135
+
136
+    @Override
137
+    public synchronized void onPhotoUploadError(PhotoBean bean) {
138
+        int position = sessionList.size()-bean.sessionSeq;
139
+        LogHelper.d("czy","onPhotoUploadError and notify UI change at "+position);
140
+        if(position < 0 || position>=sessionList.size()){
141
+            return;
142
+        }
143
+        SessionBean sessionBean = sessionList.get(position);
144
+        ArrayList<PhotoBean> photoList = sessionBean.sessionPhotos;
145
+        if(photoList==null || photoList.size()==0){
146
+            photoList = new ArrayList<>();
147
+            photoList.add(bean);
148
+        }else{
149
+            for(PhotoBean photoBean : photoList){
150
+                if(photoBean.photoId == bean.photoId){
151
+                    LogHelper.d("czy","onPhotoUploaded and found data change "+position);
152
+                    photoBean.uploadStatus = PhotoBean.UploadStatus.STATUS_ERROR;
153
+                    break;
154
+                }
155
+            }
156
+        }
157
+        sessionBean.sessionPhotos = photoList;
128 158
         uploadView.updateSessionUploadViewAt(position);
129 159
     }
130 160
 }

pai2 - Gogs: Go Git Service

拍爱

Brightcells: a6195fa70d Add outtake lensman 7 年之前
..
__init__.py 7d85bed0b0 move errno_utils.py/response_utils.py into error file 9 年之前
errno_utils.py a6195fa70d Add outtake lensman 7 年之前
response_utils.py 385f4c5143 from StatusCode import StatusCodeField 8 年之前