es-code">
+
|
77
|
85
|
if(photoList!=null && photoList.size()>0){
|
|
78
|
86
|
String path = Constants.APP_IMAGE_DIR + File.separator+item.sessionId+File.separator
|
|
79
|
87
|
+Constants.THUMBNAIL_DIR_NAME+File.separator+item.sessionPhotos.get(0).photoName;
|
|
80
|
88
|
ImageLoaderUtils.displayLocalImage(path, holder.photo, options);
|
|
81
|
89
|
int uploaded = 0;
|
|
|
90
|
+ int error = 0;
|
|
82
|
91
|
for(PhotoBean bean : photoList){
|
|
83
|
|
- if(bean.isUploaded){
|
|
|
92
|
+ if(bean.uploadStatus == PhotoBean.UploadStatus.STATUS_SUCCESS){
|
|
84
|
93
|
uploaded++;
|
|
85
|
94
|
}
|
|
|
95
|
+ if(bean.uploadStatus == PhotoBean.UploadStatus.STATUS_ERROR){
|
|
|
96
|
+ error++;
|
|
|
97
|
+ }
|
|
|
98
|
+ }
|
|
|
99
|
+ if(error>0){
|
|
|
100
|
+ holder.uploadStatus.setText(R.string.upload_error);
|
|
|
101
|
+ }else if(uploaded<photoList.size()){
|
|
|
102
|
+ holder.uploadStatus.setText(R.string.upload_processing);
|
|
|
103
|
+ }else{
|
|
|
104
|
+ holder.uploadStatus.setText(R.string.upload_success);
|
|
86
|
105
|
}
|
|
87
|
|
- holder.uploadStatus.setText(getUploadStatusText(item.sessionPhotos));
|
|
88
|
106
|
holder.uploadProgressBar.setProgress(100*uploaded/photoList.size());
|
|
89
|
107
|
}
|
|
90
|
|
- int height = width;
|
|
91
|
|
- ViewGroup.LayoutParams lp=holder.photo.getLayoutParams();
|
|
92
|
|
- lp.width = width;
|
|
93
|
|
- lp.height = height;
|
|
94
|
|
- holder.photo.setLayoutParams(lp);
|
|
95
|
|
- holder.sesseionSeq.setText(String.valueOf(item.sessionSeq));
|
|
96
|
108
|
holder.itemView.setOnClickListener(new View.OnClickListener(){
|
|
97
|
109
|
@Override
|
|
98
|
110
|
public void onClick(View v) {
|
|
|
|
@@ -111,18 +123,6 @@ public class SessionRecyclerAdapter extends RecyclerView.Adapter<SessionRecycler
|
|
111
|
123
|
return sessionList.size();
|
|
112
|
124
|
}
|
|
113
|
125
|
|
|
114
|
|
- private String getUploadStatusText(ArrayList<PhotoBean> photoList){
|
|
115
|
|
- int uploaded = 0;
|
|
116
|
|
- for(PhotoBean bean : photoList){
|
|
117
|
|
- if(bean.isUploaded){
|
|
118
|
|
- uploaded++;
|
|
119
|
|
- }
|
|
120
|
|
- }
|
|
121
|
|
- String uploadStr = uploaded+"/"+photoList.size();
|
|
122
|
|
-
|
|
123
|
|
- return uploadStr;
|
|
124
|
|
- }
|
|
125
|
|
-
|
|
126
|
126
|
|
|
127
|
127
|
class MyViewHolder extends RecyclerView.ViewHolder{
|
|
128
|
128
|
|
|
|
|
@@ -95,7 +95,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.View
|
|
95
|
95
|
|
|
96
|
96
|
@Override
|
|
97
|
97
|
public void updateSessionUploadViewAt(int position) {
|
|
98
|
|
-
|
|
|
98
|
+ adapter.notifyItemChanged(position);
|
|
99
|
99
|
}
|
|
100
|
100
|
|
|
101
|
101
|
@Override
|
|
|
|
@@ -120,7 +120,7 @@ public class UploadPresenter implements UploadContract.Presenter,BaseInteractor.
|
|
120
|
120
|
}else{
|
|
121
|
121
|
for(PhotoBean photoBean : photoList){
|
|
122
|
122
|
if(photoBean.photoId == bean.photoId){
|
|
123
|
|
- photoBean.isUploaded = true;
|
|
|
123
|
+ photoBean.uploadStatus = PhotoBean.UploadStatus.STATUS_SUCCESS;
|
|
124
|
124
|
break;
|
|
125
|
125
|
}
|
|
126
|
126
|
}
|
|
|
|
@@ -14,6 +14,10 @@
|
|
14
|
14
|
<string name="login_fail">登录失败</string>
|
|
15
|
15
|
<string name="please_wait">请稍候</string>
|
|
16
|
16
|
|
|
|
17
|
+ <string name="upload_processing">上传中</string>
|
|
|
18
|
+ <string name="upload_error">上传失败</string>
|
|
|
19
|
+ <string name="upload_success">上传成功</string>
|
|
|
20
|
+
|
|
17
|
21
|
<string name="network_disconnect">当前无网络连接</string>
|
|
18
|
22
|
|
|
19
|
23
|
<string name="qr_scan_hint">将取景框对准二维码,\n即可自动扫码</string>
|